Recommendation on using multiple LUIS models
My LUIS model has reached the 20 intent limit and I need to split the model into several models to go beyond that. Do you have any recommendations on what to do in order to have a bot work with multiple LUIS models? Is this something that the Bot Framework is already capable of?
Are you using C# or Node?
C#
I don't know if the Framework makes it feasible or not. Would be nice to know as we have been thinking about this with regards to a situation of having similar utterances for different intents. We were considering having a sort of generic top level LUIS that determined an overall area (such as documentation or diary) and then having a more specific LUIS that covers the utterances in that area. A sort of hierarchy of models. I would stress that we haven't actually tried this approach as yet
This is a limitation on the luis.ai service and not the bot builder SDK. As @IanBoggs mentioned you can use a command dialog or a broader Luis model to categorize the incoming message and then forward the message to the right Luis model for more fine grained entity and intent recognition.
@msft-shahins I need a recommendation from you. I need to use multiple LUIS model as there is a limitation of only 20 intents per LUIS model. I don't seem to fit all my utterances within these intents and I might need more. So, how would I categorize the incoming message and route it to the appropriate LUIS model? Any help would be much appreciated!
@knk1988 you can have a top level Luis model that do the categorization for the incoming message and then forward the message to a more specialized Luis model for intent recognition based on the category.
@knk1988 Hi there, I am stuck with same problem, I would like to know, what was your approach on resolving this block?
@msft-shahins Once our top level LUIS model does the categorization of the incoming message how do I redirect the message to the specialized LUIS model because everything that goes to the LUIS model is through the myBot.listenStdin() command.
@botgas If you are using C# SDK, you can forward the message to another dialog using context.forward(...). @Stevenic can comment for node.js.
@Stevenic can you please tell the way for the same in node.js. I'm sorry, I forgot to mention that I am using the node.js SDK.
HI @Stevenic , can you send me an example to do this Node.js? Huge thanks.
sure...
var recognizer1 = new builder.LuisRecognizer('<model 1>');
var recognizer2 = new builder.LuisRecognizer('<model 2>');
var intents = new builder.IntentDialog({ recognizers: [recognizer1, recognizer2] });
hi @Stevenic can you please give a sample for C# SDK for the same problem. I tried decorated my class with 2 Luis models. But by default it identifies the "None" Intent of one of the model. How can i solve this>
[LuisModel("xxxx", "yyyy")]
[LuisModel("aaaa", "bbbb")]
[Serializable]
public class AbacusForm : LuisDialog<object>
{
}
Is there a limit to how many entities can be defined for an application? I am not able to add another entity after 10.
@suresh-mobilocity yup - that's the limit :)
I did not understand how I can create a model or multiple models under the same application? Is the meaning of "multiple LUIS Models" referred in the original question referring to defining more than one App?
@suresh-mobilocity it's not multiple models under the same app, but rather multiple apps under your LUIS account.
One way we've seen this done is creating a LUIS App for various "specialties" of your bot.
Example: bot: "hi, i can help you with applying for a license or paying a fine" "pay a fine" all subsequent dialog -> Luis Application A
"apply for a license" all subsequent dialog -> Luis Application B
@brandonh-msft , thank you for clarifying my questions.
@suresh-mobilocity - hi, even I am not able to use multiple Luis Models. Have you got the solution for this issue?.If yes ,can you please provide the solution. Thanks.
@brandonh-msft Thanks for recommending that!
Selecting the correct luis app and keeping track of that context, makes more sense for performance and preventing collisions than a hierarchy of luis apps.
If you can select the correct luis app at the beginning of the interaction, then you can continue in that context assuming that luis app. (It is also possible to navigate between apps if each app learns an exit intent which sends that request back to the root model.)
In this way, you always assume the user is continuing with the same luis app context unless there is a intent that allows them to navigate to a different context, so most of the time you only need 1 luis request to discern intent and different apps can have similar intents without conflict.
This is better than a hierarchy of luis apps: The problem with a hierarcy of models is that if you have 2 models that have similar intents, the main model may not be able to know which sub model to use for continued processing. Also, every input requires 2 requests (the main luis app, and the sub luis app). This doubles costs and decreases performance.