Thứ Năm, 26 tháng 10, 2017

Auto news on Youtube Oct 26 2017

When creating a chatbot in Watson Conversation, we first create intents, then entities, and

finally we design the dialog.

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

might 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 might be "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

can 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 it 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 its own.

By creating this #greetings intent, we are telling Watson that common greetings in the

user input should be detected and labelled as this specific intent.

Later on, when designing the dialog, we'll be able to customize how our chatbot responds

to various questions on the basis of their matching intents.

For example, we would most likely have the chatbot greet the user back when the #greetings

intent is triggered.

Will Watson detect a hundred percent of all possible greetings?

Probably not, but it will correctly detect most of them.

As 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't 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 it won't be displayed to your chatbot end users.

As you can see towards the bottom of the panel, if we provide an input and unrelated 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 add that question as an example for that particular intent.

We are basically using the Try it out panel as a way to further train Watson.

You probably noticed by now, but it's worth mentioning that intents are automatically

prefixed with the pound symbol.

Intents are not hashtags.

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 we will cover later on in the course.

Intents cannot have spaces, so you should use an underscore when defining intents with

multiple words.

The examples you provide Watson for a given intent, however, can have spaces, since these

are just sentences and questions the user might input.

You might recall the "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 they 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 tend to be around

delivery, so let's start with that.

Let's say that we want to create a #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 would 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 sentences 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 flower suggestions?

I think that people might type in: ● Flower recommendations

● Recommended flowers for special occasions ● Which flowers should I buy?

And of course some might be more specific, including the special occasion or recipient

in their question, for example: ● Flowers for anniversary

● What flowers 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

a suggestion for flowers.

And in this particular case, they're also telling us a specific occasion or specific

reason why they have the intent.

Some people might enter longer requests that express the same intent.

So, we might want to throw in a couple of examples of 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 are 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 needed to train Watson on what flower suggestion questions tend to look like.

Nevertheless, when we build the dialog 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 #flower_suggestions.

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 input 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.

Không có nhận xét nào:

Đăng nhận xét