我正在尝试使用 this 来学习 NER简短的命名实体识别教程。但我无法成功运行代码。我在 location.txt 文件中提供了一项,如此处所述。
我收到 ArrayIndexOutOfBoundsException
错误。
09:32:09.431 [main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator regexner
java.lang.ArrayIndexOutOfBoundsException: 1
at edu.stanford.nlp.pipeline.TokensRegexNERAnnotator.readEntries(TokensRegexNERAnnotator.java:696)
at edu.stanford.nlp.pipeline.TokensRegexNERAnnotator.readEntries(TokensRegexNERAnnotator.java:593)
at edu.stanford.nlp.pipeline.TokensRegexNERAnnotator.<init>(TokensRegexNERAnnotator.java:294)
at edu.stanford.nlp.pipeline.AnnotatorImplementations.tokensRegexNER(AnnotatorImplementations.java:135)
at edu.stanford.nlp.pipeline.AnnotatorFactories$7.create(AnnotatorFactories.java:305)
at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:152)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:451)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:154)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:150)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:137)
请帮助我。 提前致谢。
最佳答案
以下是 rexegner 规则示例:
London LOCATION MISC 1
确保 4 列之间用“\t”字符而不是空格分隔。
关于java - 斯坦福自然语言处理 : ArrayIndexOutOfBoundsException for Named Entity Recognition,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43510163/