dialogflow ambiguity with same synonyms for different entity values

谁说胖子不能爱 提交于 2019-12-02 00:31:05

问题


I have an issue developing an agent with dialogflow (api.ai). I am using a lot of entity values which are all different from one another. however there are similar synonyms for some entity values but the agent is returning only one value.

How can i get all the possible matches or ask question to resolve the ambiguity

for example i have an intent like: tell me the location of ABC express train

if my entity values are :
entity            synonym
15127             ABC express
12345             ABC express 

I want it to return two values or ask question to resolve such ambiguity how can i work this out Thanks in advance


回答1:


If you enable fulfillment for this intent, you can take a look at the value the user said and ask a further question if you need to disambiguate between entities.

Let's imagine you are extracting an entity called "trains". The parameters table in your intent might look like this:

By default, if the user says ABC express, the fulfillment webhook will be called with the following parameter hash:

"parameters": {
  "trains": "15127"
}

This isn't enough information to decide if the request was ambiguous, since train 15127 might also have non-ambiguous synonyms.

You can configure Dialogflow to send the original text of the entity, alongside the resolved value. This means you will receive the following information to your webhook:

"parameters": {
  "trains": "15127",
  "original": "ABC express"
}

You can then use some simple logic to ask a further question if the value of original appears in a list of known ambiguous synonyms.

To have Dialogflow send this data, modify your parameters table so it looks like the following:

This will cause the original synonym to be sent to Dialogflow alongside the resolved value.



来源:https://stackoverflow.com/questions/50960875/dialogflow-ambiguity-with-same-synonyms-for-different-entity-values

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!