Getting Locations at Stanford Core NLP

I use stanford-corenlp-3.2.0.jar and stanford-corenlp-3.2.0-models.jar to determine locations in a specific sentence. However, I noticed that stanford-nlp cannot determine the location if the word is passed in a small register.

For example: "Find a restaurant in London" . Here, Stanford identifies London as a location.

However, if the following sentence reads: β€œFind a restaurant in London, ” then Stanford will not be able to identify london as a place.

To solve this problem, I convert the first letter of each word in a sentence to a capital letter. However, I get other problems if I do this.

Based on the answer provided by meskobalazs, I downloaded jar: stanford-corenlp-caseless-2015-04-20-models.jar .

I replaced with an earlier jar: stanford-corenlp-3.2.0-models .

However, now I get the following exception

 SEVERE: Exception sending context initialized event to listener instance of class servlets.NLP_initializer java.lang.RuntimeException: edu.stanford.nlp.io.RuntimeIOException: Unrecoverable error while loading a tagger model at edu.stanford.nlp.pipeline.StanfordCoreNLP$4.create(StanfordCoreNLP.java:493) at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:81) at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:260) at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:127) at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:123) at servlets.NLP_initializer.contextInitialized(NLP_initializer.java:34) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: edu.stanford.nlp.io.RuntimeIOException: Unrecoverable error while loading a tagger model at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:749) at edu.stanford.nlp.tagger.maxent.MaxentTagger.<init>(MaxentTagger.java:283) at edu.stanford.nlp.tagger.maxent.MaxentTagger.<init>(MaxentTagger.java:247) at edu.stanford.nlp.pipeline.POSTaggerAnnotator.loadModel(POSTaggerAnnotator.java:78) at edu.stanford.nlp.pipeline.POSTaggerAnnotator.<init>(POSTaggerAnnotator.java:62) at edu.stanford.nlp.pipeline.StanfordCoreNLP$4.create(StanfordCoreNLP.java:491) ... 14 more Caused by: java.io.IOException: Unable to resolve "edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger" as either class path, filename or URL at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:419) at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:744) ... 19 more 

The place where I initialize and the server starts

  public static edu.stanford.nlp.pipeline.StanfordCoreNLP snlp; /** * @see ServletContextListener#contextInitialized(ServletContextEvent) */ public void contextInitialized(ServletContextEvent arg0) { Properties props = new Properties(); props.put("annotators", "tokenize,ssplit,pos,lemma,parse,ner,dcoref"); StanfordCoreNLP snlp = new StanfordCoreNLP(props); } 
+5
source share
1 answer

From what I see here , you should try patterns that ignore the capitalization of words. You just need to add this model jar file to the existing one: unlicensed models .

For future reference: the link to the jar may be broken, but the first link goes to the page where you can find the link for the last bank.

+4
source

All Articles