Stanford nlp 无法加载情绪模型
错误 原因:java.io.IOException:无法解析 “edu/stanford/nlp/models/touction/touction.ser.gz”作为任意一个类 路径、文件名或URL 代码Stanford nlp 无法加载情绪模型,stanford-nlp,Stanford Nlp,错误 原因:java.io.IOException:无法解析 “edu/stanford/nlp/models/touction/touction.ser.gz”作为任意一个类 路径、文件名或URL 代码 String text = "I am feeling very sad and frustrated."; Properties props = new Properties(); props.put("pos.model", "edu/stanford/n
String text = "I am feeling very sad and frustrated.";
Properties props = new Properties();
props.put("pos.model", "edu/stanford/nlp/models/pos-tagger/wsj-bidirectional/wsj-0-18-bidirectional-distsim.tagger");
// props.put("sentiment.model", "/Users/Prateek/Downloads/stanford-corenlp-models-current.jar");
props.setProperty("annotators", "tokenize, ssplit, pos, lemma, parse, sentiment");
使用的罐子
斯坦福-corenlp-3.2.0-model.jar
stanford-corenlp-3.5.2.jar您的模型jar和代码jar版本不匹配。您正在使用3.5.2版的代码和3.2版的模型。我没有得到正确的JAR,您能提供JAR或JAR的链接吗?您可以从网站下载最新的JAR: