如何使用 Bot Framework 在单个机器人上实现多个 LUIS 对话框?
How do I implement multiple LUIS dialogs on a single bot using the Bot Framework?
由于每个 LUIS 模型仅限于 20 个意图和 10 个实体,而且每个模型都必须具有明确定义的 scope/domain,我想知道在单个机器人应用程序中实现多个对话的最佳方式是什么,如果我希望我的机器人能够涵盖多个领域,比如说获取财务信息和天气信息。
我知道理想情况下我会有两个不同的机器人,但在这种情况下我需要用一个机器人来完成。我阅读了关于对话框(和其他几个部分)的 Bot Framework 文档和 LUIS 帮助页面,但我无法找到有关如何实现它的任何信息。我也看了例子,没找到,有办法吗?
因此,从技术角度来看,这没有任何重大问题。您只需注册两个 LUIS 应用程序,并在您的应用程序中使用您创建的特定应用程序的 LUIS 键创建两个对话框。
我猜你的问题更倾向于"how do I redirect the message to the corresponding LUIS bot"。这是有效的问题。
AzureBot has a similar scenario and they resolved it using a DialogFactory that follows an strategy pattern. Each 'domain' dialog knows if the incoming message is something they can handle or not (this is the one for Virtual Machine operations). Here 您可以看到他们如何在他们的 RootDialog 中也有 LUIS 以及他们如何在 None/Empty 意图中将消息重定向到相应的对话框。
在此 space 中探索的另一种替代方法是使用 IScorable 接口,长话短说,基本上可以让您拦截所有消息并决定要做什么。 ContosoFlowers sample has a IScorable implementation for you to take a look at. The C# BotBuilder library has also the DeleteProfileScorable,基本上处理 /deleteprofile 消息。
由于每个 LUIS 模型仅限于 20 个意图和 10 个实体,而且每个模型都必须具有明确定义的 scope/domain,我想知道在单个机器人应用程序中实现多个对话的最佳方式是什么,如果我希望我的机器人能够涵盖多个领域,比如说获取财务信息和天气信息。
我知道理想情况下我会有两个不同的机器人,但在这种情况下我需要用一个机器人来完成。我阅读了关于对话框(和其他几个部分)的 Bot Framework 文档和 LUIS 帮助页面,但我无法找到有关如何实现它的任何信息。我也看了例子,没找到,有办法吗?
因此,从技术角度来看,这没有任何重大问题。您只需注册两个 LUIS 应用程序,并在您的应用程序中使用您创建的特定应用程序的 LUIS 键创建两个对话框。
我猜你的问题更倾向于"how do I redirect the message to the corresponding LUIS bot"。这是有效的问题。
AzureBot has a similar scenario and they resolved it using a DialogFactory that follows an strategy pattern. Each 'domain' dialog knows if the incoming message is something they can handle or not (this is the one for Virtual Machine operations). Here 您可以看到他们如何在他们的 RootDialog 中也有 LUIS 以及他们如何在 None/Empty 意图中将消息重定向到相应的对话框。
在此 space 中探索的另一种替代方法是使用 IScorable 接口,长话短说,基本上可以让您拦截所有消息并决定要做什么。 ContosoFlowers sample has a IScorable implementation for you to take a look at. The C# BotBuilder library has also the DeleteProfileScorable,基本上处理 /deleteprofile 消息。