Java Stanford折叠依赖项分析器错误:loadmodel

Java Stanford折叠依赖项分析器错误:loadmodel,java,parsing,nlp,netbeans-7,stanford-nlp,Java,Parsing,Nlp,Netbeans 7,Stanford Nlp,我想得到斯坦福大学崩溃的依赖项解析器。这是我的代码: import edu.stanford.nlp.ling.CoreLabel; import edu.stanford.nlp.ling.Sentence; import edu.stanford.nlp.parser.lexparser.LexicalizedParser; import edu.stanford.nlp.trees.*; import java.util.List; class Parser{ public static

我想得到斯坦福大学崩溃的依赖项解析器。这是我的代码:

import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.ling.Sentence;
import edu.stanford.nlp.parser.lexparser.LexicalizedParser;
import edu.stanford.nlp.trees.*;
import java.util.List;

class Parser{
public static void main(String[] args) {
            LexicalizedParser lp = LexicalizedParser.loadModel("edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz");
            lp.setOptionFlags(new String[] { "-maxLength", "80","-retainTmpSubcategories" });
            String[] sent = { "This", "is", "an", "easy", "sentence", "." };
            List<CoreLabel> rawWords = Sentence.toCoreLabelList(sent);
            Tree parse = lp.apply(rawWords);
            parse.pennPrint();
            System.out.println();

            TreebankLanguagePack tlp = new PennTreebankLanguagePack();
            GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();
            GrammaticalStructure gs = gsf.newGrammaticalStructure(parse);
            List<TypedDependency> tdl = gs.typedDependenciesCCprocessed();
            System.out.println(tdl);
            TreePrint tp = new TreePrint("penn,typedDependenciesCollapsed");
            tp.printTree(parse);
            }
我收到的错误消息是:

 cannot find symbol, symbol: method loadModel(java.lang.String), location: class.LexicalizedParser lp = LexicalizedParser.loadModel("edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz"); "
以及

lp.setOptionFlags(new String[] { "-maxLength", "80","-retainTmpSubcategories" });
显示以下错误消息

setOptionFlags(java.lang.String..)is not public in edu.stanford.nlp.parser.lexparser.LexicalizedParser; cannot be accessed from outside package.

我已经导入了“stanford-corenlp-1.3.0.jar”。我怎样才能解决这个问题呢?

您在斯坦福CoreNLP 3.5.2上试过吗

最新下载可在此处找到:


您在斯坦福CoreNLP 3.5.2上试过吗

最新下载可在此处找到:

setOptionFlags(java.lang.String..)is not public in edu.stanford.nlp.parser.lexparser.LexicalizedParser; cannot be accessed from outside package.