2016-02-23 54 views
0

我剛剛開始使用CoreNLP版本3.6.0。我已從this website下載此版本。使用命令行管道,我已經能夠執行標準的管道註釋,但跑進與truecase標註了一個問題:核心nlp truecaseannotator找不到

這裏的終端輸出的副本:

loadClassifier =埃杜/斯坦福/ 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 Exception in線程「main」edu.stanford.nlp.io.RuntimeIOException:java.io.IOException:無法打開「edu/stanford/nlp/models/truecase/truecasing.fast.caseless.qn.ser.gz」作爲類路徑,文件名或URL at edu.stanford.nlp.ie.AbstractSequenceClassif ier.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。(StanfordCoreNLP.java:139) 在edu.stanford.nlp.pipeline.StanfordCoreNLP。(StanfordCoreNLP.java:135) 在edu.stanford.nlp.pipeline.StanfordCoreNLP.main(StanfordCoreNLP.java:1222)

有什麼想法?

回答

1

我們試圖讓默認模型的jar變小一點,並決定默認不包含這個模型。但它仍然包含在你可以從release history頁面下載的英文模型罐子裏。

下載完jar之後,請確保在運行CoreNLP之前將它放入類路徑中。英文模型jar還應包含stanford-corenlp-3.6.0-models.jar中的所有內容,因此您不需要在類路徑中使用它們。

+0

謝謝,這個作品!任何想法如何使用命令行獲取輸入句子的更正案例並在隨後的註釋器中使用它?例如運行「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。顯然我在這裏錯過了一些東西...... – SimonD

+0

@Sebastian Schuster,任何想法如何將英文模型添加到maven中的pom.xml?只需在這裏插入一個新的代碼庫,併爲maven添加新的代碼。 – Atticus29