当我将entitymentions作为注释者时,已经从here下载了CoreNLP服务器并遵循了these instruction

wget --post-data 'Mark Ronson played a concert in New York.' 'localhost:9000/?properties={"tokenize.whitespace": "true", "annotators": "tokenize,ssplit,pos,entitymentions", "outputFormat": "json"}'


返回的json如下所示,尽管每个令牌都添加了ner,但没有提及列表。

知道为什么吗?

(值得一提的是,corenlp.run似乎也不返回它们-似乎重点是后期处理的结果)。

{
    "sentences": [
        {
            "index": 0,
            "parse": "SENTENCE_SKIPPED_OR_UNPARSABLE",
            "tokens": [
                {
                    "index": 1,
                    "word": "Mark",
                    "originalText": "Mark",
                    "lemma": "Mark",
                    "characterOffsetBegin": 0,
                    "characterOffsetEnd": 4,
                    "pos": "NNP",
                    "ner": "PERSON"
                },
                {
                    "index": 2,
                    "word": "Ronson",
                    "originalText": "Ronson",
                    "lemma": "Ronson",
                    "characterOffsetBegin": 5,
                    "characterOffsetEnd": 11,
                    "pos": "NNP",
                    "ner": "PERSON"
                },
                {
                    "index": 3,
                    "word": "played",
                    "originalText": "played",
                    "lemma": "play",
                    "characterOffsetBegin": 12,
                    "characterOffsetEnd": 18,
                    "pos": "VBD",
                    "ner": "O"
                },
                {
                    "index": 4,
                    "word": "a",
                    "originalText": "a",
                    "lemma": "a",
                    "characterOffsetBegin": 19,
                    "characterOffsetEnd": 20,
                    "pos": "DT",
                    "ner": "O"
                },
                {
                    "index": 5,
                    "word": "concert",
                    "originalText": "concert",
                    "lemma": "concert",
                    "characterOffsetBegin": 21,
                    "characterOffsetEnd": 28,
                    "pos": "NN",
                    "ner": "O"
                },
                {
                    "index": 6,
                    "word": "in",
                    "originalText": "in",
                    "lemma": "in",
                    "characterOffsetBegin": 29,
                    "characterOffsetEnd": 31,
                    "pos": "IN",
                    "ner": "O"
                },
                {
                    "index": 7,
                    "word": "New",
                    "originalText": "New",
                    "lemma": "New",
                    "characterOffsetBegin": 32,
                    "characterOffsetEnd": 35,
                    "pos": "NNP",
                    "ner": "LOCATION"
                },
                {
                    "index": 8,
                    "word": "York.",
                    "originalText": "York.",
                    "lemma": "York.",
                    "characterOffsetBegin": 36,
                    "characterOffsetEnd": 41,
                    "pos": "NNP",
                    "ner": "LOCATION"
                }
            ]
        }
    ]
}

最佳答案

不管好坏,我们目前不将实体提及内容输出到我们的输出者。推荐的解决方法是采用与实体提及注释者相同的方式对数据进行后处理:将同一NER的连续跨度视为实体提及。我相信实体提及对象中的所有注释也都附加到组件标记上。

10-04 16:50