简体   繁体   English

DialogFlow-处理默认回退的最佳做法?

[英]DialogFlow - Best practices handling default fallback?

I was just wondering about the best way to handle when a users intent cannot be understood multiple times. 我只是想知道当无法多次理解用户意图时的最佳处理方式。

eg In the case of a chat bot a user may enter an intent that cannot be understood multiple times, after the third time I would like the chat bot to call a webservice. 例如,在聊天机器人的情况下,用户可能会输入无法多次理解的意图,在第三次之后,我希望聊天机器人调用Web服务。

What is the best way to handle this scenario? 处理这种情况的最佳方法是什么? Possible scenarios I have come up with are: 我提出的可能方案是:

1) Each time the default fallback intent is called we call a web service that keeps track of the number of times the default fallback intent has been called for the current user and on the third time call another service. 1)每次调用默认回退意图时,我们都会调用一个Web服务,该跟踪记录已为当前用户调用默认回退意图的次数,并且第三次调用另一个服务。

2) Chain multiple default fallback intents together in DialogFlow and on the call to the third fallback intent we make the call (Is this even possible or a good idea?) 2)在DialogFlow中将多个默认后备意图链接在一起,并在对第三个后备意图的调用上进行调用(这是否可能还是一个好主意?)

3) Keep track of the number of times the default call back is called within DialogFlow (By using an Entity I believe) and then on the third attempt we call the Web Service. 3)跟踪在DialogFlow中调用默认回调的次数(我相信使用实体),然后在第三次尝试中调用Web服务。

Any recommendations or ideas happily received as I am new to DialogFlow 我刚接触DialogFlow时,很高兴收到任何建议或想法

If you mean "Followup Intent" in (2), this would be a bad idea. 如果您在(2)中表示“跟进意图”,那将是个坏主意。 Just about anything involving chains of Followup Intents are a bad idea. 涉及跟进意图链的任何事情都是一个坏主意。

I'm not sure how you would pull off (3), to be honest. 老实说,我不确定您将如何实现(3)。 Dialogflow itself has very little ability to include logic of this sort. Dialogflow本身几乎没有能力包含这种逻辑。

The best approach is (1) - for everything, call your fulfillment webhook and have it handle the logic. 最好的方法是(1)-对于任何事情,都调用实现Webhook并让其处理逻辑。 Typically, you want to count consecutive times the user hits the Fallback Intent, rather than the total times you do so. 通常,您要计算用户达到“后备意图”的连续时间,而不是次数。 You can keep this counter in a short-lived Context. 您可以将此计数器保留在短暂的上下文中。

(Libraries such as multivocal keep track of the counter for you, as an aside, and let you use it in responses or in other logic handling.) (Disclaimer, I'm the lead developer for multivocal.) 顺便说一句,诸如多声音的图书馆为您跟踪计数器,并让您在响应或其他逻辑处理中使用它。)(免责声明,我是多声音的首席开发人员。)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM