Sandy
Sandy

Reputation: 231

How to use LUIS None Intent in c# without train utterance at LUIS

I have implemented the None Intent as follows..

[LuisIntent("None")]
public async Task None(IDialogContext context, LuisResult result)
{
      await context.PostAsync("I'm sorry. I didn't understand you.");
      context.Wait(MessageReceived);            
}

But looks like i need to train some utterance at luis side, which i don't want. I am looking something whichever is not found or recognize at luis, should fire the None Intent handler. How do I achieve this ?

Upvotes: 1

Views: 1828

Answers (1)

Ezequiel Jadib
Ezequiel Jadib

Reputation: 14787

Add also the following line to your None method:

[LuisIntent("")]

If Luis cannot recognize an intent, will return an empty string and so your BOT will be able to handle it.

The None intent is still useful though; imagine an scenario where LUIS recognize an intent but that recognition for some reason is wrong? In that case, you will want to set that utterance as None and then retrain.

Upvotes: 8

Related Questions