dialogflow ambiguity with same synonyms for different entity values

血红的双手。 提交于 2019-12-01 22:25:29

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.

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