简体   繁体   English

Dialogflow-编码完成时处理用户差异

[英]Dialogflow - Dealing with user discrepancy when coding fulfilment

When coding fulfilment for Dialogflow (API.AI) is there a way to deal with discrepancies in user responses without having to do a full if statement for all the possible ways a user could say the same thing? 在对Dialogflow(API.AI)进行编码实现时,是否有一种方法可以处理用户响应中的差异,而不必对用户可能说同一话的所有可能方式进行完整的if语句? AKA the manual way. 又称手动方式。

For example, if I'm asking where the user located and they say they're from the West Midlands, which is one of my locations - do I have to do an IF statement that looks something like this: 例如,如果我问用户位于哪里,他们说他们来自西米德兰兹郡,那是我的位置之一-我是否必须做一个类似以下内容的IF语句:

if (location === 'West Midlands' || 'west Midlands' || 'w midlands' || 'w mid') {}

Or can I pass it back to Dialogflow where it can handle the users input using the AI or whatever. 或者我可以将其传递回Dialogflow,在此它可以使用AI或其他方式处理用户输入。

You can create an Entity that represents the locations you support. 您可以创建一个代表您支持的位置的实体

Each of the possibly values in your Entity can have a canonical value and then the aliases that the user can enter that will map to this canonical value. 实体中的每个可能值可以具有一个规范值,然后用户可以输入的别名将映射到该规范值。 When the parameter is sent to your fulfillment, the canonical value will be sent. 将参数发送给您的实现时,将发送规范值。 (If you needed exactly what they entered, it is available as well, but you should use the canonical value for your tests.) (如果您确实需要他们输入的内容,也可以使用它,但是您应该在测试中使用规范值。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Dialogflow CX webhook 用于实现使用 nodejs 回复用户 - Dialogflow CX webhook for fulfilment to reply user using nodejs 没有Firebase的Dialogflow Node.js实现 - Dialogflow nodejs fulfilment without firebase 使用 request-promise-native 实现 Dialogflow:无法解析响应 - Dialogflow fulfilment using request-promise-native : unable to parse response Dialogflow fulfillment webhook url 支持自签名证书吗? - Dialogflow fulfilment webhook url support self signed certificates? 如何从参数获取实体并在Dialogflow内联编辑器中创建if条件以实现 - How to get entity from the argument and create if condition in Dialogflow Inline editor for fulfilment 在dialogflow chatbot中向用户输入通知 - Typing notification to user in dialogflow chatbot 如何清除用户存储(Dialogflow) - How to clear user storage (Dialogflow) 在Dialogflow中存储用户位置首选项 - Store User Location Preference in Dialogflow 当用户从对话流中的另一个意图键入列表项时如何触发列表 - How to trigger the list when user types list item from another intent in dialogflow 当用户将文档/图像附加到聊天机器人时如何遇到回复(使用对话流和通信构建)? - How to encounter reply when user attaches a document/image to a chatbot(Build with dialogflow and kommunicate)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM