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
d2c4d678
Commit
d2c4d678
authored
Jun 13, 2014
by
gradyward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some quick changes to test EASiEr integration
parent
231f4c7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
openassessment/assessment/worker/algorithm.py
+4
-3
scripts/benchmark_ai.py
+2
-0
No files found.
openassessment/assessment/worker/algorithm.py
View file @
d2c4d678
...
@@ -236,12 +236,12 @@ class EaseAIAlgorithm(AIAlgorithm):
...
@@ -236,12 +236,12 @@ class EaseAIAlgorithm(AIAlgorithm):
# to strip out non-ASCII chars.
# to strip out non-ASCII chars.
essay_set
=
cache
.
get
(
'grading_essay_set'
)
essay_set
=
cache
.
get
(
'grading_essay_set'
)
if
essay_set
is
None
:
if
essay_set
is
None
:
essay_set
=
EssaySet
(
essaytype
=
"test"
)
essay_set
=
EssaySet
(
essay
_
type
=
"test"
)
essay_set
.
add_essay
(
text
.
encode
(
'ascii'
,
'ignore'
),
0
)
essay_set
.
add_essay
(
text
.
encode
(
'ascii'
,
'ignore'
),
0
)
cache
[
'grading_essay_set'
]
=
essay_set
cache
[
'grading_essay_set'
]
=
essay_set
# Extract features from the text
# Extract features from the text
features
=
feature_extractor
.
gen
_feat
s
(
essay_set
)
features
=
feature_extractor
.
gen
erate_feature
s
(
essay_set
)
# Predict a score
# Predict a score
return
int
(
score_classifier
.
predict
(
features
)[
0
])
return
int
(
score_classifier
.
predict
(
features
)[
0
])
...
@@ -289,7 +289,8 @@ class EaseAIAlgorithm(AIAlgorithm):
...
@@ -289,7 +289,8 @@ class EaseAIAlgorithm(AIAlgorithm):
)
.
format
(
traceback
=
traceback
.
format_exc
())
)
.
format
(
traceback
=
traceback
.
format_exc
())
raise
TrainingError
(
msg
)
raise
TrainingError
(
msg
)
if
not
results
.
get
(
'success'
,
False
):
#TODO Ask Will about this!!!
if
not
results
.
get
(
'success'
,
True
):
msg
=
(
msg
=
(
u"Errors occurred while training classifiers "
u"Errors occurred while training classifiers "
u"using EASE: {errors}"
u"using EASE: {errors}"
...
...
scripts/benchmark_ai.py
View file @
d2c4d678
...
@@ -7,6 +7,8 @@ import os
...
@@ -7,6 +7,8 @@ import os
import
json
import
json
import
time
import
time
import
contextlib
import
contextlib
import
logging
logging
.
basicConfig
()
from
openassessment.assessment.worker.algorithm
import
AIAlgorithm
,
EaseAIAlgorithm
from
openassessment.assessment.worker.algorithm
import
AIAlgorithm
,
EaseAIAlgorithm
...
...
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