我有以下@fields实体:
innovation => change management (作为同义词)
当我在对话框中键入以下内容时,
show me innovation and change management fields我得到重复的实体如下:
{
"intents": [
{
"intent": "do.something",
"confidence": 0.9974480628967286
}
],
"entities": [
{
"entity": "fields",
"location": [
23,
40
],
"value": "innovation",
"confidence": 1
},
{
"entity": "fields",
"location": [
8,
18
],
"value": "innovation",
"confidence": 1
}
]
}我希望只得到一个,因为我只有一个具有innovation或change management值的实体。我确信没有其他实体有这两个关键字。
那是个bug吗!或者这是正常的行为!
发布于 2017-08-28 22:07:29
在输入show me innovation and change management fields中,@fields实体确实出现了两次。首先是单词innovation,它由entity捕获(注意位置索引由8到18个字符组成):
{
"entity": "fields",
"location": [
8,
18
],
"value": "innovation",
"confidence": 1
}第二个是change management,它是innovation的同义词,由实体捕获(请注意23到40个字符的位置索引):
{
"entity": "fields",
"location": [
23,
40
],
"value": "innovation",
"confidence": 1
}作为一个值,会话服务始终输出规范的实体值,在本例中为innovation。要获得被识别为实体@fields值innovation的确切文本的信息,可以输入entity['fields'].get(0).literal和entity['fields'].get(1).literal。
请注意,最好事先检查用户输入中已识别的实体的数量,以避免访问实体数组中不存在的索引。
https://stackoverflow.com/questions/45920342
复制相似问题