Chatbot using Azure’s NLP LUIS w/Demo


In the spirit of AI, I decided to look into various chatbot frameworks available and build a POC. I landed on Microsoft’s Azure Bot Service as my preferred choice. I’ve had a positive experience with Azure’s ML tools and Microsoft has done a tremendous job in past 3 years investing in cloud services. Also, their Bot Service they also integrates with a NLP service called LUIS (Language Understanding Intelligence Service) – which is also owned by Microsoft. ***Note demo is located at bottom of post***
Coding it was simple in which I chose NODE.js instead of C#. The template provided within the dashboard was a great start, and I only had to make a few updates to help integrate with LUIS on NLP for my domain of my choice. The entire dev and deployment is 100% serverless, which I love.
More about the NLP using LUIS, it’s job is to take a utterance(aka sentence), and determine the intent. That intent is used by the Bot Framework to reply a result. In order for your chatbot to provide some functionally, you need to train a model in LUIS with these utterances. The model requires two things: Intents (verb) and Entities (nouns).
I decided to create a fictitious chatbot for a company called “Jon’s Auto Repair”. The goal of the chatboat was to allow the customer to find out services offered and the cost. Much more could be built including scheduling services, and custom Q&A.
1) Intents – greeting, get_service, get_cost, cant_service
2) Entities- service, cost
Sample utterance entered in LUIS to train the model: “what do new brakes cost”. After entering, I tag “brakes” -> service entity, and “cost” -> cost entity.
The LUIS endpoint you can query with a string. For example, here is the result of the query: “my brakes are squeak can you fix”. Behind this scenes this is passed the endpoint here: LUIS endpoint
Here is part of JSON response showing the top scored intent:
"query": "my brakes squeak can you fix",
"topScoringIntent": {
"intent": "get_service",
"score": 0.52136153

Here are a few screenshots showing it working:


Here is the live demo hosted by Aruze, and it’s as simple and pasting the embed code provided: