This course focuses on how to use the LUIS (Language Understanding Intelligent Service) portal to create new LUIS models, how to enrich them with intents, entities, and utterances, and how to train and apply apps.
Not only will you get theoretical knowledge of LUIS and its components, but you'll also follow along with demonstrations from the LUIS portal to get a practical understanding of how to use the service.
Learning Objectives
- Obtain a general understanding of what LUIS is and how to interact with it
- Create LUIS resources
- Learn about utterances, intents, and entities and how they are used in language understanding at a practical level
- Learn how to test, train, and publish your LUIS models
Intended Audience
This course is made for developers or architects who would like to know more about how to use the Language Understanding Intelligent Service, LUIS, to improve their chatbot development and experience.
Prerequisites
To get the most out of this course, you should have some Azure experience, particularly surrounding subscription and resource groups as well as chatbots and language services. Some developer experience, including familiarity with terms such as REST API and SDKs, would also be beneficial.
Now we'll dig a little bit deeper on the concepts of Intents, Entities, and Utterances. Let's start with Utterances. An Utterance is the input for the user that your app has to interpret. Simply put, these are the sentences themselves. Your LUIS app will need to interpret those Utterances and match them to the correct intent and entities. These sentences can include many entities or have none at all. You can use the LUIS Porto to train the servers on a specific utterance to improve the performance of the model.
When entering them, keep these aspects in mind. Create utterances that you think your users will enter when using the app. Make sure that you capture a variety of different examples. What are alternative ways of saying the same thing? Vary the length of the utterances for short to medium to long. Also, vary the location of the noun or subject in the Utterance. You can place it at the beginning, in the end or somewhere in the middle. This might seem counter-intuitive but you can use both correct and incorrect grammar in different utterances to offer good training data examples. Alternatively, you can use another cognitive service called Bing Spell Check to correct grammar and punctuation errors before the utterances are sent to LUIS.
Also be sure that you use the language of the user, which might not necessarily have the domain knowledge to describe what he wants. That's probably not going to be an issue if you're building a travel or restaurant port. However, if your
Finally, in order to ensure a better model performance make sure that you have at least 15 Utterances for every intent. You actually won't be able to train your model If an intent has no Utterances.
If you want to know a little bit more about creating an Utterance, here's a couple of facts 'cause that might be interesting to you. The Add Utterances unit to Microsoft Learn teaches you how to create new ones both using the portal or through Code with Python and C#examples. These exercises also part of the official learning track for the exam. So it's a good reference material for you. Also, this page on Microsoft docs discusses the best practices for Utterances most of which we have discussed in here.
Another option you have is to review the Utterances sent by the users after the LUIS app is in production. LUIS works with the concept of active learning which means that it's constantly improving as new Utterances are sent to the service. You can then use the sentences to enhance the performance of the model by marking the proper intents and entities on them.
Active learning is enabled by default, based on a query string parameter, log equal to true. You can disable this feature by searching this flag to false. However, this is not recommended as it will deny LUIS the opportunity to learn from new sentences that are sent by the users. All log Utterances become available on the Review Endpoint Utterances page on the LUIS portal so that you can manually evaluate them. You can also delete Utterances that are not providing any value or that are not tied to any intent.
Finally, remember to retrain the model after receiving a bunch of utterances so that the changes are reflected in the LUIS app. If you want to know a little bit more about using user sentences to improve the model you can check this link.
Now let's talk about Intents. As we have mentioned before, an intent represents a task or action that the user wants to perform. It's the purpose or the goal of the Utterance. And it's generally represented by a verb. For example, in the sentence, book a table for four people at 6:00 PM. The Intent is to create a new table reservation which you can symbolize by a reserved table intent. Although an Utterance can have many entities on it, there will be just one top-scoring intent returned.
What this means is that LUIS might attack zero to many entities in a sentence but will always attack just one top intent. Each one of these intents needs to be mapped to a corresponding function on your code. For example, if you have a reserve table function on your program you need to create a matching tent in your LUIS app. Make sure that you balance the number of utterances for every intent. For example, if your reserved table intent has 30 utterances, and your change reservation has 300, this is not a well-balanced distribution and it might decrease the accuracy of your LUIS model. If you want to know a little bit more about intents, this article is part of the Microsoft learning track for XM and it also covers how to create intents through code using either C# or Python.
When you create a new LUIS model there be one intent already created by default called None. These are sort of Cache intents which represents random utterances that do not map to any of your configuring intent. The None Intent is required and cannot be either deleted or renamed. You should fill it with utterances that are outside of your domain.
For example, if you're a LUIS app is about restaurants reservation an utterance with the None intent would be how do I book a flight? Microsoft recommends that 10% of all your utterances are on this intent. If you don't populate that LUIS will try to map every utterance to one of the other intents which might decrease the performance of your model.
Emilio Melo has been involved in IT projects in over 15 countries, with roles ranging across support, consultancy, teaching, project and department management, and sales—mostly focused on Microsoft software. After 15 years of on-premises experience in infrastructure, data, and collaboration, he became fascinated by Cloud technologies and the incredible transformation potential it brings. His passion outside work is to travel and discover the wonderful things this world has to offer.