It would have been helpful to see how you defined your properties. If you used default properties, you're probably just missing the models.jar (like this one for version 3.2) in your classpath. Download it and make sure that it gets loaded.
If you configure the properties some other way, you may have syntax errors in the string that result in IO errors. Here's what my custom properties for loading a different pos.model
look like:
Properties props = new Properties(); // using wsj-bidirectional model props.put("pos.model", "edu/stanford/nlp/models/pos-tagger/wsj-bidirectional/wsj-0-18-bidirectional-distsim.tagger"); // using standard pipeline props.put("annotators", "tokenize, ssplit, pos, lemma, parse"); // create pipeline StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
It's important to note that there is no leading slash /
in the path.
If that doesn't help, please have a look at Galal Aly's tutorial where the tagger is extracted from the models file and loaded separately.
Read full article from .net - Specifying a path to Models for StanfordCoreNLP - Stack Overflow
No comments:
Post a Comment