[Solved]: Exception in thread "main" java.lang.RuntimeException: edu.stanford.nlp.io.RuntimeIOException: Error while loading a tagger model (probably missing model file)



Problem Statement:  Error when using StanfordCoreNLP

Exception in thread "main" java.lang.RuntimeException: edu.stanford.nlp.io.RuntimeIOException: Error while loading a tagger model (probably missing model file) at edu.stanford.nlp.pipeline.AnnotatorFactories 4.create(AnnotatorFactories. Java:290) ... 5 more Caused by: java.io.IOException: Unable to open "edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger" as class path, filename or URL at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:485) at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:765) ... 11 more

Solution: 

An easier way to add those model files is to simply add following dependencies in your pom.xml and let maven manage it for you:

 <properties>    <stanford.corenlp.version>3.9.1</stanford.corenlp.version> </properties>  <dependencies>      <!-- Stanford dependecies -->       <dependency>            <groupId>edu.stanford.nlp</groupId>           <artifactId>stanford-corenlp</artifactId>           <version>${stanford.corenlp.version}</version>  </dependency>   <dependency>            <groupId>edu.stanford.nlp</groupId>           <artifactId>stanford-corenlp</artifactId>           <version>${stanford.corenlp.version}</version>           <classifier>models</classifier>   </dependency>  </dependencies>