Conversational Services

Create a bot of yourself with Watson

Share this post:

Co-authors: Adam Benvie , Zach Eslami, Nada Zaher and Nathan Robinson

Want to create your own bot but too busy to read the full tutorial? You can import our workspace! Signup for a Bluemix account, create your conversation instance, import the workspace. Keep reading below for full details.

What do chatbots do?
Whether it’s answering questions for online shoppers, assisting customers file their taxes, or helping people understand their insurance policies, chatbots are enhancing experiences today more than ever. But the experiences that you choose to enhance is entirely up to you. To see how easy it is to build your chatbot and enhance those experiences, keep reading…
zach_headshotMy not so technical background
When I started with IBM Watson as a recent undergrad in August of 2016, if I had been asked to build a bot, it would have been the end of the line for me – I don’t code, and I’m not super technical. Today though is a different story. This is the story of how someone – with no experience building chatbots – can “bot themselves” using the IBM Watson Conversation API.         

            

What does it mean to bot yourself?
Exactly what it sounds like. The idea is to create a chatbot that can answer questions about you, as if it were you, without actually being you. So, it could answer questions about where you’re from, what you do for work, and when you graduated college. And if you’re ambitious, it can even talk to your mom for you when you’re “busy”.

 

chat2

Myself along with three other new IBMers-Zach Eslami, Nathan Robinson, and Nada Zaher-,who also had no experience building chatbots, set out to “bot myself” – and so now we give you, Adam the Chatbot (if you don’t have Facebook use this). Feel free to shoot some questions his way to learn more about yours truly. He’s a pretty simple chat bot, but the more question he gets, the more he learns and improves!

Four Simple Steps to Bot Yourself
Prerequisites:
Create a Bluemix account
Create a conversation instance

Step 1: Define Intents

Intents are the objectives of every bot. If a chatbot helps users handle expenses, the intents would be things like “view x (amount due)”, “pay y (bill)”, and “cancel z (account)”.

A chatbot that answers questions about you has the broad objective of providing information about a human being. Therefore, it helps to think of this information as it pertains to where, what, and when. In other words, the intents would answer “where did you x”, “what is your y” and “when did you z”. The actual intents would simply be “where”, “what”, and “when” (or location, general info, and time).

blogpic2

After you have your intents, the next step is to add utterances. Utterances in the Conversation API refer to the different questions your end users ask your bot. Under each intent, add questions that would pertain to them. Under the “where” intent you would add phrases like “where did you go to college” and “where do you live.”

Not only would you want to add as many “where did you [insert noun and/or action here]” as you can, but you would want to add the different ways each of these questions could be phrased. So, not only would you want to create the utterance “where did you go to college” but you would also want to add “did you graduate from a school in the U.S.”, “in what state did you go to university” etc. The more utterances you add the better.

Step 2: Define Entities

When we were building Adam the Chatbot, understanding the difference between intents and entities was our biggest challenge.

The best way to think about entities is that they are the SUBJECTS of intents.

So, in “where did you go to college” the intent would be “where” and the entity would be “college”. This allows single entities to apply to multiple intents. In this example “college” could apply to both the “where” and “when” intents.

blogpic4

Under each entity, you will also want to add values. Values are sub-subjects of entities. So, under college, you would have things like major, YOG, and classes, along with synonyms for each of these. The more synonyms you add for each entity value the better. That way someone can ask “what was your major” and “what did you study” and get the same correct answer.

Another tip here is to add descriptive words before certain entity values that could have more than one meaning. In this example “study” could be the verb or the noun. So, to help clarify the meaning in the context that it’s being used, you could add “you study” as a synonym for major, and “a study” as a synonym for home library.

Step 3: Creating Your Dialog

You’ve got intents, you’ve got utterances, you’ve got entities, and you’ve got entity values and synonyms. Now it’s time to build exactly how your bot is going to interact with users. In the Watson Conversation API this part is your dialog.

Setting up your dialog flow is all about logic. The dialog in the Conversation API is set up like a logic tree with many “if then” conditions. Each intent begins a node on the left and the logic flows from the top down through your intents. If a certain intent is triggered by an utterance, its node is opened and the logic continues to entities.

The logic within each node (i.e. through entities) also flows from top to bottom. A specific combination of #Intent and @Entity:value triggers a certain response to a question – this combination is referred to as the response condition. So, for “what was your major” the “what” intent would be triggered and then the response associated with the response condition #what and @college:major would be returned.

After you set up each “#what and @Entity:value” response condition, you can start having fun with responses. Here is where you can give your bot a personality. You can make your bot of yourself sassy, sarcastic, or whatever attitude the REAL you has. Zach and Nathan really went wild here with Adam the Chatbot which made him a lot more fun for people to play with.

You can also get clever with how you craft your responses so that single responses can answer multiple question. So, for “where did you go to college” you could have a response that says “I went to x, where I studied y, before I graduating in z”. This way you can nail “where” “what” and “when” in a single response.

chat1

Step 4: Training and Improving

Now it’s time to deploy your bot to some friends and family to see how it does. I can’t stress enough how important it is to deploy your bot ASAP so you can see how your bot handles questions. In our experience, we didn’t deploy our bot to real people until we thought it looked GREAT. Then, about 30 seconds after deploying it, people had our bot in a pretzel. Below is a real screenshot from my friend after he tried the bot for the first time….

blogpic8

After your bot has gotten a healthy amount of utterances from end users, you can use the Improve section of the Conversation API to improve and train your bot. For questions that didn’t trigger the correct intent you can add them so that they do. More importantly, you can start to see what types of questions are being asked that you may not have thought of. For example, with our bot, we didn’t anticipate how many questions we were going to get about my “favorite” color, book, sport etc. until after we deployed it.

After you’ve deployed the bot and improved on the results, re-deploy to even more people and improve again. Repeat this process as many times as you’d like. Through each iteration the bot will continue to improve as you train it to better answer questions. Sooner or later you’ll have your friends thinking you’re an A.I. wiz. And who knows, maybe it’ll help you get on better terms with your mom 😉

Building Your Own (without the work)

To use the intents, entities, and dialog we used for Adam the Chatbot, sign-up for a free Bluemix account, create your free Conversation instance, and import our workspace . Change the bot responses to be about you, and you’re off!

Resources

Sign-up for a Bluemix free trial

Create your Conversation instance

Import Adam the Chatbot Workspace 

Integrating with Facebook messenger

Additional reference material

 

Start building a bot with a free Watson trial!

 

Add Comment
3 Comments

Leave a Reply

Your email address will not be published.Required fields are marked *


George Richards

It seems like a,lot of work, regardless. I should simply be able to create my not by borrowing all of the potential responses by simply altering them to fit my particular personhood. Once established I could then tweak answers as needed. I would never do this from scratch. Someone else has to do the grunt work of establishing routine Q and A for most often asked questions and the like. If that’s an option I’ll look into it.

Reply

Cleo Cat

Soo, it sounds like it’s just like that ElizaBot that I had on my Commodore 64 over 30 years ago. I didn’t see anything new here, just a pretty interface and a different work-flow but basically the same thing behind the scenes, unless I missed something??? Where does Watson come into play here? It doesn’t sound like Watson is doing anything, you’re leaving the entire programming to the developer to create, and Watson is just providing an interface to make it easier, but why Watson? Any PC could do that. Does Watson provide special unique advantages to this API that wouldn’t be there in a normal PC/Server? Just curious, not bashing. Thanks 🙂

Reply

Bud Labitan

Place something like this on Facebook and Linkedin to pick up the individual users interests. Then, you may attract a wider audience to IBM Watson technologies.

Reply
More Developers Stories
November 3, 2017

AI is redefining customer service. Does your call center stack up?

More than 62% of customers will consider switching to a competitor after only 1-2 bad experiences with a brand. New technologies like AI and chatbots are allowing brands to offer always-on self-service, at scale, cheaper than ever before. Spend 5 minutes or less to answer 8 questions and find out how your customer service stacks up.

Continue reading

October 23, 2017

Top 7 trends for enterprise call centers and customer service in 2018

The call center space is a significant, growing opportunity, and a powerful tool to transform the success of a brand in today's digital world where customers expect responses 24x7x365. AI and cognitive technologies — notably, chatbot technologies — are dominating the conversation as one of the more interesting disruptors at play. Here are 7 trends we expect to see at enterprise call centers in 2018.

Continue reading

October 20, 2017

The future of call centers and customer service is being shaped by AI

Customers today expect seamless interactions with brands whenever and wherever they choose. Given a choice, 70% of customers today prefer messaging over voice for customer support. Learn how LivePerson and Watson teamed together to create LiveEngage, the first out-of-the-box integration of Watson-powered chatbots with human agents.

Continue reading