2017-06-20 5 views
0

Ich habe einen lokalen Server von Stanford coreNLP Bibliothek auf meinem System eingerichtet. Obwohl, ich bin in der Lage, die Antworten zu bekommen, wie man auf die demo site bekommen kann. Aber in meinem Server wikipedia entity Option funktioniert nicht. Der Server gibt die folgenden Fehler:Wikipedia-Objekt Annotator funktioniert nicht in Stanford coreNLP

java.lang.RuntimeException: edu.stanford.nlp.io.RuntimeIOException: java.io.IOException: Unable to open "edu/stanford/nlp/models/kbp/wikidict.tab.gz" as class path, filename or URL 
     at edu.stanford.nlp.pipeline.WikidictAnnotator.<init>(WikidictAnnotator.java:81) 
     at edu.stanford.nlp.pipeline.AnnotatorImplementations.link(AnnotatorImplementations.java:296) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getNamedAnnotators$63(StanfordCoreNLP.java:517) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getDefaultAnnotatorPool$65(StanfordCoreNLP.java:533) 
     at edu.stanford.nlp.util.Lazy$3.compute(Lazy.java:118) 
     at edu.stanford.nlp.util.Lazy.get(Lazy.java:31) 
     at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:146) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:447) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:150) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:146) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:133) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLPServer.mkStanfordCoreNLP(StanfordCoreNLPServer.java:319) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLPServer.access$500(StanfordCoreNLPServer.java:50) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.handle(StanfordCoreNLPServer.java:642) 
     at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) 
     at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) 
     at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) 
     at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675) 
     at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) 
     at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
     at java.lang.Thread.run(Thread.java:748) 
Caused by: edu.stanford.nlp.io.RuntimeIOException: java.io.IOException: Unable to open "edu/stanford/nlp/models/kbp/wikidict.tab.gz" as class path, filename or URL 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable$1.getReader(IOUtils.java:802) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable$1.<init>(IOUtils.java:760) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable.iterator(IOUtils.java:758) 
     at edu.stanford.nlp.pipeline.WikidictAnnotator.<init>(WikidictAnnotator.java:58) 
     ... 22 more 
Caused by: java.io.IOException: Unable to open "edu/stanford/nlp/models/kbp/wikidict.tab.gz" as class path, filename or URL 
     at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:480) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable.getStream(IOUtils.java:750) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable.access$000(IOUtils.java:719) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable$1.getReader(IOUtils.java:792) 
     ... 25 more 

I wikidict.tab.gz Datei heruntergeladen habe, aber ich bin nicht in der Lage zu verstehen, wie es zu benutzen.

+0

Was ist das Problem? Warum runterstimmen? Erwähnen Sie auch einige Gründe. –

Antwort

3

@ Antwort des sv_jan5 fein arbeiten , aber vielleicht einfacher ist Herunterladen und in Ihrem Klassenpfad die English (KBP) Modelle Glas von der Download-Seite (https://stanfordnlp.github.io/CoreNLP/download.html). Die Benennung ist etwas kryptisch - KBP steht für "Knowledge Base Population", die die Entity-Linking-Modelle und die neuen Relationsextraktionsmodelle subsumiert.

Direkte Verbindung ist here für die Version 3.8.0 (Warnung: 500MB Download).

+0

Ihre Antwort ist sauberer. Danke vielmals! –

0

Ich habe einen Weg, um dies zu beheben. Sie müssen diese Schritte ausführen:

  1. unzip stanford-corenlp-3.8.0-models.jar.
  2. Herunterladen wikidict.tab.gz Datei von here
  3. Copy wikidict.tab.gz Datei in edu/Stanford/nlp/models/kbp
  4. alles in stanford-corenlp-3.8.0-models.jar Datei komprimieren
  5. Rerun der Server
Verwandte Themen