Search code examples
node.jsazurebotframeworkazure-language-understanding

LUIS Bot not able to find entity in the user utterance


I am using EntityRecognizer to find the entities present in the user utterance. I am following the official NotesApp example you can find here. I am getting null value in the console when i send a utterance present in the LUIS intent. For Example: create a note of name Note.Title where Note.title is the Entity(title of the note).

I am not sure what is the problem here as it is invoking the dialog on the matching utterance but not able to find Entities or an Entity.

The below code should print the title in the console.

    .matches('Note.Create', [(session, args, next) => {

        //Resolve and store any Note.Title entity passed from LUIS.
        var intent = args.intent;
        var title = builder.EntityRecognizer.findEntity(intent.entities, 'Note.Title');
        console.log("Title---"+title);

        //extra code ahead...
     }])

Solution

  • The main problem you are having here is that the note title you are using is not being recognized by LUIS as Note.Title entity. To solve this, you will have to train LUIS for some of those values.

    As you can see in the image below, in the plain LUIS app after adding the Note domain, your utterance hits the current intent but the title is not being recognized

    enter image description here

    So go to the Note.Create intent, add your utterance and tag your new title note as the Note.Title entity.

    enter image description here

    Train the app and voila!

    enter image description here