Echo Dot (3rd Gen) - Smart speaker with Alexa - Charcoal

Use your voice to play a song, artist, or genre through Amazon Music, Apple Music, Spotify, Pandora, and others. With compatible Echo devices in different rooms, you can fill your whole home with music.

Buy Now

Wireless Rechargeable Battery Powered WiFi Camera.

Wireless Rechargeable Battery Powered WiFi Camera is home security camera system lets you listen in and talk back through the built in speaker and microphone that work directly through your iPhone or Android Mic.

Buy Now

Build a Chatbot With IBM Watson Assistant -Part4-

0
341


What is the Dialog and how to implement it to the Chatbot

Abdelhakim Ouafi

Welcome to the Fourth lesson on how to Build Chatbots with IBM Watson assistant, we saw in the last lesson how to create entities which are knowledge repositories used by the chatbot to provide an accurate response.

If you didn’t watch the previous tutorial you can see it in the link below.

In this lesson, we’ll look at the Third important concept of a chatbot, Which is Dialog.

What is a Dialog?

Essentially dialog is a class, which enables Bot designer to intelligently isolate different zones of Bot functionality and guide conversational stream.

Another Definition is that the Dialogs are discussion pieces that control what your bot can do.

You can connect each Dialog with a discourse goal which can be prepared to comprehend varieties in client input, During a discussion with a client, your bot moves between a few unique exchanges, Every discourse handles a part of the discussion.

For instance, Welcome, Main Menu, Order Status, Location and Hours, and Transfer to Agent are singular Dialog that a client may involvement as a major aspect of a solitary discussion with your bot.

You will understand that in action when we start implementing that in our chatbot in a moment.

Watch this video to find out more about Dialog.

Now, our chatbot able to understand some intents and detect a few specific pieces of information, What we are missing is using this information to formulate appropriate responses to the user, and that’s what we gonna do here.

Create a Dialog and improve the prompt

Let’s start this lesson by creating a dialog.

Click on the Dialog section of your skill, it’s empty at the moment, go ahead and click the Create dialog button as shown in the image below.

Take a moment to investigate the default Welcome and Anything else nodes that were generated automatically by the IBM Watson Assistant.

Now, click on the Welcome node and scroll down, as you see here we have a message that says “Hello, How can I help you?”

This message called the welcome message, so every time the user opens the chatbot to start a conversation this message will pop-up automatically.

Click on the Try it out panel, and you can first click on the Clear link at the top to start testing the chatbot from scratch

we have a prompt! But unfortunately, the default welcome message is not user-friendly that will welcome to our users.

Now, Let’s change it, Select the Welcome node first.

Edit the response to say “Hey there, I’m Daniel the virtual assistant to help you here. What are you looking for today?”

Change the name from Daniel, to whatever name you prefer, to make it yours, for me I’m gonna stick with this name just for demonstration purposes.

Now try replying hello or hi in the Try it out panel.

As you see Watson recognized the right intent but doesn’t have a node to handle greetings, so the “Anything else” node was executed.

Note that if you enter a greeting or anything else at this point many times, you’ll get a different response each time, Why this happens.

Well, the Anything else node has three response variations by default IBM Watson Assistant generates that for you automatically because these are set in sequential mode.

So every time we hit this node, the next response variation is provided to us and you can set this to random, and a random response would be provided each time to the users.

We don’t want the users to get the same responses every time so the chatbot will be like a robot, we want it to be as a human as much as we can, so that’s why we want variation in our chatbot.

Adding Chit Chat nodes

Now, We have three intents, greetings and Thanks and goodbye and We now need to have nodes that specify what response we want to give the user when a certain intent is detected.

So we’ll create a folder called Chatting, and we’ll create three nodes in this node, so let’s add it to your chatbot:

With the Welcome node Selected, click the Add folder button at the top of the nodes.

This will create a folder underneath the selected node which is the welcome node here in our example.

Name the folder Chatting and leave the condition empty where it says “If assistant recognizes:” for now because the conditions of the children nodes will suffice.

Now select the Chatting folder and click the Add child node button as shown in the image below.

This will create an empty child node inside the Chatting folder.

Name this node Greeting or wherever name you want since this node will welcome to the users every time they say Hi or Hello or any kind of greeting word so it will be executed when the Greeting intent is detected.

So under If assistant recognizes enter the “#greetings” intent as shown in the image below.

Enter a few responses to offer some variation if we get a greeting-happy user and this is some examples:

  • Hello, thank you for using our service. How can I help you here?
  • Hi, What can I assist you with?
  • How Can I help you?

Remember after type every response press the Enter button so you can enter the other response.

The “And finally” section at the bottom of the node defines what happens after this node has been executed and a response was given to the user.

In the case of this node, after we responded to the users, we expect them to enter some more inquiries, so you can also leave Wait for the user inputs the final action for this node.

Open the Try it out the panel and click the Clear link to start a new conversation.

Try to reply hi to the chatbot prompt.

Congratulations, now you had your first conversation with your clever chatbot, It’s not a complex interaction, but it’s the beginning of the chatbot development.

As you can see at the top of the Try it out panel, the welcome message has been changed.

With the Greeting node selected, click on the Add node button at the top of the nodes, it will create an empty node below the Greeting node.

The order of these Chatting nodes is not that important because they are all simple nodes with independent intents but it can be matter in more complex scenarios.

Go ahead and make this node handle the #thank_you intent, and name it wherever you want I will name it Thanks but you can use any name that finds it suitable for the purposes of your chatbot.

For the responses, you’ll likely want something like:

  • Thank you for choosing our service.
  • I’m happy to help.
  • You’re very welcome.

With the Thank you node selected, add a Goodbyes node by clicking on the Add node button and make it handle the #goodbyes intent.

You can use standard polite goodbye responses such as:

  • Nice to talk to you!
  • See you soon!
  • See you next time!

Start a new conversation in the Try it out the panel by clicking on the Clear button on the top of the panel and test all three intents to ensure you get an appropriate response in each case.

In the next lesson, we will see how more advanced techniques about dialog.



Read More

LEAVE A REPLY

Please enter your comment!
Please enter your name here