如何在不触发Microsoft Bot Framework中新意图的情况下使用Prompts.text [英] How to use Prompts.text without triggering new intent in Microsoft Bot Framework

查看:73
本文介绍了如何在不触发Microsoft Bot Framework中新意图的情况下使用Prompts.text的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个由triggerAction触发的对话框.我使用LUIS触发/匹配特定对话框的语音.

I have multiple dialogs that are triggered with triggerAction. I use LUIS to trigger/match utterances to specific dialogs.

每个对话框都有两个步骤(功能):

Each dialog has two steps (functions):

  1. 如果实体是有效的查询数据库和结束对话框,否则使用Prompts.text()提示用户输入缺少的实体之一,然后继续下一步
  2. 设置对话框状态,并使用next() *
  3. 从第1步开始重复对话框
  1. if entities are valid query DB and end dialog, else prompt user for one of the missing entities with Prompts.text() and continue to next step
  2. set dialog state and repeat dialog from step 1 with next() *

我的问题是,对于某些提示输入(即实体值),LUIS将触发新的不相关对话框.在这些情况下,对话框堆栈会丢失(因为我使用了triggerAction),并且会话流程中断了.

My problem is that for some prompted inputs (i.e. entity values) LUIS will trigger new unrelated dialogs. In these cases the dialog stack is lost (since I use triggerAction) and the conversation flow is broken.

如何确保缺少实体的提示不会触发新对话框?我的对话流程有缺陷吗?

How can I ensure that the prompt for missing entities will not trigger a new dialog? Is my conversation flow flawed?

对于每种意图,我已经有许多受过训练的话语.我猜我的LUIS模型足够松散",可以匹配(简短的)意图发音中的多个单词实体(在提示后输入).

I already have many trained utterances for each intent. I'm guessing my LUIS model is "loose" enough to match multiple word entities (entered after the prompt) to (short) intent utterances.

*从 docs :当漫游器到达瀑布的末端而没有结束对话框时,来自用户的下一条消息将在瀑布的第一步重新启动该对话框.

推荐答案

当您在dialogStack的中间,甚至在对话框的中间时,可以使用LuisRecognizer.onEnabled()禁用LUIS调用.这样可以解决在提示中间时识别意图的问题.

You can use LuisRecognizer.onEnabled() to disable your LUIS calls while you're in the middle of a dialogStack, or even in the middle of a dialog. This will solve the issue of intents being recognized while you're in the middle of a Prompt.

这是一个示例我在使用RegExpRecognizer时实现了该方法(.onEnabled()是从IntentRecognizer继承的).

Here's an example I wrote on implementing the method when using a RegExpRecognizer (.onEnabled() is inherited from IntentRecognizer).

这是我写的堆栈溢出问题的答案

Here's an answer to a Stack Overflow question that I wrote.

这篇关于如何在不触发Microsoft Bot Framework中新意图的情况下使用Prompts.text的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆