stanfordnlp/CoreNLP

Can't use retrained sentiment analysis model on Eclipse

jessicaaamango opened this issue · 1 comments

Not getting an error at all, the output is just using the regular corenlp sentiment analysis rather than my retrained version.

public static String filePath8 = "src/retraining/trees/model-0009-80.10.ser.gz";

private static StanfordCoreNLPClient init() {
Properties props = new Properties();
props.put("sentiment.model", "Users/benit/retraining/trees/model-0009-80.10.ser.gz");
props = PropertiesUtils.asProperties(
"annotators", "tokenize,pos,lemma,ner,parse,sentiment,ssplit",
"ner.model", "edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz");
StanfordCoreNLPClient pipeline = new StanfordCoreNLPClient(props, "http://localhost", 9001, 2);
return pipeline;
}

I tried setting the second argument for the props.put("sentiment.model", filePath8) instead of looking for the file on my computer, and still nothing. The retrained sentiment analysis folder is also on my eclipse by the way.

Properties props = new Properties();
props.put("sentiment.model", "Users/benit/retraining/trees/model-0009-80.10.ser.gz");
// you just clobbered the properties with the sentiment.model key
props = PropertiesUtils.asProperties(