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
5378d5ae
Commit
5378d5ae
authored
May 27, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respond to PR feedback
parent
3fef491d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
apps/openassessment/assessment/api/ai.py
+20
-2
apps/openassessment/assessment/models/ai.py
+1
-1
apps/openassessment/assessment/worker/training.py
+3
-0
No files found.
apps/openassessment/assessment/api/ai.py
View file @
5378d5ae
...
...
@@ -13,8 +13,8 @@ from openassessment.assessment.errors import (
AIGradingRequestError
,
AIGradingInternalError
)
from
openassessment.assessment.models
import
(
AITrainingWorkflow
,
InvalidOptionSelection
,
NoTrainingExamples
,
Assessment
,
AITrainingWorkflow
,
AIGradingWorkflow
,
InvalidOptionSelection
,
NoTrainingExamples
,
AIClassifierSet
,
AI_ASSESSMENT_TYPE
)
from
openassessment.assessment.worker
import
training
as
training_tasks
...
...
@@ -46,6 +46,10 @@ def submit(submission_uuid, rubric, algorithm_id):
AIGradingRequestError
AIGradingInternalError
Example usage:
>>> submit('74a9d63e8a5fea369fd391d07befbd86ae4dc6e2', rubric, 'ease')
'10df7db776686822e501b05f452dc1e4b9141fe5'
"""
try
:
workflow
=
AIGradingWorkflow
.
start_workflow
(
submission_uuid
,
rubric
,
algorithm_id
)
...
...
@@ -72,7 +76,7 @@ def submit(submission_uuid, rubric, algorithm_id):
try
:
classifier_set_candidates
=
AIClassifierSet
.
objects
.
filter
(
rubric
=
workflow
.
rubric
,
algorithm_id
=
algorithm_id
)
.
order_by
(
'-created_at'
)
[:
1
]
)[:
1
]
# If we find classifiers for this rubric/algorithm
# then associate the classifiers with the workflow
...
...
@@ -116,6 +120,16 @@ def get_latest_assessment(submission_uuid):
Raises:
AIGradingInternalError
Examle usage:
>>> get_latest_assessment('10df7db776686822e501b05f452dc1e4b9141fe5')
{
'points_earned': 6,
'points_possible': 12,
'scored_at': datetime.datetime(2014, 1, 29, 17, 14, 52, 649284 tzinfo=<UTC>),
'scorer': u"ease",
'feedback': u''
}
"""
try
:
assessments
=
Assessment
.
objects
.
filter
(
...
...
@@ -156,6 +170,10 @@ def train_classifiers(rubric_dict, examples, algorithm_id):
AITrainingRequestError
AITrainingInternalError
Example usage:
>>> train_classifiers(rubric, examples, 'ease')
'10df7db776686822e501b05f452dc1e4b9141fe5'
"""
# Get or create the rubric and training examples
try
:
...
...
apps/openassessment/assessment/models/ai.py
View file @
5378d5ae
...
...
@@ -71,7 +71,7 @@ class AIClassifierSet(models.Model):
class
Meta
:
app_label
=
"assessment"
ordering
=
[
'-created_at'
]
ordering
=
[
'-created_at'
,
'-id'
]
# The rubric associated with this set of classifiers
# We should have one classifier for each of the criteria in the rubric.
...
...
apps/openassessment/assessment/worker/training.py
View file @
5378d5ae
...
...
@@ -99,12 +99,14 @@ def train_classifiers(workflow_uuid):
u"Training example format was not valid "
u"(training workflow UUID {})"
)
.
format
(
workflow_uuid
)
logger
.
exception
(
msg
)
raise
train_classifiers
.
retry
()
except
AIAlgorithmError
:
msg
=
(
u"An error occurred while training AI classifiers "
u"(training workflow UUID {})"
)
.
format
(
workflow_uuid
)
logger
.
exception
(
msg
)
raise
train_classifiers
.
retry
()
# Upload the classifiers
...
...
@@ -116,6 +118,7 @@ def train_classifiers(workflow_uuid):
u"An error occurred while uploading trained classifiers "
u"(training workflow UUID {})"
)
.
format
(
workflow_uuid
)
logger
.
exception
(
msg
)
raise
train_classifiers
.
retry
()
...
...
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