Introduction to LUIS

In many of our previous sharing, we have learnt to explore the features of LUIS in many ways, such as :

What so special about LUIS? Why we keep discussing about it? It is because its natural language processing (NLP) capability and its developer-friendly experience!

Today, we would learn about how to apply LUIS application in NodeJS application.

Getting Started with LUIS on NodeJS…

First, let’s use Visual Studio Code to create app.js file.


var request = require('request');
var querystring = require('querystring');

function getLuisIntent(utterance) {
var endpoint =

// Set the LUIS_APP_ID environment variable
// to df67dcdb-c37d-46af-88e1-8b97951ca1c2, which is the ID
// of a public sample application.
var luisAppId = '';

// Set the LUIS_SUBSCRIPTION_KEY environment variable
// to the value of your Cognitive Services subscription key
var queryParams = {
"subscription-key": '',
"timezoneOffset": "0",
"verbose": true,
"q": utterance

var luisRequest =
endpoint + luisAppId +
'?' + querystring.stringify(queryParams);

function (err,
response, body) {
if (err)
else {
var data = JSON.parse(body);

console.log(`Query: ${data.query}`);
console.log(`Top Intent: ${data.topScoringIntent.intent}`);

// Pass an utterance to the sample LUIS app
getLuisIntent('what's the hawaiian pizza made of');

Of course, replace the censored field with your key and LUIS ID. Learn how here if you are new to LUIS and Azure.

Then, npm install dotenv and also npm install request to the NodeJS project.

Now, press F5 in Visual Studio Code to run build the NodeJS app. You should now got it working with LUIS!

When the app sends the query (hardcoded in our case), and LUIS returns with Top Intent – Enquiry!

How cool? Follow us!


Today, we have learnt how to implement natural language processing (NLP) with LUIS in our NodeJS application.


Follow me!

If you like my writing, subscribe me or following me at below:
Twitter: @hmheng
More slides @ SlideShare: