>> Learn how to get started with
natural language understanding in Azure
in this episode of Azure Tips and Tricks.
The natural language service in Azure enables users
to interact with your app using natural language.
Let's try it out.
First, I need to create
a language understanding resource in Azure,
there it is, and "Create".
First, I'll leave this to both.
This lets you choose to create
a language understanding resource
for only the creation of the model
or only for the prediction service part or both.
Now select a resource group.
Now, I'll put in a name like this,
and also for the authoring service.
This is the part of the service that
lets you create a model and train it.
The prediction resource is the rest API
that you can use in your app.
This can be in a different location than the authoring resource.
Let's create it, and I'll skip to when it is done.
Here we go.
This is the authoring resource,
and here in the Quick start blade,
I can use this URL to open the Language
Understanding Portal.
That's it.
First, let's start by creating an app.
I'll give it a name.
Now, I'll select a prediction resource, and that's it.
Here we go.
This is the app and in here,
I can create a language model
that can understand what users are saying.
Instead of building one from scratch,
I can pick a pre-built domain from here.
These are language models for scenarios like home automation,
planning, and this one for weather.
Let's add it.
The main components of
a language understanding application are intents and entities.
Intents like these are
how the Language Understanding Service
understands what users want to do.
Intents are made up utterances,
which are examples of what a user could input, like these.
These utterances contain entities,
like this weather range or this one that
identifies words that represent a time.
Let's see, these are the entities that are used in the model.
There are pre-built entities like the datetimeV2,
which when it is inserted in
an utterance detects dates, days, months,
and other date related words,
and then translates that into information that your app can use.
There are also custom entities which you can create yourself.
You can create entities that detect
certain words in a list like east, west or south,
and entities that are machine-learned.
The machine-learned entities learn
their possible values from example utterances,
so intents and entities make up the model.
Here, in the settings,
I can tweak the behavior of the model
and its machine learning training.
Now we need to train the model.
Here it goes. It now uses machine learning to create a model
that can predict what user input means.
It's done.
Let's test it, and here we go.
I'll type something that a user might type in.
It spits out a result which I can inspect.
The service predicts that the intent of this input
was Weather.CheckWeatherTime
and it predicts that with a 99 percent certainty.
It also detected the Weather.WeatherRange entity
from the word hottest and historic entity from the word month.
Pretty cool.
Now let's publish this model to an API endpoint.
Here, you'd use a staging slots to test
the API endpoints that it produces and if that works as expected,
promote it to the production slot.
You can also indicate if you want to use
sentiment analysis to evaluate the sentiment of text input,
apply Bing Spell Check to compensate
for spelling errors and speech priming
to improve the recognition of spoken words
and phrases that are commonly used in your app.
These additional options use Azure Cognitive Services
to enhance the language understanding service.
Here we go, let's deploy it.
Now, I can find the URL to the endpoint of the published API.
Let's copy that, and let's open a browser and try to use the API.
At the end of the query here,
I can type in the user input, like this.
Let's see. That's it.
This is the same result as we saw in the test window,
but now as JSON data which you can use in your app,
the language understanding service can help you to interact
with your users by understanding what they are saying.
Go and check it out.