我在我的系统上设置了Stanford coreNLP库的本地服务器。虽然,我能够得到答案,因为我可以得到demo site。但在我的服务器wikipedia entity
选项不起作用。服务器出现以下错误:
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 :(得分:3)
@sv_jan5的答案可以正常使用,但下载页面(https://stanfordnlp.github.io/CoreNLP/download.html)中的English (KBP)
模型jar可能更容易下载并包含在您的类路径中。命名有点神秘 - KBP代表知识库人口,&#34;其中包含链接模型的实体和新的关系提取模型。
3.8.0版本的直接链接为here(警告:500MB下载)。
答案 1 :(得分:0)
我有办法解决这个问题。您需要执行以下步骤:
stanford-corenlp-3.8.0-models.jar
。 wikidict.tab.gz
文件
wikidict.tab.gz
文件stanford-corenlp-3.8.0-models.jar
文件