【问题标题】:core nlp truecaseannotator not found未找到 corenlp truecase 注释器
【发布时间】:2016-02-24 01:02:19
【问题描述】:

我刚开始使用 CoreNLP 3.6.0 版。我从this website 下载了这个版本。使用命令行管道,我已经能够执行标准管道注释器,但遇到了 truecase 注释器的问题:

这是终端输出的副本:

loadClassifier=edu/stanford/nlp/models/truecase/truecasing.fast.caseless.qn.ser.gz mixedCaseMapFile=edu/stanford/nlp/models/truecase/MixDisambiguation.list classBias=INIT_UPPER:-0.7,UPPER:-0.7,O:0 线程“主”edu.stanford.nlp.io.RuntimeIOException 中的异常:java.io.IOException:无法将“edu/stanford/nlp/models/truecase/truecasing.fast.caseless.qn.ser.gz”作为类打开路径、文件名或 URL 在 edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1499) 在 edu.stanford.nlp.pipeline.TrueCaseAnnotator.(TrueCaseAnnotator.java:58) 在 edu.stanford.nlp.pipeline.AnnotatorImplementations.trueCase(AnnotatorImplementations.java:199) 在 edu.stanford.nlp.pipeline.AnnotatorFactories $10.create(AnnotatorFactories.java:435) 在 edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:85) 在 edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:375) 在 edu.stanford.nlp.pipeline.StanfordCoreNLP.(S​​tanfordCoreNLP.java:139) 在 edu.stanford.nlp.pipeline.StanfordCoreNLP.(S​​tanfordCoreNLP.java:135) 在 edu.stanford.nlp.pipeline.StanfordCoreNLP.main(StanfordCoreNLP.java:1222)

有什么想法吗?

【问题讨论】:

    标签: stanford-nlp


    【解决方案1】:

    我们尝试让默认模型 jar 更小一些,并决定默认不包含此模型。但它仍然包含在英文模型jar中,您可以从release history页面下载。

    下载 jar 后,请确保在运行 CoreNLP 之前将其放入类路径中。英文模型 jar 还应该包含 stanford-corenlp-3.6.0-models.jar 中的所有内容,因此您的类路径中不需要它们。

    【讨论】:

    • 谢谢,这行得通!知道如何使用命令行获取输入句子的正确大小写并在后续注释器中使用它吗?例如运行“java -Xmx4g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,truecase,ner,parse -file test.txt -outputFormat conll”,使用类似“This is a test sentence”我想解析。" 没有给出预期的 "LIKE" = like。显然我在这里遗漏了一些东西......
    • @Sebastian Schuster,知道如何在 pom.xml 中将英文模型添加到 maven 中吗?只需在这里插入一个新的代码库,并且是 maven 的新手。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-03
    • 1970-01-01
    相关资源
    最近更新 更多