Commit d2c4d678 by gradyward

Added some quick changes to test EASiEr integration

parent 231f4c7c
...@@ -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_feats(essay_set) features = feature_extractor.generate_features(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}"
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment