1

我正在尝试结合使用 Watson 对话和 Watson NLU 来提取实体并将它们与列表进行比较。我需要访问返回的消歧信息,但它没有返回我输入的任何内容。

它正确地将公司、地点、人员等提取为实体,并进行了正确的分类。但是没有一个实体有消歧信息。有什么我想念的吗?所有实体都有 dbpedia 条目(我已经手动检查过)。

例如

"entities": [
    {
      "type": "Organization",
      "text": "NHS",
      "sentiment": {
        "score": 0,
        "label": "neutral"
      },
      "relevance": 0.949001,
      "count": 1
    },
    {
      "type": "Company",
      "text": "IBM",
      "sentiment": {
        "score": 0.497916,
        "label": "positive"
      },
      "relevance": 0.643598,
      "count": 1
    }
  ],

更新:
我尝试像API 文档CNN中的示例一样输入,并且有效:

"entities": [
    {
      "type": "Company",
      "text": "CNN",
      "sentiment": {
        "score": 0,
        "label": "neutral"
      },
      "relevance": 0.33,
      "disambiguation": {
        "subtype": [
          "Broadcast",
          "AwardWinner",
          "RadioNetwork",
          "TVNetwork"
        ],
        "name": "CNN",
        "dbpedia_resource": "http://dbpedia.org/resource/CNN"
      },
      "count": 1
    }
  ],

但没有别的了。它只适用于一小部分实体吗?

4

1 回答 1

0

我尝试在请求中发送以下正文

{
    "text":"IBM is a company based in Newyork",
    "features": {
    "entities":{}}
}

它返回带有消歧信息的输出。

{
"usage": {
    "text_units": 1,
    "text_characters": 33,
    "features": 1
},
"language": "en",
"entities": [
{
    "type": "Company",
    "text": "IBM",
    "relevance": 0.33,
    "disambiguation": {
        "subtype": [
            "SoftwareLicense",
            "OperatingSystemDeveloper",
            "ProcessorManufacturer",
            "SoftwareDeveloper",
            "CompanyFounder",
            "ProgrammingLanguageDesigner",
            "ProgrammingLanguageDeveloper"
        ],
        "name": "IBM",
        "dbpedia_resource": "http://dbpedia.org/resource/IBM"
    },
    "count": 2
},
{
    "type": "Location",
    "text": "Newyork",
    "relevance": 0.33,
    "disambiguation": {
        "subtype": [
            "City"
        ]
    },
    "count": 1
}
]
}

话虽如此,它确实为 DBpedia 中的大多数条目返回了 DBpedia URI。如果您仍然无法使用 DBpedia URI 获取消歧信息,请将您发送的请求文本作为评论发布。

于 2018-01-29T17:09:32.743 回答