Priya
Priya

Reputation: 151

different intent getting on luis model and teams for same sentence , how to solve it?

I have deployed bot on microsoft team and bot using luis, When same question asked on both microsoft teams and luis model bot gives different intent.

on teams

on luis model

Sentence "can I select old date in project?"

It has "add" intent and "date" entity but

when type that sentence on luis model it gives proper add intent and date entity,

But when asked same sentence to bot which is deployed in teams gives wrong output, why this happened? how to solve it?

Upvotes: 1

Views: 48

Answers (1)

Hilton Giesenow
Hilton Giesenow

Reputation: 10844

I think I had a similar problem very recently. Can you please debug in your app, and have a look at the Activity.Text property before it get's handed off to LUIS. If your bot is within a Team Channel (as opposed to a 1-1 chat directly with the bot), you need to @mention the bot to invoke it. However, that also adds the "BotName" string into the Activity.Text, and it throws off your LUIS understanding.

You can check this by going into your LUIS model, going to "Build" section on the top menu (where you define your entities, etc.) and then going on the LEFT menu to "Review endpoint utterances". In there you'll probably see bot "can i select old date in project" and ALSO " DemoBot can i select old date in project".

So, there are two ways to solve this (that I can think of at least):

  1. You can train your LUIS model on what intent to deal with, on the "Review endpoint utterances" page
  2. You can edit the text in your bot, before sending it to LUIS, to remove the "" mention, something like this:

    string atMentionBot = $"DemoBot";

    if (turnContext.Activity.Text.StartsWith(atMentionBot, StringComparison.OrdinalIgnoreCase)) turnContext.Activity.Text = turnContext.Activity.Text.Substring(atMentionBot.Length);

    (I'm not sure what language you're using for your bot - this is a C# sample of course)

Upvotes: 2

Related Questions