Stanford CoreNLP不应将2个独立的实体识别为相同

问题描述 投票:0回答:1

这里提供代码:

    public static void main(String[] args) {
        String text = "Loryn lives across the street from me. " 
                + "She is 19 years old. " 
                + "Sydney goes to my school. "
                + "She graduated last year. ";
        Properties props = new Properties();
        props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,parse,depparse,coref,kbp,quote");
        props.setProperty("coref.algorithm", "neural");
        StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
        CoreDocument document = new CoreDocument(text);
        pipeline.annotate(document);
        for (Entry<Integer, CorefChain> e : document.corefChains().entrySet()) {
            System.out.println(e.getValue() + " - " + e.getKey());
            for (CorefMention s : e.getValue().getMentionsInTextualOrder()) {
                System.out.println(" - " + s);
            }
        }

此处显示代码输出:

CHAIN7-["me" in sentence 1, "my" in sentence 3] - 7
 - "me" in sentence 1
 - "my" in sentence 3
CHAIN8-["Loryn" in sentence 1, "She" in sentence 2, "She" in sentence 4] - 8
 - "Loryn" in sentence 1
 - "She" in sentence 2
 - "She" in sentence 4

为什么第4句中的She是指Loryn?如何使它指向悉尼

所需的输出应类似于此:

CHAIN7-["me" in sentence 1, "my" in sentence 3] - 7
 - "me" in sentence 1
 - "my" in sentence 3
CHAIN8-["Loryn" in sentence 1, "She" in sentence 2] - 8
 - "Loryn" in sentence 1
 - "She" in sentence 2
CHAIN9-["Sydney" in sentence 3, "She" in sentence 4] - 8
 - "Sydney" in sentence 3
 - "She" in sentence 4
java stanford-nlp
1个回答
0
投票

“悉尼”被标记为城市,所以这里出现NER错误。

话虽如此,如果您仅将名称更改为“ Jane”或类似名称,它似乎就失败了。

不幸的是,共指还没有真正解决,即使是最先进的系统也会出现很多错误。不过,这是一个有趣的问题案例,将来我们将尝试使用它为该模型添加更多的训练数据!

© www.soinside.com 2019 - 2024. All rights reserved.