如何在 EntityMentionsAnnotator 的基础上做维基化/实体链接?

How to do Wikification / Entity Linking on the basis of the EntityMentionsAnnotator?

我正在尝试 link 将实体提及到知识库,例如 DBpedia 或 Wikidata。

最后我想用任意 ontology 来丰富 JSON 输出,并在此提供某种语义。但作为第一步,它应该看起来像这样:

{

    "index": 1,
    "mention": "Barack Obama",
    "characterOffsetBegin": 0,
    "characterOffsetEnd": 12,
    "ner": "PERSON",
    "before": "",
    "after": " "
    "uri": "http://dbpedia.org/page/Barack_Obama"

}

有没有办法使用 Stanford CoreNLP 已经提供的工具来做到这一点?我在 GitHub 上看到了 WikidictAnnotator,但不幸的是,没有任何文档或任何关于它是什么以及如何使用它的文档。

除此之外,还有哪些可能呢?我是否必须使用像 DBpedia Spotlight 这样的第三方工具结合 Stanford NE Recognizer 才能实现实体 linking?

提前致谢!

经过一些研究,我将回答我自己的问题。也许对以后的人有帮助。

我找到了一个名为 AGDISTIS 的框架,它提供了对知识库功能的提及。它接受来自 EntityMentionsAnnotator 的提及并将它们与相应的 dbpedia 资源匹配。您甚至可以使用除 dbpedia 之外的其他索引。

不过,如果有人可以解释仅使用 CoreNLP 是否以及如何实现维基化,我将非常高兴(请参阅 WikidictAnnotator)。

Ambiverse we have an entity-linking system, which identifies named entities in text. Each entity is linked to its Wikidata Id. The output is a JSON object containing the identified entities and their positions in the input text, plus some useful entity metadata as categories, Wikipedia URL and the linking confidence. The system can be used as an API. To read more about entity-linking or use cases you can check our blog

以句子为例:

Ma founded Alibaba in Hangzhou with investments from SoftBank and Goldman.

我们的系统将产生以下输出。你也可以自己试试here.

{
"docId": "1803274355",
"language": "en",
"matches": [
  {
    "charLength": 2,
    "charOffset": 0,
    "text": "Ma",
    "entity": {
      "id": "http://www.wikidata.org/entity/Q1137062",
      "url": "http://en.wikipedia.org/wiki/Jack%20Ma",
      "confidence": 0.24400826614264
    }
  },
  {
    "charLength": 7,
    "charOffset": 11,
    "text": "Alibaba",
    "entity": {
      "id": "http://www.wikidata.org/entity/Q1359568",
      "url": "http://en.wikipedia.org/wiki/Alibaba%20Group",
      "confidence": 0.89595517818717
    }
  },
  {
    "charLength": 8,
    "charOffset": 22,
    "text": "Hangzhou",
    "entity": {
      "id": "http://www.wikidata.org/entity/Q4970",
      "url": "http://en.wikipedia.org/wiki/Hangzhou",
      "confidence": 0.92296125433251
    }
  },
  {
    "charLength": 8,
    "charOffset": 53,
    "text": "SoftBank",
    "entity": {
      "id": "http://www.wikidata.org/entity/Q201653",
      "url": "http://en.wikipedia.org/wiki/SoftBank",
      "confidence": 0.95402181746993
    }
  },
  {
    "charLength": 7,
    "charOffset": 66,
    "text": "Goldman",
    "entity": {
      "id": "http://www.wikidata.org/entity/Q193326",
      "url": "http://en.wikipedia.org/wiki/Goldman%20Sachs",
      "confidence": 0.41802014708618
    }
  }
]
}