2017-06-20 6 views
0

システムにスタンフォード・コアNLPライブラリのローカル・サーバをセットアップしました。しかし、私はdemo siteを得ることができるので、私は応答を得ることができます。しかし私のサーバーではwikipedia entityオプションが機能していません。サーバーは、次のエラー得られます。スタンフォード・コアNLPでWikipediaのエンティティ・アノテータが動作しません

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 

を私はwikidict.tab.gzファイルをダウンロードしているが、私はそれを使用する方法を理解することができません。

+0

どうしたのですか?なぜdownvote?いくつかの理由も言及する。 –

答えて

3

が正常に動作します、おそらくダウンロードして、あなたのクラスパスにEnglish (KBP)モデルjarをダウンロードページ(https://stanfordnlp.github.io/CoreNLP/download.html)から追加する方が簡単です。 KBPとは、モデルと新しい関係抽出モデルをリンクするエンティティを包含する「知識ベース人口」の略です。

直接リンクは、バージョン3.8.0(警告:500MBダウンロード)の場合はhereです。

+0

あなたの答えはよりクリーンです。どうもありがとう! –

0

私はこれを解決する方法を得ました。次の手順を実行する必要があります。

  1. unzip stanford-corenlp-3.8.0-models.jar
  2. EDU /スタンフォード/ NLP /モデル/ kbpの
  3. here
  4. コピーwikidict.tab.gzファイルからダウンロードwikidict.tab.gzファイルをstanford-corenlp-3.8.0-models.jarファイルにすべてを圧縮し
  5. 再実行sv_jan5の答え@サーバー
関連する問題