3

I cannot find the Stanford parsing models for German and French: there is no "germanPCFG.ser.gz" or "frenchFactored.ser.gz" in the jar (stanford-corenlp-3.2.0-models.jar) - only english. Have searched through posttagger jar too.

Same issue encountered at : How to use Stanford CoreNLP with a Non-English parse model?

Community
  • 1
  • 1
user3032470
  • 31
  • 1
  • 3

2 Answers2

5

You can find them in the download for the Stanford Parser. Look in the models.jar file.

Christopher Manning
  • 9,360
  • 34
  • 46
  • Many thanks for that, I had the corenlp and the pos tagger downloads, didnt realise I was still missing the parser.. I am however, getting an error when running with the above, possibly due to discrepancy. Have downloaded all the latest versions, but still getting Unknown option: -retainTmpSubcategories: Loading parser from serialized file edu/stanford/nlp/models/lexparser/frenchFactored.ser.gz ... done [4.6 sec]. Exception in thread "main" java.lang.IllegalArgumentException: Unknown option: -retainTmpSubcategories at edu.stanford.nlp.parser.lexparser.Options.setOption(Options.java:175) – user3032470 Nov 26 '13 at 17:35
  • You need to add the flag `-parse.flags ""`. (It's sort of a misfeature/bug that we turn this option on by default, because it is useful for English, but it isn't defined for other languages.) – Christopher Manning Nov 27 '13 at 00:33
  • Many thanks again! Should have added my thanks earlier, but was caught up progressing my code once past that hurdle. Is this in the documentation, and I am not looking in right place.. – user3032470 Dec 02 '13 at 14:28
2

With Maven you can use

<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>         <!-- English models -->
</dependency>

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

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

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

Maven will download the jar file for the german models to your home directory:
~/.m2/repository/edu/stanford/nlp/stanford-corenlp/3.5.2/stanford-corenlp-3.5.2-models-german.jar

rmv
  • 3,195
  • 4
  • 26
  • 29