斯坦福NLP(NER建模)java.lang.UnsupportedOperationException异常:参数数组长度di

2024-09-30 01:33:42 发布

您现在位置:Python中文网/ 问答频道 /正文

在来到这里之前,我已经搜索并尝试了相当长的时间(大约4天)来研究这个问题。我想训练一个瑞典人。我从here得到了测试数据和训练数据。你知道吗

这是我在训练模型时遇到的错误 \project\stanford_ner>java -mx1000m -cp stanford-ner.jar;lib/* edu.stanford.nlp.ie.crf.CRFClassifier -prop train/train_properties.txt Invoked on Tue Sep 25 10:44:13 IST 2018 with arguments: -prop train/train_properties.txt usePrevSequences=true useClassFeature=true useTypeSeqs2=true useSequences=true wordShape=chris2useLC useTypeySequences=true useDisjunctive=true noMidNGrams=true serializeTo=dummy_ner_model_swede.ser.gz maxNGramLeng=6 useNGrams=true usePrev=true useNext=true maxLeft=1 trainFile=train/dummy_swede_corpus.tsv map=word=0,answer=1 useWord=true useTypeSeqs=true Error on line 85124: bn Exception in thread "main" java.lang.UnsupportedOperationException: Argument array lengths differ: [class edu.stanford.nlp.ling.CoreAnnotations$TextAnnotation, class edu.stanford.nlp.ling.CoreAnnotations$AnswerAnnotation] vs. [bn] at edu.stanford.nlp.ling.CoreLabel.initFromStrings(CoreLabel.java:263) at edu.stanford.nlp.ling.CoreLabel.(CoreLabel.java:150)

我想指出的错误是: Error on line 85124: bn

Exception in thread "main" java.lang.UnsupportedOperationException: Argument array lengths differ: [class edu.stanford.nlp.ling.CoreAnnotations$TextAnnotation, class edu.stanford.nlp.ling.CoreAnnotations$AnswerAnnotation] vs. [bn]

我不明白这里的“bn”是什么。我确实在github中完成了代码的实现,但没有结果。如果我使用所有的列车数据,直到那一行的错误,我能够训练数据,并得到模型。你知道吗

在误差线上,我看不出有什么特别的。它只是另一个带有NER标记的单词,如属性文件的特征列表中所述。你知道吗


Tags: 数据truenlpon错误trainjavaclass

热门问题