Java StanfordNLP:命名实体识别的ArrayIndexOutOfBoundsException

Java StanfordNLP:命名实体识别的ArrayIndexOutOfBoundsException,java,nlp,stanford-nlp,Java,Nlp,Stanford Nlp,我正在尝试使用简短的命名实体识别教程学习NER。但我无法成功运行代码。如前所述,我在location.txt文件中提供了一个条目 我收到ArrayIndexOutOfBoundsException错误 09:32:09.431 [main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator regexner java.lang.ArrayIndexOutOfBoundsException: 1 at edu.

我正在尝试使用简短的命名实体识别教程学习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)
09:32:09.431[main]INFO edu.stanford.nlp.pipeline.StanfordCoreNLP-添加注释器regexner
java.lang.ArrayIndexOutOfBoundsException:1
位于edu.stanford.nlp.pipeline.TokensRegexGenerator.readEntries(TokensRegexGenerator.java:696)
位于edu.stanford.nlp.pipeline.TokensRegexGenerator.readEntries(TokensRegexGenerator.java:593)
位于edu.stanford.nlp.pipeline.TokensRegexGenerator.(tokensRegexGenerator.java:294)
位于edu.stanford.nlp.pipeline.AnnotatorImplements.tokensRegexNER(annotatorImplements.java:135)
位于edu.stanford.nlp.pipeline.AnnotatorFactories$7.create(AnnotatorFactories.java:305)
位于edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:152)
位于edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:451)
位于edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:154)
位于edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:150)
位于edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:137)
请帮帮我。
提前感谢。

这里有一个rexegner规则示例:

London    LOCATION    MISC    1

确保4列之间用“\t”字符分隔,而不是空格。

即使将示例regexner规则放在location.txt中,我仍然会遇到相同的错误。您必须用制表符分隔4列。如果您遇到该错误,则表示您的规则没有用标签隔开。我将上述规则作为
董事会主席“\t”TITLE“\t”MISC“\t”1
放在location.text中,并以“董事会主席比奈姆·让·雅克”的身份提供测试文本。但我还是犯了同样的错误。是的,错误已经消失了。我设法用regexner规则文件中的选项卡运行它。