How to build a chatbot with IBM Watson

May 1, 2018 • Shannon Flynn

Advertisements

Even if you don’t consider yourself as in the know about tech as others, you’ve probably heard of IBM Watson. Named for Thomas J. Watson, IBM’s founder, it’s a supercomputer that uses artificial intelligence and advanced analytics to answer questions posed in natural language.

IBM also makes it possible for anyone to see what Watson can do by building a chatbot that works with the technology.

One of the advantages is that the process is very accessible, even for people who don’t have any coding experience.

After making a chatbot with Watson, you could collect enough information from your user base to determine that chatbots make sense for your business.

Or, if you’re curious about building one for purely personal reasons, going through the steps will help you understand more about chatbot technology as a whole. Let’s get started.

1. Set up Your IBM Cloud Account

The first step involves registering for an IBM Cloud account. The process is free and straightforward. To complete your registration after filling in the fields, watch for a confirmation link that arrives in your email and click it.

2. Find the Watson Assistant

After logging into IBM Cloud, click on the Catalog link in the upper right corner. On the next page, type “Assistant” into the search box. You may also see a blue banner above the search box that says the Lite filter is enabled. That’s okay because it means the search results will only relate to the free, Lite plan you have.

3. Launch Watson

Click on the Assistant link generated by your search. There should be only one result. Doing that loads a description about the Watson Assistant, and the page includes some of your account details at the top.

Look for the blue Create button in the bottom right corner and click it. On the following screen, click the turquoise Launch Tool button to the right.

4. Create your workspace

The screen you see now describes the general process for creating your chatbot. Each segment includes a Learn More link you can click for a more in-depth explanation. Otherwise, look below the main part of the screen and choose the Create a Workspace button.

On the next page, click the blue Create button associated with the Create a New Workspace box. Notice the message indicating you can make up to five workspaces. When the Workspace box pops up, input a name for your chatbot in the first box and a short description in the one below it.

For many applications, you’ll need to be extremely specific with your description. For example, automation is becoming a crucial part of delivering smooth and effective services to customers, and that’s particularly true when you take time to determine the things people usually ask and design a chatbot accordingly.

Also, make sure your preferred language shows in the drop-down box. Then, click the Create button in the bottom right of the box.

5. Add user intents

The next step involves thinking about how users will typically interact with the chatbot. If you work for a live events ticket agency, it might be useful to build a bot that tells people about upcoming events.

Once you’ve picked a primary purpose for the chatbot, it’s time to make user intents. In the ticket agency example, the user intent could be “Find event information.”

Click the Add Intent button. Then populate the two fields on the next screen with an intent name and description and click the blue button Create Intent button to confirm.

Next, it’s time to train your chatbot by teaching it phrases that are similar to things your users might ask. A person searching for concert tickets might say “Is Ryan Adams coming to Richmond?” or “When do tickets go on sale to see Sam Smith in Charlotte?”

You have to add these phrases to Watson one at a time. Do so by putting them in the Add Examples field below the user intent and descriptions sections. It’s best to add at least five.

6. See how the bot responds

After adding several user intents, click the speech bubble icon in the upper right. That opens a Try It Out chat window. You’ll see a message that tells you Watson is training, but it should only stay on the screen for less than a minute. Wait until it disappears and says Watson has finished training before proceeding.

Then, type a phrase in the chatbox that represents one of your user intents. Even if the wording is not exact, Watson should still understand it. You’ll know that it does when it responds with the name of the chatbot you just created. That means Watson understands that when a person asks a question like yours, the answer comes from the intent shown on the screen.

If you type information not associated with the chatbot’s training on the intents already entered, you’ll see your search query appear on the screen with an Enter Intent Name below it.

7. Get more specific with your intents

After that initial test, flesh out your user intents by adding several more. It’s also helpful to separate them by types of actions. For example, you might have user intents for greetings and gestures of thanks. A person buying a concert ticket might also want to see a calendar of upcoming events. In that case, you could have an intent group called Calendar that includes questions like “Can I see the calendar?” or “Do you have a calendar of events for August?”

8. Add entities

Next, leave the Intents screen by clicking on the left-pointing arrow in the left corner. Then, choose the Entities tab at the top of the screen. An entity is a segment of a user intent that could dictate the response the chatbot gives. Click the blue Add Entity button first.

Name your entity. In the concert ticket example, an entity could be called Venue, meaning the place a concert occurs. You can then choose Synonyms or Patterns from the drop-down menu. If adding synonyms, try including words like “arena,” “stadium,” “theater,” “campus,” “amphitheater” and so on.

Notice the Fuzzy Matching toggle button in the right corner, too. It’s a beta feature, but if turned on, should increase Watson’s ability to recognize misspelled words.

Once you include all the desired entries, click on the arrow in the left corner again to return to the main Entries screen. Select the System Entities tab at the top of the page. Then, make sure to activate the one applicable to your chatbot. In a concert ticket question scenario, they might include @sys-number, @sys-person, and @sys-date. There are explanations below each system entity for reference. After turning on the system entities, click the arrow in the upper left to return to the previous screen.

9. Write the dialog

Click the Dialog tab at the top of the page. Then, hit the blue Create Dialog button. You’ve now reached the most in-depth part of the process — programming the chatbot’s responses to what people ask. Even so, it’s not much harder than what you’ve done so far.

Here, we’ll focus on the introductory messaging for your chatbot. Let’s say you’ve already created a user intent group for greetings. Click on the Welcome node, then choose Add Node and enter something into the If Bot Recognizes field, such as “concert” or “ticket.” The If Bot Recognizes field is the condition.

In the following Then Respond With: section, type a chatbot response, such as “Hi, what can I help you with?” So, if a user types a question that includes the word in the If Bot Recognizes field, it generates the Then Respond With: Response.

Then, create more nodes based on expected user interactions. Right-click on the three dots icon to the right of a node and choose an option. Notice the Customize option in the right corner, too. Clicking it allows additional specifications than the main options.

The Slots option lets the chatbot handle multiple user interactions within one node. Turn it on by sliding the Toggle switch and click Apply. You’ll then see a new section that says Then Check For.

This is where you’ll enter conditions based on intents and entities already created. For example, if you’ve made a Find Concerts intent and a @sys-date entity, the bot will determine whether a person says something relating to both components, such as “Can you tell me which concerts are happening on September 12?

Click into the Check For field, then choose an entity option from the drop-down menu. The Save It As field next to it automatically populates with a suggested name, but you can change it if preferred. There’s an If Not Present, Ask box, too. In that field, enter what the chatbot should say if the person doesn’t ask a question about finding concerts (or a query related to your Intent/Entity combination).

After adding all necessary dialog, click the green Try It button in the upper right. You’ll then see a chat window that allows for interacting with the chatbot as a user would.

As you can see from these steps, creating a chatbot with IBM Watson is, for the most part, as easy as adding text to fields and tweaking a few things along the way.

If you’ve been wondering whether a chatbot would suit your needs, this user-friendly builder helps you find out without hiring a developer.

Recent Stories

Follow Us On

bg-pamplet-2