def create(text,score,prompt_string, dump_data=False):
if dump_data:<EOL><INDENT>dump_input_data(text, score)<EOL><DEDENT>algorithm = select_algorithm(score)<EOL>results = {'<STR_LIT>': [],'<STR_LIT:success>' : False, '<STR_LIT>' : <NUM_LIT:0>, '<STR_LIT>': <NUM_LIT:0>,<EOL>'<STR_LIT>' : "<STR_LIT>", '<STR_LIT>' : "<STR_LIT>", '<STR_LIT>' : algorithm,<EOL>'<STR_LIT>' : score, '<STR_LIT:text>' : text, '<STR_LIT>' : prompt_string}<EOL>if len(text)!=len(score):<EOL><INDENT>msg = "<STR_LIT>"<EOL>results['<STR_LIT>'].append(msg)<EOL>log.exception(msg)<EOL>return results<EOL><DEDENT>try:<EOL><INDENT>e_set = model_creator.create_essay_set(text, score, prompt_string)<EOL><DEDENT>except:<EOL><INDENT>msg = "<STR_LIT>"<EOL>results['<STR_LIT>'].append(msg)<EOL>log.exception(msg)<EOL><DEDENT>try:<EOL><INDENT>feature_ext, classifier, cv_error_results = model_creator.extract_features_and_generate_model(e_set, algorithm = algorithm)<EOL>results['<STR_LIT>']=cv_error_results['<STR_LIT>']<EOL>results['<STR_LIT>']=cv_error_results['<STR_LIT>']<EOL>results['<STR_LIT>']=feature_ext<EOL>results['<STR_LIT>']=classifier<EOL>results['<STR_LIT>'] = algorithm<EOL>results['<STR_LIT:success>']=True<EOL><DEDENT>except:<EOL><INDENT>msg = "<STR_LIT>"<EOL>results['<STR_LIT>'].append(msg)<EOL>log.exception(msg)<EOL><DEDENT>return results<EOL>
Creates a machine learning model from input text, associated scores, a prompt, and a path to the model
TODO: Remove model path argument, it is needed for now to support legacy code
text - A list of strings containing the text of the essays
score - a list of integers containing score values
prompt_string - the common prompt for the set of essays