Commit 74ae53ee authored by stefan's avatar stefan

fixed bug with w2v loaded for every request

parent a310cdad
......@@ -60,7 +60,7 @@ public enum SemanticCorpora implements Serializable {
this.corpora = corpora;
this.lang = lang;
this.simType = simType;
this.fullPath = SEMANTIC_CORPORA_ROOT + '/' + lang.toString().toUpperCase() + '/' + simType.getAcronym() + '/' + corpora;
this.fullPath = SEMANTIC_CORPORA_ROOT + lang.toString().toUpperCase() + '/' + simType.getAcronym() + '/' + corpora;
}
public String getCorpora() {
......
......@@ -105,12 +105,13 @@ public class Word2VecModel implements ISemanticModel {
}
public static Word2VecModel loadWord2Vec(String path, Lang language) {
path += "/word2vec.model";
for (Word2VecModel w2v : LOADED_WORD2VEC_MODELS) {
if (path.equals(w2v.getPath())) {
return w2v;
}
}
Word2VecModel w2v = loadFromTextFile(path + "/word2vec.model", language);
Word2VecModel w2v = loadFromTextFile(path, language);
LOADED_WORD2VEC_MODELS.add(w2v);
return w2v;
}
......
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