LUIS Overview & Demo
Utterances, Intents & Entities
Training, Testing, and Publishing a Model
The course is part of this learning path
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.
- 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
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.
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.
So we're here in the LUIS portal, picking up where we left off in the last demo. Now that the app for my pizza place is created, it's time to start populating that with intents, entities, and utterances. I'll start by creating my entities, so I'll click here on the Entities page, and then click on the Create button. I'll name this Size, as it will have the size of my pizzas. This will be of type list, so let's click on List here and then click Create.
Here, under normalized values, I'll type Small, and click anywhere else on the screen to create it. Then I'll click on Synonyms, and type, using comma to separate: mini, tiny, smallest. Then click here on "Type in a list item" to create another one for Large, and in synonyms I'll type: big, larger, gigantic. So now I have my pizza sizes, which is of a list type. Remember, this is a fixed, non-machine learned entity, so anything that is not in this list will not be recognized by LUIS.
Let's create another entity now. I'll click back on Entities, click again on the Create button, and name this MenuItem. What happens is that every item on my menu has a code, with two letters and four numbers. For example, my Pasta Carbonara is EP-1235. So this time I'll select RegEx, and paste this code. What this is basically saying is that, every time you find a word with 2 letters from A to Z, and 4 numbers from 0 to 9, this is an item on my menu. Then I'll click on Create.
Great! I now want to create a couple of pre-built entities for Phone and Email address. To do that, I'll click back here on Entities, and this time, I'll click on the "Add Prebuilt Entity" button. I'll then select email and phonenumber, and click on Done. Notice that now they are available here for me, with a Prebuilt type.
Finally, let's create one more, and this time it will be a machine learned one. I'll click on the Create button, name that Ingredients, and the Machine Learned option is already automatically selected, so it's all good here. Notice that I also have this "Add Structure" button here. This is the option to create sub-entities. I don't actually need this for my pizza app, but let's click on this option to play with it. Note that now the Create button was renamed to Next, so let's click on it.
On the next screen, if I mouse over ingredients, I now have a plus button to create my sub-entities. Let's click on it, and then you see that a hierarchical structure appears. In the example I gave on the slides, I'd have a main entity called location, and sub-entities to represent FROM and TO. But I don't need any of this, so let's click on the Back button, uncheck the "Add Structure" option, and click on the Create button.
So wait a second: for each one of my custom entities so far, list and RegEx I had to do some configuration. For the machine learned one, however, there's nothing to do. How so? Well, its because, in order to configure machine learned entities, you need to add new intents and utterances first, so let's do that! I'll switch now to the Intents page, click on Create, name this intent Order and then click on Done. Then I'll start creating my utterances. Remember, ideally I should have at least 15 utterances per intent, but to make this demo shorter, I'll just add one.
So here in the dialog box, I'll paste this sentence: "I'd like to order a large pepperoni pizza with extra cheese, please", and then press Enter to add. Now you see that the utterance was added, and it automatically detected "large" as the pizza size. That's great. But I have two ingredients here, so I need to train my LUIS model to detect that. So I'll click here on pepperoni, and a new menu opens, giving me the opportunity to map this word to an entity. I'll click here on Ingredients, and now pepperoni is listed as an ingredient. I'll do the same with cheese: I'll click on it, select ingredients, and now I'm pretty much done. I should repeat this for every new utterance I create, to improve the performance of the LUIS model.
As you can see, it's a little bit of work to be doing these mappings, and it's one of the main reasons why Prebuilt Domains are so handy. My chatbot will also offer table reservation capabilities, and luckily LUIS already has a prebuilt domain for that.
Let's click here on Prebuilt Domains, and look at how many options I have, I have options related to email and calendar, weather checking, home automation, and much more. But I only need this one, related to Restaurant Reservation, so let's click here on the "Add Domain" button to add. The button then switches to "Remove Domain", in case I change my mind later.
So if I switch here to intents, look at how many more options I have, I can change, confirm, and delete reservations, among others. And if I click here on Entities, I see also many other entities related to restaurant reservations. Pretty cool, huh? I literally just clicked a button, and I have all of this configured for me. Of course, it would be highly advisable to add more utterances, intents and entities to my app, but I'm too excited to wait, so now it's time to learn how to publish, test, and use our model. Let's learn that next.
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.