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
11a59fd7
Commit
11a59fd7
authored
May 27, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #364 from edx/will/ai-grading-pr-feedback
Will/ai grading pr feedback
parents
3fef491d
5378d5ae
Hide 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 @
11a59fd7
...
@@ -13,8 +13,8 @@ from openassessment.assessment.errors import (
...
@@ -13,8 +13,8 @@ from openassessment.assessment.errors import (
AIGradingRequestError
,
AIGradingInternalError
AIGradingRequestError
,
AIGradingInternalError
)
)
from
openassessment.assessment.models
import
(
from
openassessment.assessment.models
import
(
AITrainingWorkflow
,
InvalidOptionSelection
,
NoTrainingExamples
,
Assessment
,
AITrainingWorkflow
,
AIGradingWorkflow
,
Assessment
,
AITrainingWorkflow
,
AIGradingWorkflow
,
InvalidOptionSelection
,
NoTrainingExamples
,
AIClassifierSet
,
AI_ASSESSMENT_TYPE
AIClassifierSet
,
AI_ASSESSMENT_TYPE
)
)
from
openassessment.assessment.worker
import
training
as
training_tasks
from
openassessment.assessment.worker
import
training
as
training_tasks
...
@@ -46,6 +46,10 @@ def submit(submission_uuid, rubric, algorithm_id):
...
@@ -46,6 +46,10 @@ def submit(submission_uuid, rubric, algorithm_id):
AIGradingRequestError
AIGradingRequestError
AIGradingInternalError
AIGradingInternalError
Example usage:
>>> submit('74a9d63e8a5fea369fd391d07befbd86ae4dc6e2', rubric, 'ease')
'10df7db776686822e501b05f452dc1e4b9141fe5'
"""
"""
try
:
try
:
workflow
=
AIGradingWorkflow
.
start_workflow
(
submission_uuid
,
rubric
,
algorithm_id
)
workflow
=
AIGradingWorkflow
.
start_workflow
(
submission_uuid
,
rubric
,
algorithm_id
)
...
@@ -72,7 +76,7 @@ def submit(submission_uuid, rubric, algorithm_id):
...
@@ -72,7 +76,7 @@ def submit(submission_uuid, rubric, algorithm_id):
try
:
try
:
classifier_set_candidates
=
AIClassifierSet
.
objects
.
filter
(
classifier_set_candidates
=
AIClassifierSet
.
objects
.
filter
(
rubric
=
workflow
.
rubric
,
algorithm_id
=
algorithm_id
rubric
=
workflow
.
rubric
,
algorithm_id
=
algorithm_id
)
.
order_by
(
'-created_at'
)
[:
1
]
)[:
1
]
# If we find classifiers for this rubric/algorithm
# If we find classifiers for this rubric/algorithm
# then associate the classifiers with the workflow
# then associate the classifiers with the workflow
...
@@ -116,6 +120,16 @@ def get_latest_assessment(submission_uuid):
...
@@ -116,6 +120,16 @@ def get_latest_assessment(submission_uuid):
Raises:
Raises:
AIGradingInternalError
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
:
try
:
assessments
=
Assessment
.
objects
.
filter
(
assessments
=
Assessment
.
objects
.
filter
(
...
@@ -156,6 +170,10 @@ def train_classifiers(rubric_dict, examples, algorithm_id):
...
@@ -156,6 +170,10 @@ def train_classifiers(rubric_dict, examples, algorithm_id):
AITrainingRequestError
AITrainingRequestError
AITrainingInternalError
AITrainingInternalError
Example usage:
>>> train_classifiers(rubric, examples, 'ease')
'10df7db776686822e501b05f452dc1e4b9141fe5'
"""
"""
# Get or create the rubric and training examples
# Get or create the rubric and training examples
try
:
try
:
...
...
apps/openassessment/assessment/models/ai.py
View file @
11a59fd7
...
@@ -71,7 +71,7 @@ class AIClassifierSet(models.Model):
...
@@ -71,7 +71,7 @@ class AIClassifierSet(models.Model):
class
Meta
:
class
Meta
:
app_label
=
"assessment"
app_label
=
"assessment"
ordering
=
[
'-created_at'
]
ordering
=
[
'-created_at'
,
'-id'
]
# The rubric associated with this set of classifiers
# The rubric associated with this set of classifiers
# We should have one classifier for each of the criteria in the rubric.
# We should have one classifier for each of the criteria in the rubric.
...
...
apps/openassessment/assessment/worker/training.py
View file @
11a59fd7
...
@@ -99,12 +99,14 @@ def train_classifiers(workflow_uuid):
...
@@ -99,12 +99,14 @@ def train_classifiers(workflow_uuid):
u"Training example format was not valid "
u"Training example format was not valid "
u"(training workflow UUID {})"
u"(training workflow UUID {})"
)
.
format
(
workflow_uuid
)
)
.
format
(
workflow_uuid
)
logger
.
exception
(
msg
)
raise
train_classifiers
.
retry
()
raise
train_classifiers
.
retry
()
except
AIAlgorithmError
:
except
AIAlgorithmError
:
msg
=
(
msg
=
(
u"An error occurred while training AI classifiers "
u"An error occurred while training AI classifiers "
u"(training workflow UUID {})"
u"(training workflow UUID {})"
)
.
format
(
workflow_uuid
)
)
.
format
(
workflow_uuid
)
logger
.
exception
(
msg
)
raise
train_classifiers
.
retry
()
raise
train_classifiers
.
retry
()
# Upload the classifiers
# Upload the classifiers
...
@@ -116,6 +118,7 @@ def train_classifiers(workflow_uuid):
...
@@ -116,6 +118,7 @@ def train_classifiers(workflow_uuid):
u"An error occurred while uploading trained classifiers "
u"An error occurred while uploading trained classifiers "
u"(training workflow UUID {})"
u"(training workflow UUID {})"
)
.
format
(
workflow_uuid
)
)
.
format
(
workflow_uuid
)
logger
.
exception
(
msg
)
raise
train_classifiers
.
retry
()
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