1
votes

EDIT

So sorry everyone, it was just due to a missing comma after the name of the intent. I am so sorry x:


I am recently creating a chat bot using Microsoft Bot Framework (botbuilder v3.14.0), Node.js (v8.9.4) and LUIS.

I am able to successfully 'recognize' some intents in the bot, and return the desired results, but for some intents, the bot doesn't seem to be able to pick up the intents, even though the results from LUIS is pointing towards the correct one.

I have tried testing using the LUIS testing blade and entering the query directly after the endpoint URL in chrome. Both methods will return me the same and correct intent. A sample result from the endpoint URL method is as below:

{
  "query": "why do you exist",
  "topScoringIntent": {
    "intent": "bot-existence",
    "score": 0.597947
  },
  "intents": [
    {
      "intent": "bot-existence",
      "score": 0.597947
    },
    {
      "intent": "bot-joke",
      "score": 0.04189388
    },
    {
      "intent": "Exit",
      "score": 0.0182088781
    },
    {
      "intent": "None",
      "score": 0.0164906159
    },
    {
      "intent": "Cancel",
      "score": 0.009767669
    },
    {
      "intent": "Stop",
      "score": 0.009608646
    },
    {
      "intent": "bot-age",
      "score": 0.009238302
    },
    {
      "intent": "Greeting",
      "score": 0.008374314
    },
    {
      "intent": "bot-name",
      "score": 0.00683666952
    },
    {
      "intent": "Help",
      "score": 0.00357789616
    },
    {
      "intent": "StartOver",
      "score": 0.00262053218
    },
    {
      "intent": "checkDBStatus",
      "score": 0.002412489
    },
    {
      "intent": "refreshSchema",
      "score": 1.35339326E-06
    },
    {
      "intent": "checkDutyPerson",
      "score": 5.41015623E-08
    }
  ],
  "entities": []
}

In this case, the bot should be able to pick out the bot-existence intent and execute this code:

intents.matches('bot-existence' [
    function (session) {
        console.log('bot-existence Intent');

        session.beginDialog('bot-existDialog');
    }
]);

but it doesn't. It works for the other intents though, such as bot-age, bot-joke and checkDBStatus. The codes for these intent are the same as the one above for bot-existence, just edited to fit the intents appropriately. I have also published the LUIS app multiple times, just in case, but to no avail.

Any idea why?

2
What are the scores for utterances that successfully trigger bot-age, bot-joke, etc? Have you tried decreasing the intent score threshold for your IntentDialog?Steven G.
I can't reproduce your issue, did you publish your luis after adding the bot-existence intent?Grace Feng
@StevenG., thanks for your reply. bot-age with 'what is your age' is 0.8824824, bot-joke with 'tell me a joke' is 0.277950644. How do I decrease the intent score threshold?Muggle
@GraceFeng-MSFT, thanks for your reply. I did publish the luis app, and checked it and published it again a few times, in fact.Muggle
@StevenG. Thanks for checking back! I'm glad I caught this error, so careless of me!Muggle

2 Answers

1
votes

So sorry guys, all I was missing was a comma in the code, right next to the intent name ('bot-existence'). Edited code segment as below!

intents.matches('bot-existence', [
    function (session) {
        console.log('bot-existence Intent');

        session.beginDialog('bot-existDialog');
    }
]);
0
votes

Try this way, using triggerAction:

var recognizer = new builder.LuisRecognizer(LuisModelUrl);
// Add the recognizer to the bot
bot.recognizer(recognizer);

bot.dialog('bot-existence', [

  function (session, args) {
        console.log('bot-existence Intent');
        session.beginDialog('bot-existDialog');
    }      
]).triggerAction({matches:'bot-existence'});