Azure Cognitive Services Luis

Azure Cognitive Services Luis

In this Azure tutorial, we will discuss Azure Cognitive Services Luis, Along with this, we will also discuss a few other topics as mentioned below

  • Luis Tutorial
  • What is Azure Cognitive Services Luis?
  • Benefits of Azure Cognitive Services Luis
  • How to create a new app in the LUIS portal
  • Microsoft Luis pricing.

Azure Cognitive Services Luis

Well, here we will discuss an interesting topic i.e Azure Cognitive Services Luis. Before discussing that we should have a little bit of idea on What is Azure Cognitive Services?

Luis Tutorial

As part of this Luis Tutorial, we will discuss all the Azure Cognitive Services Luis, all the important concepts related to the Azure Cognitive Services Luis, End to end the discussion on How to create an APP using Azure Cognitive Services Luis.

What is Azure Cognitive Services?

Microsoft Azure Cognitive services provide a number of Azure APIs or services that Provide you the ability to make it easy to enhance your applications in different areas like vision, speech, knowledge, search and language, etc. That helps you with the ability to implement the AI features in these areas. For more information on this, you can check out What is Azure Cognitive Services now.

We have a little bit idea on the Azure Cognitive Services by now. So let’s discuss about the Azure Cognitive Services Luis now.

What is Azure Cognitive Services Luis?

Azure Cognitive Services Luis meaning Azure Cognitive Services Language Understanding. So Luis is Language understanding. So Azure Cognitive Services Luis is an AI-based service that helps you to build the natural language text so that you can able to predict the overall meaning and that intern helps you to get the detailed and relevant informations.

This service also helps you with the opportunity to build natural language into bots and also into different IoT devices.

You can use Luis in a Chat Bot

You can consider the Language understanding uses in case of a ChatBot application, You might be thinking about how it will work exactly. It works in the following ways

What is Azure Cognitive Services Luis

Step-1: The Language understanding will get an HTTP request from the Users in their own language.

Step-2: The model takes the raw text as input and returns a JSON formatted response with the top intent ITContact.

Step-3: Now the client application fulfill the end user’s request based on the JSON response.

Overall, if you will see, the Language understanding helps with the AI feature support to the client application. At the end of the day, the client application has to take the decision and make the smart choice to provide the quick response to the end-user.

In-depth, if we will see, Luis contains a natural language model that actually helps the Luis application to communicate. There are two models available in the case of the Luis app.

  1. Prebuilt Model: There are many Prebuilt models available in the case of the Luis app. Those are utterances, intents, etc. These models are responsible for the entire design for you that helps to start the Luis app quickly.
  2. Custom Model: Luis app also provides you an opportunity to identify your custom models based on your requirement that also includes the intents and ML entities, etc.

Benefits of Azure Cognitive Services Luis

Well, there are many benefits to the Azure Cognitive Services Luis app. Here we will discuss a few key benefits of the Azure Cognitive Services Luis. That actually helps us to provide the AI support to our application.

  • Azure Cognitive Services Luis helps you to add natural languages to your application. That indeed helps you to build a high-quality language model that helps you with easy conversations.
  • Azure Cognitive Services Luis helps you build a customized solution very quickly based on your requirement
  • Active learning is an excellent part of the natural language model in the Azure Cognitive Services Luis app.
  • The service is available always to be deployed worldwide with high-quality performance and with the 13 language support. The service is highly accessible worldwide.

These are a few key benefits of Azure Cognitive Services Luis app.

Main concepts of Azure Cognitive Services Luis

Below are a few key concepts that you should be aware of before starting the implementation of Azure Cognitive Services Luis.

Intents

The intent is one of the key concepts while working with the Azure Cognitive Services Luis. Basically, the Intent is to represent the task or action the user wants to perform. In other words, It represents the intention of the user, that the user exactly wants tp perform. Intents that are closely related to the utterance. You can find the intent from the utterance of the user.

If you will consider an example like “can you please Book a cab for me?”. This is an utterance. Bookcab is the intent in this case that actually defines the user’s action or task that the user wants to book a cab.

Intent limits

If you consider the limits on the number of intents per application, then here is the answer. You can use the 500 number of intents per application. Out of 500, 499 custom intents, and the required none intent.

Entities

Entities are also important concepts while working with the Azure Cognitive Services Luis. Entities are the data that you want to get from the user’s utterance. Or in another way, an Entity is something that helps you to extract the data from the utterance.

Below are few types of entities that are present in the case of Azure Cognitive Services Luis.

  • Machine learning Entity: Can be used to extract the text from the complex data.
  • Non-machine learning entity: Can be used for the exact text match, pattern match, etc.
  • Pattern. Any: You can use this entity to find out for an instance, the book title from a pattern, etc.
  • Prebuilt: You can use this entity to extract the data like  URL or email, etc.
  • Regular Expressions: It can be used to match the exact Regular expression.
  • List: can be used to extract the list of items and their synonyms.

Out of the above three entities, Machine Learning entities are being used widely and mostly in demand.

If you will consider an example to understand the entity. Suppose the user utterance is “Send Ram a Gift“, From this utterance, The intent here will be sendSomething and then the entities are Ram, Gift.

While creating the app in the Azure Cognitive Services Luis, creating the Entities is actually optional but it is recommended to create the Entities. So always better to create the Entities.

Utterances 

These are the inputs from the user to the app. Utterances are the starting point. While constructing the Utterances, you need to keep few things in mind. Those are as below

  • You need to think about the Utterances length. It can be short, medium, or long.
  • Proper placement of the entity or the main keyword. Better to keep at the beginning, middle, or at the end of the Utterances.
  • Concentrate on Grammar, Noun, and verb, Punctuation, etc.
  • Don’t do spelling mistakes in the Utterances.

Below are few examples of the Utterances

Where is my Pen?

How do I get my Pen?

When can I have my Pen?

I want to use my Pen now.

Below are the key steps how does it work exactly

Designing Your Model

The first step is to design and build your model. While designing your model, few important things need to consider here. User intentions called the intents. The next thing is to consider the user utterance. If you will consider one example here

user utteranceUser intentions (intents)Final data
When does the gym open?Gym operating hours and LocationOpen

Receive the query prediction

The client application sends the utterance to the API an then the API analyzes the utterance and then sends a predicted result as the response in the JSON format.


    "query": "I want to call IT dept Person",
    "prediction": {
        "topIntent": "ITContact",
        "intents": {
            "ITContact": {
                "score": 0.7582669
            }
        },
        "entities": {
            "Contact Type": [
                "call"
            ]
        }
    }
}

Improve Prediction Accuracy

You can improve the Prediction accuracy with the help of the active learning provided by the Azure Cognitive Services Luis.

How to create a new app in the LUIS portal

You need to follow the below steps to create a new app in the LUIS portal.

Login to the LUIS portal

Agree to the terms and conditions and select the Continue using an Azure Resource (Recommended) option. Now you can click on the Use Existing Authoring Resource if you have an Existing Authoring Resource available or if you don’t have, you can click on the Create Authoring Resource button now. I am choosing the Create New Authoring Resource button.

How to create a new app in the LUIS portal

On the Create new Azure Cognitive Services account, Provide the below details

  • Resource Name: Provide a unique name for the Resource Name.
  • Subscription Name: Choose the valid subscription that you want to use here.
  • Azure Resource Group Name: Select the Resource Group that you want to use here.

Finally, click on the Done button.

create a new app in the LUIS portal

Now it will show you that your account is migrated successfully then click on the Continue button to go to the next step.

Creating an APP

Select the correct Subscription that you want to use here., then select the Authoring resource that we have created above. From the + New app for conversation dropdown, click on the + New app for conversation option as highlighted below.

Steps to create a new app in the LUIS portal

On the Create new app window, Provide the below details

  • Name: Provide a unique name for the App
  • Culture: Select the language that your app can understand and speaks.
  • Description: Provide a Description for your App. It is optional and up to you if you want to provide a description.
  • Prediction resource (Optional): This is also an optional field if you want can select a prediction resource. It will show you the list of resources for use in that particular region.
Develop a new app in the LUIS portal

Now the App created successfully with out any issue. The next step is to create the intents.

Creating the intents

Once the App is created successfully. Now the time to create the intents is very important and that actually helps to classify text from users. If you will consider the IT department, may be the intent will be like below

intentutterance
FindTicketWhat is the status of my ticket IT-123456?

Now to create the intent, follow the below steps

Click on the + Create button as highlighted below to create the intent.

Creating the intents Azure Cognitive Services Luis

On the Create new intent window, Provide the Intent name as FindTicket and then click on the Done button.

How to Create the intents Azure Cognitive Services Luis

Adding an example utterance

Now once the intent is successfully created, now the time to add an example utterance. You can add the example like below and hit the Enter key from your keyboard.

How to add an example utterance

You can also add the below examples one by one and then hit enter.

What is the status of the ticket IT-123456

where is the ticket IT-123456

IT-123456

Creating the Regular Expression Entity

The next step is, you can create the Regular Expression Entity by following the below steps

  1. Select the Entities from the Left Menu
  2. Now click on the + Create button to create the Regular Expression Entity
  3. Provide the name as the TicketName
  4. Select the type as the Regex
  5. Provide the regex format as highlighted below.

Finally, click on the Create button to create the entity.

Use prebuilt Home automation app

Time To Train the App

Now the time is to train the App, Follow the below steps to train the App.

  • Click on the Train button next to the Manage option on the top right side.
  • Now once you will click on the Button, after few seconds, the Train button will change to green as shown below.
Luis Tutorial

You can check out the regular expression entity in the example that we have provided as below

How to Train the App Azure Cognitive Services Luis

Finally, Test the App

Finally, we are done with all the configurations. Now the time to test the App. Follow the below steps to test the App

  • Click on the Test button from the top right, which is present Next to the Publish button.
  • Type the test utterance as “Is there a ticket named it-123456” then hit enter from your keyboard.
  • Now click on the Inspect link as highlight below to see the expected output as highlighted in the below screenshot.
azure cognitive services luis how to create

So this is the end to end step to create a new app in the LUIS portal.

Microsoft Luis pricing

Well, here we will discuss the pricing for Azure Cognitive Services Luis.

Instance DetailsTransactions/secondFeature DetailsPricing
Web/Container- Free5 transactions per secondText RequestsPer month 10,000 no of transactions are free
Web/Container- Standard50 transactions per secondText Requestsyou need to pay per 1,000 transactions, ₹99.145.
Speech RequestsPer 1,000 transactions, you need to pay ₹363.530.

For more details on the pricing structure, you can check out Microsoft official site

You may also like following below articles

Wrapping Up

Well, in this article, we have discussed Azure Cognitive Services Luis, Luis Tutorial, What is Azure Cognitive Services Luis?, Benefits of Azure Cognitive Services Luis and we also discussed How to create a new app in the LUIS portal, Microsoft Luis pricing. Hope you have enjoyed this article !!!

Leave a Comment