Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-ora2
Commits
3fef491d
Commit
3fef491d
authored
May 23, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #362 from edx/will/ai-grading-info-level-logging
Will/ai grading info level logging
parents
ac4251dd
53d095ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
apps/openassessment/assessment/api/ai.py
+14
-1
apps/openassessment/assessment/api/ai_worker.py
+14
-3
No files found.
apps/openassessment/assessment/api/ai.py
View file @
3fef491d
...
...
@@ -83,7 +83,16 @@ def submit(submission_uuid, rubric, algorithm_id):
workflow
.
classifier_set
=
classifier_set_candidates
[
0
]
workflow
.
save
()
grading_tasks
.
grade_essay
.
apply_async
(
args
=
[
workflow
.
uuid
])
logger
.
info
((
u"Scheduled grading task for AI grading workflow with UUID {workflow_uuid} "
u"(submission UUID = {sub_uuid}, algorithm ID = {algorithm_id})"
)
.
format
(
workflow_uuid
=
workflow
.
uuid
,
sub_uuid
=
submission_uuid
,
algorithm_id
=
algorithm_id
))
else
:
logger
.
info
((
u"Cannot schedule a grading task for AI grading workflow with UUID {workflow_uuid} "
u"because no classifiers are available for the rubric associated with submission {sub_uuid} "
u"for the algorithm {algorithm_id}"
)
.
format
(
workflow_uuid
=
workflow
.
uuid
,
sub_uuid
=
submission_uuid
,
algorithm_id
=
algorithm_id
))
return
workflow
.
uuid
except
Exception
as
ex
:
msg
=
(
...
...
@@ -171,6 +180,10 @@ def train_classifiers(rubric_dict, examples, algorithm_id):
# Schedule the task, parametrized by the workflow UUID
try
:
training_tasks
.
train_classifiers
.
apply_async
(
args
=
[
workflow
.
uuid
])
logger
.
info
((
u"Scheduled training task for the AI training workflow with UUID {workflow_uuid} "
u"(algorithm ID = {algorithm_id})"
)
.
format
(
workflow_uuid
=
workflow
.
uuid
,
algorithm_id
=
algorithm_id
))
except
:
msg
=
(
u"An unexpected error occurred while scheduling "
...
...
apps/openassessment/assessment/api/ai_worker.py
View file @
3fef491d
...
...
@@ -115,6 +115,13 @@ def create_assessment(grading_workflow_uuid, criterion_scores):
try
:
if
not
workflow
.
is_complete
:
workflow
.
complete
(
criterion_scores
)
logger
.
info
((
u"Created assessment for AI grading workflow with UUID {workflow_uuid} "
u"(algorithm ID {algorithm_id})"
)
.
format
(
workflow_uuid
=
workflow
.
uuid
,
algorithm_id
=
workflow
.
algorithm_id
))
else
:
msg
=
u"Grading workflow with UUID {} is already marked complete"
.
format
(
workflow
.
uuid
)
logger
.
info
(
msg
)
except
DatabaseError
as
ex
:
msg
=
(
u"An unexpected error occurred while creating the assessment "
...
...
@@ -226,12 +233,16 @@ def create_classifiers(training_workflow_uuid, classifier_set):
workflow
=
AITrainingWorkflow
.
objects
.
get
(
uuid
=
training_workflow_uuid
)
# If the task is executed multiple times, the classifier set may already
# have been created. If so, log
a warning
then return immediately.
# have been created. If so, log
it,
then return immediately.
if
workflow
.
is_complete
:
msg
=
u"AI training workflow with UUID {} already has trained classifiers."
logger
.
warning
(
msg
)
msg
=
u"AI training workflow with UUID {} already has trained classifiers."
.
format
(
workflow
.
uuid
)
logger
.
info
(
msg
)
else
:
workflow
.
complete
(
classifier_set
)
logger
.
info
((
u"Created trained classifiers for the AI training workflow with UUID {workflow_uuid} "
u"(using algorithm ID {algorithm_id})"
)
.
format
(
workflow_uuid
=
workflow
.
uuid
,
algorithm_id
=
workflow
.
algorithm_id
))
except
AITrainingWorkflow
.
DoesNotExist
:
msg
=
(
u"Could not retrieve AI training workflow with UUID {}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment