Watson NLU永远不会返回消歧信息

时间:2018-01-29 16:20:13

标签: ibm-cloud dbpedia watson-conversation watson watson-nlu

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

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

e.g。

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

更新
我尝试输入CNN,就像API doc中的示例一样,有效:

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

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

1 个答案:

答案 0 :(得分: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的消息,请将您发送的请求文本发布为评论。