I am working on a research about NLP, i woul to use Stanford parser to extract noun phrases from text, the parser version i used is 3.4.1 this is the sample code i used
As others have pointed out you have to include the jar files that come along with the CORE-NLP package that is avalaible at the stanford parser page.
More specifically add these to your class path : stanford-parser-3.4.1-models.jar,stanford-parser-3.4.1-sources.jar,stanford-parser.jar ( these are specific to the version of stanford parser you are using i.e version 3.4.1 )
You can add it to the class path as follows :
For Linux : export CLASSPATH=$CLASSPATH:/some_path/stanford-parser-3.4.1-sources.jar:/some_path/stanford-parser-3.4.1-models.jar:/some_path/stanford-parser.jar
For Windows : set CLASSPATH=%CLASSPATH%;\some_path\stanford-parser-3.4.1-models.jar;\some_path\stanford-parser-3.4.1-sources.jar;\some_path\stanford-parser;
Yes, You do not have CoreNLP models Jar. Either you can download them from here- http://nlp.stanford.edu/software/corenlp.shtml#Download
or, you can do this:
In the pom.xml file, add this dependency.
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.5.0</version>
<classifier>models</classifier>
</dependency>
Do maven clean, maven update and maven install. The model files will be installed in your .m2 folder automatically.
I hope you know maven. If not, please post a comment / question. We will answer.
You need to have the CoreNLP models jar (downloadable from the CoreNLP homepage) on your classpath for the parser to work properly.