我试图使用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
}
],更新:
我尝试输入CNN,就像API文档中的示例一样,这是可行的:
"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
}
],但其他什么都不是。它只对一小部分实体起作用吗?
发布于 2018-01-29 17:09:32
我尝试在请求中发送以下正文
{
"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 URI中的大多数条目--您仍然无法获得与DBpedia URI有关的大信息,将您发送的请求文本作为评论发布。
https://stackoverflow.com/questions/48505680
复制相似问题