Commit 6ad21117 by Vik Paruchuri

fixed tests and server

parent 708153d1
...@@ -23,12 +23,12 @@ def grade(grader_path,submission): ...@@ -23,12 +23,12 @@ def grade(grader_path,submission):
results = {'errors': [],'tests': [],'correct': False,'score': 0} results = {'errors': [],'tests': [],'correct': False,'score': 0}
#Try to find and load the model file #Try to find and load the model file
try: try:
grader_data=pickle.load(file(grader_path,"r")) grader_data=pickle.load(file(grader_path,"r"))
except: except:
results['errors'].append("Could not find a valid model file.") results['errors'].append("Could not find a valid model file.")
grader_set=EssaySet(type="test")
grader_set=essay_set(type="test")
#Try to add essays to essay set object #Try to add essays to essay set object
try: try:
...@@ -51,7 +51,6 @@ def grade(grader_path,submission): ...@@ -51,7 +51,6 @@ def grade(grader_path,submission):
results['correct']=True results['correct']=True
else: else:
results['correct']=False results['correct']=False
return results return results
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -37,20 +37,21 @@ def send(payload, answer): ...@@ -37,20 +37,21 @@ def send(payload, answer):
if r.status_code != requests.codes.ok: if r.status_code != requests.codes.ok:
print "Request error:{0},{1},{2}".format(r.headers,payload,answer) print "Request error:{0},{1},{2}".format(r.headers,payload,answer)
print "Text: ", r.text parsed_text=json.loads(r.text)
print "Score:{0} {1}".format(parsed_text['score'],parsed_text['correct'])
return r.text return r.text
def check_contains(string, substr): def check_contains(string, substr):
if not substr in string: if not substr in string:
print "ERROR: Expected '{0}' in '{1}'".format(substr, string) print "ERROR: Expected to be {0}".format(substr)
return False return False
else: else:
return True return True
def check_not_contains(string, substr): def check_not_contains(string, substr):
if substr in string: if substr in string:
print "ERROR: Expected '{0}' not to be in '{1}'".format(substr, string) print "ERROR: Expected to be {0}".format(substr)
return False return False
else: else:
return True return True
......
...@@ -23,9 +23,13 @@ def main(argv): ...@@ -23,9 +23,13 @@ def main(argv):
score, text = model_creator.read_in_test_data(args.train_file) score, text = model_creator.read_in_test_data(args.train_file)
prompt_string = model_creator.read_in_test_prompt(args.prompt_file) prompt_string = model_creator.read_in_test_prompt(args.prompt_file)
print("data read")
e_set = model_creator.create_essay_set(text, score, prompt_string) e_set = model_creator.create_essay_set(text, score, prompt_string)
print("essay set created")
feature_ext, classifier = model_creator.extract_features_and_generate_model(e_set) feature_ext, classifier = model_creator.extract_features_and_generate_model(e_set)
print("features pulled out and model generated")
model_creator.dump_model_to_file(prompt_string, feature_ext, classifier, args.model_path) model_creator.dump_model_to_file(prompt_string, feature_ext, classifier, args.model_path)
print("model file written")
if __name__ == "__main__": if __name__ == "__main__":
main(sys.argv[1:]) main(sys.argv[1:])
......
in the experiment i would make up one's mind the ma of from each one try out geminate the vinegar into deoxyadenosine monophosphate container then recording label . i would waiting minute then swarm knocked out the vinegar and wind tabu with urine . let the sample distribution wry and ascertain the pot remainder in order to replicate this experiment , we would need to know the temperature of the vinegar as well as how much vinegar to put in . both of these could vary and therefore change the result of the experiment .
\ No newline at end of file \ No newline at end of file
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