When creating a Chatbot in Watson Conversation,
we first create intents,
then entities, and finally,
we design the dialogue.
Let's start exploring the concept of intents,
an intent is the goal or purpose of the user's input.
Watson Conversation expects us to add
examples for each intent that our chatbot needs to address.
These examples are then used by Watson to figure out
different ways in which people may express the same intent.
In other words, you can think of intents as labels for
a group of examples that express a common goal or purpose.
For example, we might define an intent called greetings.
Examples for this intent may be a "hello",
"hi", and "hey", "good morning" and "good evening".
It is recommended that we specify at least five examples for each intent that we define.
The more examples you provide,
the better Watson will be at understanding the specific intent.
The good news is that you're not stuck with the initial examples that you picked.
You could always go back and add,
edit or delete examples for a given intent.
In fact, over time,
it's a good idea to add more examples that you have collected from
users as they interact with the chatbot in order to further train Watson.
When the user specifies "hola",
"aloha" or even "yo",
Watson will recognize the user's greetings intent for us.
And as you can see in the try out panel on the right,
even though we didn't specify those three words in the examples,
Watson will correctly detect what the intent is,
in our case greetings.
Watson trained on our examples and was able to
correctly recognize similar utterances on his own.
By creating these greetings intent,
we're telling Watson that common greetings in
the user input should be detected and labeled as this specific intent.
Later on, when designing the dialog,
we'll be able to customize our chatbot response to
various questions on the basis of their matching intents.
For example, we would most likely have the Chatbot
great the user back when the greetings intent is triggered.
Will Watson detect 100% of all possible greetings?
Probably not. But he will correctly detect most of them.
As you we will see later on,
we'll have a contingency plan in place for when this occurs or when
the user asks perhaps
an irrelevant question and Watson can match it with any intent we have created.
The try it out panel on the right by the way is a tool provided by
Watson conversation to test out our bot as we build it.
So, it's for bot designers and you won't be displayed to your chatbot the end users.
As you can see towards the bottom of the panel,
if you provide an input and then relay the question
or sentence like asking about the weather,
no matching intent will be recognized by Watson,
and we can optionally provide an intent that this new expression should be matched with.
If we do that, Watson will have their question as an example for their particular intent.
We're basically using the try it out panel as a way to further train Watson.
You probably know this by now but it's worth mentioning that intents are
automatically prefixed with the pound symbol. Intents are not hash tags.
Part of the reason why intents use
the pound symbol prefix is that it removes ambiguity when referring to them in responses,
as well as distinguishing them from
other components which might have the same name but are not intents.
For example, entities and context variables,
which will work over later in the course.
Intents cannot have spaces.
So, you should use an underscore when defining intents with multiple words.
The examples you provided in Watson for a given intent however can have spaces.
Since these are just sentences and questions the user might input.
You might recall that good morning and good evening
examples we used in the greetings intent.
A chatbot will typically have multiple intents.
The intents that we create define the scope of
the chatbot as the shape what it's able to handle.
When thinking about the flower shop chatbot,
what are some of the intents that come to mind?
Maybe it's just me but whenever I order flowers online,
my questions seem to be around delivery.
So, let's start with that.
Let's say that we want to create the delivery_info intent.
What kind of examples can we provide to Watson for this intent?
We want to train Watson with representative questions.
Questions that our users will likely type in as they interact with our chatbot.
In fact, if you have access to actual questions that were asked by users, even better.
Some examples could be: Do you deliver?
Do you deliver on weekends?
When will I receive my flowers?
Will I be able to get my flowers on Sunday?
Do you deliver during the holidays? And so on.
Notice that the occasional misspellings in the examples don't
hurt because our users won't always type perfect sentence either.
We want to train Watson with the most realistic questions as possible.
Occasional misspellings included likewise although not ideal.
The user might be tempted to interact with the bot using
common-like utterances rather than full sentences.
So, we could add delivery information to the examples as well.
Another intent that comes to mind is people
asking for advice on the right flowers for a given occasion.
We might call this intent flower_suggestions.
An obvious example, we can add to the intent is flower suggestions itself with spaces.
But what else can we add to train Watson on people's requests for flowers suggestions?
I think the people my type in flower recommendations,
recommended flowers for special occasions,
which flower should I buy?
And of course some might be more specific including
the special occasion or recipient in their question.
For example, flowers for an anniversary,
what flower should I buy for my mom?
Which flowers for a birthday?
Bouquet for girlfriend.
Which flowers for a funeral?
I'd like to buy flowers for a sick friend.
I want flowers that express sympathy.
What are the best flowers for Valentine's Day?
So, as you can see,
people have very different ways to express
the same intent of wanting suggestions for flowers.
And in this particular case,
they are also telling us a specific occasion
or a specific reason why they have that intent.
Some people might enter longer requests that express the same intent.
So, we might want to throw in a couple of examples, so that as well.
For example, what would be a good arrangement to give someone when they are retiring?
Or what types of flowers make a good choice as an anniversary gift for your parents?
This will train Watson to recognize when people are asking for flower recommendations.
Note that when defining this intent,
we're not overly concerned with the exact special occasion.
So, we don't need a complete list of all the holidays
and moments in life that call for flowers gifting.
We just need to train Watson on what flowers suggesting questions tend to look like.
Nevertheless, when we build a dialogue later in the course,
we'll have to provide responses that provide
meaningful suggestions depending on the special occasion.
Yes, all these questions indicate that the intent is getting a flower suggestion.
However, we need a way to handle the different types of special occasions.
We don't want to recommend the same flowers for funerals and Valentine's Day.
So, we need a way in our chatbot to distinguish the inputs further,
so that we can respond differently to the same intent depending on the occasion provided.
Entities solve this problem for us.
In the next video,
we will formally introduce entities and take a closer look at how to use them.