CoreNLP Server不返回实体提及

时间:2016-02-23 15:48:53

标签: stanford-nlp

here下载CoreNLP服务器并跟随these instruction,当我将entitymentions作为注释者时:

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"
                }
            ]
        }
    ]
}

1 个答案:

答案 0 :(得分:3)

无论好坏,我们目前都没有将实体提及输出到输出器。建议的解决方法是以与实体提及注释器相同的方式对数据进行后处理:相同NER的连续跨度被视为实体提及。我相信实体提及对象中的所有注释也附加到组件标记。