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

て烟熏妆下的殇ゞ 提交于 2020-01-11 12:17:26

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/41392366/how-to-use-luis-none-intent-in-c-sharp-without-train-utterance-at-luis

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