Commit bf87cfa7 by Vik Paruchuri

Alter create to use the full passed in path

parent 44738c16
......@@ -22,9 +22,7 @@ def create(text,score,prompt_string,model_path):
except:
results['errors'].append("feature extraction and model creation failed.")
try:
full_path=os.path.join(base_path,model_path)
util_functions.create_directory(full_path)
model_creator.dump_model_to_file(prompt_string, feature_ext, classifier, text, score, full_path)
model_creator.dump_model_to_file(prompt_string, feature_ext, classifier, text, score, model_path)
results['created']=True
except:
results['errors'].append("could not write model to: {0}".format(model_path))
......
......@@ -24,13 +24,6 @@ def create_model_path(model_path):
return model_path
def create_directory(model_path):
directory=path(model_path).dirname()
if not os.path.exists(directory):
os.makedirs(directory)
return True
def sub_chars(string):
"""
Strips illegal characters from a string. Used to sanitize input essays.
......
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