小编Jon*_*est的帖子

Maven未能下载CoreNLP模型

当从Stanford CoreNLP网站构建示例应用程序时,我遇到了一个奇怪的例外:

Exception in thread "main" 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)
…
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
…
Run Code Online (Sandbox Code Playgroud)

这只发生在属性pos及其后的属性包含在属性中时.

Properties props = new Properties();
props.put("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
Run Code Online (Sandbox Code Playgroud)

这是我的pom.xml的依赖:

<dependencies>
<dependency>
    <groupId>edu.stanford.nlp</groupId>
    <artifactId>stanford-corenlp</artifactId>
    <version>3.2.0</version>
    <scope>compile</scope>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)

stanford-nlp maven

26
推荐指数
1
解决办法
7970
查看次数

标签 统计

maven ×1

stanford-nlp ×1