I am new to NLP.
I am trying a sample program with LexicalizedParser
but am not able to locate the 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 the ner jar too in build path of a sample Java application.
I tried referring the absolute path of the core jar and load it but could not. :(
How can I refer to the exact location of this model from my program code?
A big thank you for any help and all help!
If you use maven, make sure you include both of these dependencies in you pom.xml
<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 englishPCFG.ser.gz
is inside package edu.stanford.nlp.models.lexparser
that is inside stanford-corenlp-3.5.2-models.jar
So you should use this path:
String parseModel = "edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With