I have a chatbot powered by Microsoft Bot Framework which is using LUIS service for natural language recognition. One of the supported use cases is to allow users to list their tickets. Since there can multiple different types of tickets, one of the feature requests is to support filtering of these tickets by their type, for example - orders, incidents, etc.
Within LUIS, I have created list entity called ticketType with sub-lists representing individual ticket types and their synonyms:
Next up, I have created intent called listTickets, where I provided following sample utterances:
Finally, I have also created patterns for the listTickets intent to strengthen the recognition:
Now, after training and testing out my model, everything works just fine. Well, almost... The ticketType entity is correctly recognized, but I have no way to distinguish between individual ticket types based on my sub-lists as seen in the test results here:
How do I correctly train my LUIS model and properly create ticketType entity, so that LUIS correctly recognizes also the sub-list? Something like ticketType::order
and ticketType::incident
?
I have also read about entity roles, however this does not seem to be suitable for my scenario, because:
According to example it is more suitable in situations, when same entity is used multiple times in utterance and roles are used to differentiate between individual entities based on their positions.
In theory I could use roles, but then I would have to train my listTickets intent with every possible sub-list combination to have everything correctly labeled. Would patterns still make sense in this scenario?
I would suggest you test this in Web Chat or whichever channel you will be using. I created a LUIS model based off of yours and, when run thru Web Chat, the information you are seeking is readily available.
In my test, I passed "Display my request" as an utterance to the bot in a previous step. As you can see, "request" is a synonym of "order" which is found in "ticketType" (following your design). I'm able to extract the specific entity from the recognizerResult
as well as the normalized values (i.e "sublists").
Hope of help!
const recognizerResult = await this.recognizer.recognize(stepContext.context);
let intent = await LuisRecognizer.topIntent( recognizerResult );
console.log('1', intent )
console.log('2', recognizerResult.entities );
console.log('3', recognizerResult.entities.ticketType );
console.log('4', recognizerResult.luisResult.entities );
1 listTicket
2 { '$instance': { ticketType: [ [Object] ] },
ticketType: [ [ 'order' ] ] }
3 [ [ 'order' ] ]
4 [ { entity: 'request',
type: 'ticketType',
startIndex: 11,
endIndex: 17,
resolution: { values: [Array] } } ]