LUIS is Language Understanding Intelligent Service from Microsoft, as part of Azure Cognitive Services.
Several Microsoft technologies work with LUIS:
- Bot Framework allows a chat bot to talk with a user via text input.
- Bing Speech API converts spoken language requests into text. Once converted to text, LUIS processes the requests.
LUIS allows us to create an AI based model in the form of an applocation which can consumed via REST endpoint.
LUIS model is based on creating intents, entities and utterances. For more details visit the official docs here.
Let us see how a LUIS App looks like:
Intents in a Luis app

Entities in LUIS app:

Utterances in LUIS app:

Training and Testing the LUIS App:

Publishing your LUIS app:

LUIS REST API looks as below:
https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/xxxxxxxxxxxxxx?subscription-key=xxxxxxxxxxxxxxf&verbose=true&timezoneOffset=0&q=read meeting notes to me
The above API will produce a response shown as below: The response consists of query name, top scoring intent. all intents with their scores, also the entities present in the utterance.

Let us see how our client app can consume the LUIS API using node.js:
luis.js
var request = require('request');
var querystring = require('querystring');
module.exports = {
getLuisIntent:(utterance) => {
return new Promise((resolve, reject) => {
var endpoint = "https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/";
var luisAppId = "xxxxxxxxxxxxxx";
var queryParams = {
"subscription-key": "xxxxxxxxxxxxxx",
"timezoneOffset": "0",
"verbose": true,
"q": utterance }
var luisRequest = endpoint + luisAppId + '?' + querystring.stringify(queryParams);
request(luisRequest,function (err,response, body) {
if (err){console.log(err);
reject(err);
}else {
var data = JSON.parse(body);
console.log(`Query: ${data.query}`);
console.log(`Top Intent: ${data.topScoringIntent.intent}`);
console.log('Intents:');
console.log(data.intents);
var topIntent = data.topScoringIntent.intent;
resolve(topIntent);
}
});
});
}
};
client.js
var luisIntent = require('/luis.js'); luisIntent.getLuisIntent('read meeting notes to me').then(response =>{ console.log('Top Scoring Intent--- '+response); });
The program will produce following output:
Check more here:
CHAT BOT USING MICROSOFT AZURE BOT SERVICE & LUIS
BUILDING CHAT BOTs: MICROSOFT QnA MAKER
Microsoft Bot Framework: How to validate user response to bot Prompts?