Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
      You have completed Build a Chatbot with Watson APIs!
      
    
You have completed Build a Chatbot with Watson APIs!
Preview
    
      
  An intent communicates a user's goal, something they want to achieve. We will start building our Conversation service by defining our first intent.
Documentation
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
                      We will start building our conversation
service by defining our first intent.
                      0:00
                    
                    
                      An intent is a group of examples of things
to use or might say to do something.
                      0:05
                    
                    
                      They're communicating their goals,
something they want to achieve.
                      0:11
                    
                    
                      Creating an intent is easy.
                      0:16
                    
                    
                      You start by thinking of something
your users will want to do.
                      0:18
                    
                    
                      Then you went to the multiple examples
of how they would say or type that goal.
                      0:23
                    
                    
                      >> In our current chaoter, our user would
want to turn things up, for example,
                      0:28
                    
                    
                      they might think something like,
I want to turn on the radio and
                      0:32
                    
                    
                      we want Watson to learn
how to handle this.
                      0:35
                    
                    
                      So what is the goal here?
                      0:38
                    
                    
                      They want to turn on the radio.
                      0:39
                    
                    
                      Now, for intents,
                      0:41
                    
                    
                      we only care about what they want to do,
which in this case is turn something on.
                      0:42
                    
                    
                      We don't care yet whether they're talking
about the radio, lights, the heater or
                      0:47
                    
                    
                      whatever, we just need Watson to realize
that the intent is to turn something on.
                      0:51
                    
                    
                      Okay, so, if we're in the app right now,
where it's not doing anything, and
                      0:57
                    
                    
                      we type, turn on the radio.
                      1:00
                    
                    
                      As expected, nothing happens.
                      1:03
                    
                    
                      But, over here on the right, we have
this section called Watson understands.
                      1:05
                    
                    
                      In this, is the JSON response
currently being returned
                      1:10
                    
                    
                      by our conversation service.
                      1:13
                    
                    
                      And, what I want to highlight is here.
                      1:15
                    
                    
                      Notice that there is an intense
array here and it is empty.
                      1:17
                    
                    
                      So that's what we're going to build.
                      1:21
                    
                    
                      So Arman, how should we get started?
                      1:23
                    
                    
                      >> Excellent and wonderful.
                      1:26
                    
                    
                      Let's go to our conversation service and
                      1:27
                    
                    
                      we're going to open
the treehouse workspace.
                      1:30
                    
                    
                      An intention may be to
turn something on or
                      1:34
                    
                    
                      to turn something off,
we don't know what yet.
                      1:37
                    
                    
                      So why don't we start
with turn underscore on?
                      1:41
                    
                    
                      No spaces in this.
                      1:45
                    
                    
                      >> Okay.
>> And the pound sign, and later on you'll
                      1:47
                    
                    
                      note the at sign with entities,
is not a programmatical construct.
                      1:50
                    
                    
                      It's merely here to help
distinguish these two
                      1:55
                    
                    
                      easily as we move-
>> Okay.
                      1:59
                    
                    
                      Cool.
>> Into the dialogue.
                      2:01
                    
                    
                      >> Makes sense.
                      2:03
                    
                    
                      >> Well, let's enter an example.
                      2:03
                    
                    
                      For example, power on.
                      2:06
                    
                    
                      >> Okay.
                      2:10
                    
                    
                      >> Turn on.
                      2:13
                    
                    
                      Switch on.
                      2:15
                    
                    
                      Play.
                      2:20
                    
                    
                      Start.
                      2:23
                    
                    
                      >> Good, good, sometimes I'll say flip on,
like flip on the radio.
                      2:25
                    
                    
                      >> Absolutely, absolutely.
                      2:28
                    
                    
                      >> So now I noticed that we're
not adding the entity yet,
                      2:30
                    
                    
                      like we're not saying,
power on the radio, or turn on the wipers.
                      2:33
                    
                    
                      That's because if I'm understanding
the intent just wants to focus on
                      2:36
                    
                    
                      again that we are turning something on.
                      2:40
                    
                    
                      Is that correct?
                      2:41
                    
                    
                      >> You're precisely right,
Ben, absolutely.
                      2:42
                    
                    
                      In here we are defining our intention and
as we become more gradual, we will then in
                      2:44
                    
                    
                      the intense, identify what is it that we
want to turn on or turn off and similar.
                      2:50
                    
                    
                      >> Okay, so having a wide variety
of examples here is really helpful.
                      2:56
                    
                    
                      The more we can add to the intent,
the better it will help Watson
                      2:59
                    
                    
                      learn how to recognize that the user
wants to turn something on.
                      3:03
                    
                    
                      So we don't need to list
every possibility, but
                      3:06
                    
                    
                      we do want to list at least five
examples for each intent that we create.
                      3:08
                    
                    
                      And we can always edit or
add these examples later.
                      3:12
                    
                    
                      >> Absolutely true.
                      3:15
                    
                    
                      And bear in mind that natural
language classifier, which is
                      3:16
                    
                    
                      the engine running intents and entities,
already comes trained with Wikipedia.
                      3:21
                    
                    
                      All we need to do is just give it
a push in the right direction.
                      3:27
                    
                    
                      >> Very neat, yeah.
                      3:30
                    
                    
                      >> We should also point out that you can
import data for intents and entities,
                      3:32
                    
                    
                      which is helpful if you have a list
already or generated data somewhere.
                      3:36
                    
                    
                      We'll see how to do this a bit later.
                      3:42
                    
                    
                      >> Okay, so
I guess I can click Done now ,right?
                      3:45
                    
                    
                      This one is done.
>> Yes.
                      3:47
                    
                    
                      >> Good, and now we can go back to
our example, and I'm gonna refresh.
                      3:48
                    
                    
                      And now let's try again one of
our examples, turn on the radio.
                      3:56
                    
                    
                      And over here in the Watson Understands
section, now the intents is populated
                      4:03
                    
                    
                      with an array and it matched the turn
on intent that was just created, and
                      4:08
                    
                    
                      we gave it with a very high
confidence score here of 0.95,
                      4:13
                    
                    
                      which a score of 1 is like
it's perfectly confident.
                      4:17
                    
                    
                      So Watson at this point is very confident
that we want to turn something on.
                      4:20
                    
              
        You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up