0

I have a bot that leverages LUIS and makes use of trigger actions. All intents work fine, but I am no longer able to get any results when the "None" intent is hit.

I understand from researching online that I might have to add an onDefault action instead, but I am unable to find any good documentation demonstrating this. Does anyone know how to make this work with triggerAction()?

The current code looks like this:

bot.dialog('None', [
    function (session, results, args, next) {
        session.send("NONE INTENT TRIGGERED", session);

    };
]).triggerAction({
    matches: 'None'
});

Would much appreciate any pointers in the right direction.

Ezequiel Jadib
  • 14,767
  • 2
  • 38
  • 43
  • Just to confirm, you have a None intent in LUIS, correct? – Ezequiel Jadib May 03 '17 at 01:26
  • That is correct. In addition, when I change the intent from "None" to another listed intent, it triggers just fine. Looks like matching a "None"-intent is problematic, and this needs to be handled through onDefault. I just cannot find a single example for node. – DigitalLawyer May 03 '17 at 06:19
  • No familiar with node but in C# the "None" intent is just represented with an empty string. Have you tried this? – Xeno-D May 03 '17 at 08:00
  • Thank you for the suggestion. I tried it, to no avail. I was looking forward to writing "never did so few characters achieve this much" - alas. I can see how this is done with [Action Bindings](https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/blog-LUISActionBinding) and the issue seems referenced [here](http://stackoverflow.com/questions/43593728/microsoft-bot-framework-with-luis-not-detecting-all-intents/43612026) by Pavel but I am unable to get the onDefault handler working. – DigitalLawyer May 03 '17 at 08:46
  • Are you using the IntentDialog, or perhaps following a sample online? – Steven G. May 04 '17 at 00:38
  • If you could share your code on how you are incorporating your IntentRecognizer that would be helpful. I followed your code snippet and was able to reach the dialog. – Steven G. May 04 '17 at 01:24

2 Answers2

3

NOTE: When using an IntentDialog, you should avoid adding a matches() handler for LUIS’s “None” intent. Add a onDefault() handler instead (or a default dialog when using global recognizers). The reason for this is that a LUIS model will often return a very high score for the None intent if it doesn’t understand the users utterance. In the scenario where you’ve configured the IntentDialog with multiple recognizers that could cause the None intent to win out over a non-None intent from a different model that had a slightly lower score. Because of this the LuisRecognizer class suppresses the None intent all together. If you explicitly register a handler for “None” it will never be matched. The onDefault() handler (or the bot's default dialog) however can achieve the same effect because it essentially gets triggered when all of the models reported a top intent of “None”.

source: https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/intelligence-LUIS

0

The dialog has a method onDefault which handles None. Like:

dialog.onDefault (function (session) {
  session.send ('I did not understand your request!');
});
Swapnesh Khare
  • 109
  • 1
  • 10