dialogflow-es - 在槽填充取消后,Dialogflow 重新获得上下文,而用户填充了所有必需的参数/槽
问题描述
我们正在尝试为汽车经销商构建一个聊天机器人。当用户询问“我正在寻找福特 2017 款车型”等查询时,在向用户显示最终结果之前,我们还有一些空缺需要填补。因此,为了处理这个问题,我们创建了一个带有所需参数的意图。我们还提供了一些自定义 UI 按钮来帮助用户完成插槽填充过程。然而,有时用户可以选择提供自己的输入,有时用户可以输入除槽值之外的文本。
例如:
- 用户:我正在寻找 2017 年或之后的福特最新车型。
- Bot:您在寻找哪种型号:我们显示一些选项
- 用户:逃跑
- 机器人:您正在寻找的价格范围是多少:我们显示了一些选项
- 用户:我正在寻找适合一家 4 口的东西。
在这里,在这种情况下,由于用户没有给出预期的槽/参数,槽填充被破坏。此外,如果我们能够以某种方式回复此类人类细微差别并继续填补空缺,那将是良好的用户体验。
编辑: 我们已经在插槽填充期间合并了一些机制来处理用户输入某些输入而不是所需插槽值的情况。但有时这种机制不起作用,有时用户可能会输入触发新意图的语句。
如何使用对话流处理此类情况?
解决方案
我建议不要使用 Dialogflow 的内置插槽填充。我以前遇到过这个问题,现在我只是为我想从用户那里收集的每个“变量”创建不同的意图。如果您让用户知道您希望他们回答的格式,您仍然可以使用插槽填充。KLM 聊天机器人完美地做到了这一点,您应该检查一下。
更新:这是您如何处理不同参数的输入。每当用户响应您不期望的内容时,将触发“question.invalidInput”,您可以在那里提醒用户您期望的格式。
Intent: question
Trainings phrase: 'May I enter?'
Output context: 'await_olderThan21'
Response: 'Are you older than 21?'
Intent: question.yes
Training phrase: 'yes'
Input context: 'await_olderThan21'
Output context: ''
Response: 'Yes, you may enter'
Intent: question.no
Training phrase: 'no'
Input context: 'await_olderThan21'
Output context: ''
Response: 'No, you may not.'
Intent: question.invalidInput
Training phrase: @sys.any
Input context: 'await_olderThan21'
Output context: 'await_olderThan21'
Response: 'Invalid answer. Please reply with yes or no.'
例如:
User: I am looking for ford latest models 2017 or afterwards.
Bot: Which model are you looking for: We display some options
User: escape
Bot: What is the price range you are looking for: We display some options
User: I looking for something which will suffice for a family of 4.
Bot *fallback*: Please enter the maximum amount you would like to spend on a car (in dollar)
这样用户就知道如何响应,您会注意到您将体验到较少的预期行为。
始终尝试将用户引导到您想要的方向。
希望这可以帮助!
推荐阅读
- r - 获取包含alter的alter的边缘列表
- javascript - 使用变量访问连字符属性
- vuejs2 - 如何判断 Vue-Router 导航钩子是否由“推送”触发?
- java - 使用 `dayTimeDuration` 函数时编译 XSL 文件的问题
- certificate - 如何使用 azure powershell 从公共证书(.cer 和 .pfx)中提取 blob
- php - PHP将变量传递给变量
- c# - 根据应用身份验证更改母版页项目标签
- html - 使嵌入的 Youtube 视频缩略图可打印(@media print)
- apache-kafka-streams - 使用弹簧执行器 (prometheus) 公开 kafka 流指标
- visual-studio - 如何防止在 Visual Studio Community 2017 中构建后运行测试