Stanford NLP Nuclear Center LexicalizedParser Model

I am new to NLP. I am trying an example program with LexicalizedParser , but I cannot find this model.

 String parseModel = "...../models/lexparser/englishPCFG.ser.gz"; LexicalizedParser lecicalizedParser = LexicalizedParser.loadModel(parseModel); 

I have the required stanford-core-nlp-3.5.2.jar and ner jar also in the way of building an example Java application.

I tried to reference the absolute path of the kernel and load it, but could not. :(

How can I refer to the exact location of this model from my program code?

Thanks so much for any help and all help!

+5
source share
1 answer

If you are using maven, make sure you include both of these pom.xml dependencies

 <dependency> <groupId>edu.stanford.nlp</groupId> <artifactId>stanford-corenlp</artifactId> <version>3.5.2</version> </dependency> <dependency> <groupId>edu.stanford.nlp</groupId> <artifactId>stanford-corenlp</artifactId> <version>3.5.2</version> <classifier>models</classifier> </dependency> 

This model is englishPCFG.ser.gz
inside the packaging edu.stanford.nlp.models.lexparser
inside stanford-corenlp-3.5.2-models.jar

So you should use this path:

 String parseModel = "edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz" 
+4
source

Source: https://habr.com/ru/post/1235123/


All Articles