How do I implement multiple LUIS dialogs on a single bot using the Bot Framework?

大憨熊 提交于 2019-12-19 07:53:12

问题


Since each LUIS model is limited to 20 intents and 10 entities, and also each model must have a well defined scope/domain, I'm wondering what's the best way to implement multiple dialogs in a single bot application, if I want my bot to be able to cover multiple domains, let's say for example get financial information and weather information.

I know that ideally I would have two different bots, but in this situation I need to do this with a single bot. I read the Bot Framework documentation on Dialogs (and several other parts) and the LUIS help page, but I wasn't able to find any information on how I could achieve that. I also gave a look at the examples and found nothing, is there a way to do this?


回答1:


So, from the technical standpoint there isn't any major issue with that. You just register two LUIS apps and have two dialogs in your app with the LUIS keys of the specific app you created.

I guess your question is going more to "how do I redirect the message to the corresponding LUIS bot". And it's valid question.

The 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 you can see how in their RootDialog they also have LUIS and how in the None/Empty intent they are redirecting the message to the corresponding dialog.

Another alternative to explore in this space, is using a IScorable interface, which, long story short, will basically allow you to intercept all the messages and decide what to do. The ContosoFlowers sample has a IScorable implementation for you to take a look at. The C# BotBuilder library has also the DeleteProfileScorable, that basically handle the /deleteprofile message.



来源:https://stackoverflow.com/questions/40399973/how-do-i-implement-multiple-luis-dialogs-on-a-single-bot-using-the-bot-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!