0

I have followed the following URL to set up stanford CoreNLP.

My $CLASSPATH is the following.

https://stanfordnlp.github.io/CoreNLP/download.html

$ echo $CLASSPATH | sed 's/:/\n/g'
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/javax.json-api-1.0-sources.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/ejml-0.23.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/slf4j-api.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/stanford-corenlp-3.9.0-javadoc.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/stanford-corenlp-3.9.0-sources.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/protobuf.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/stanford-corenlp-3.9.0-models.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/joda-time.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/joda-time-2.9-sources.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/xom-1.2.10-src.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/xom.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/javax.json.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/stanford-corenlp-3.9.0.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/jollyday.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/slf4j-simple.jar
/Users/myname/doc/src/dvcs/stanford-corenlp-full-2018-01-31/jollyday-0.4.9-sources.jar

But when I run it, I got the following error. Does anybody know what is wrong? Thanks.

$ echo "the quick brown fox jumped over the lazy dog" > input.txt
$ java -mx3g edu.stanford.nlp.pipeline.StanfordCoreNLP -outputFormat json -file input.txt
Searching for resource: StanfordCoreNLP.properties
Searching for resource: edu/stanford/nlp/pipeline/StanfordCoreNLP.properties
Adding annotator tokenize
Adding annotator ssplit
Adding annotator pos
Exception in thread "main" java.lang.RuntimeException: edu.stanford.nlp.io.RuntimeIOException: Unrecoverable error while loading a tagger model
    at edu.stanford.nlp.pipeline.StanfordCoreNLP$4.create(StanfordCoreNLP.java:493)
    at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:81)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:260)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:127)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:123)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.main(StanfordCoreNLP.java:1251)
Caused by: edu.stanford.nlp.io.RuntimeIOException: Unrecoverable error while loading a tagger model
    at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:749)
    at edu.stanford.nlp.tagger.maxent.MaxentTagger.<init>(MaxentTagger.java:283)
    at edu.stanford.nlp.tagger.maxent.MaxentTagger.<init>(MaxentTagger.java:247)
    at edu.stanford.nlp.pipeline.POSTaggerAnnotator.loadModel(POSTaggerAnnotator.java:78)
    at edu.stanford.nlp.pipeline.POSTaggerAnnotator.<init>(POSTaggerAnnotator.java:62)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP$4.create(StanfordCoreNLP.java:491)
    ... 5 more
Caused by: java.io.IOException: Unable to resolve "edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger" as either class path, filename or URL
    at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:419)
    at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:744)
    ... 10 more

1 Answer 1

0

I'm a nearby but I remember that you may have to set the env. variable STANFORD_MODELS with the list of directories containing your model files xxx-models.jar It seems to be in the online doc. Hope it may help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.