If you’ve used Siri, Alexa or the Google Assistant you’re already familiar with how a chatbot works. It’s a piece of software that lets you interact with your computer by having a conversation with it. At least, it tries to have a conversation with you. Historically chatbots have been rather clunky and not all that useful.
Now things have changed considerably. We use our voice assistants all the time and they almost always understand what we mean. Log on to virtually any commercial site and the little messaging app that pops up probably doesn’t have a real person behind it, offering to help you.
Chatbots are revolutionizing the way we use computers, but modern chatbots are complex to code and laborious to train. Which is why we now have plenty of companies offering chatbot builders to make the process (relatively) easy.
The leader in the AI technology running the world’s best chatbots, IBM, actually offers a chatbot building tool you can try for free. It’s called IBM Watson Assistant and lets anyone leverage one of the foremost AI systems in existence.
You may have heard of Watson before, specifically when it beat human opponents in games of Jeopardy! It’s not just a toy either, you can build a viable chatbot using their technology and then integrate it with your own business or personal use cases.
The free account allows for up to 10,000 API calls to Watson Assistant per month. For most personal users this will be more than enough. It’s certainly enough for what we’ll be doing here!
Breaking It Down to the Basics
Before we get into the nuts and bolts of building a chatbot with Watson Assistant, let’s talk about what we want to achieve.
The basic purpose of a chatbot is to interpret what the user is saying and then figure out what to do about it. In Watson Assistant there’s something called an intent which is basically the action that the user wants to achieve.
For example, someone’s intent may be to find out if you have stock of a particular item. In which case Watson Assistant could be integrated with your database and then pull the exact stock levels from there.
Intents are performed upon entities, which contain the relevant information Watson will use to reply.
When building your chatbot you go through a loop of three steps:
- Creating intents and entities
- Building the dialog tree
- Trying out your chatbot!
In this guide we’ll be going through one iteration of this loop, to show you the core building block of a Watson chatbot.
The first thing you’ll want to do is head over to the Watson Assistant page and sign up. We used the free “Lite” package which lets you build any chatbot you want without obligation. Just click Get Started for Free and follow the instructions.
Once you’ve done all the digital paperwork, you’ll end up on the Introducing IBM Watson Assistant page. Now click Create a Workspace.
Now click Create.
Now just name your workspace and add a description.
Before we add our custom intent, the first thing you should do is add some common intents that IBM has already prepared for us. This saves you from having to teach your bot basic conversation stuff from scratch every time.
To do this, under Intents click on Content Catalogue and then click Add to Workspace next to the General category.
The bot now has the ability to understand general dialog, such as greetings. To see how this works, click on the Dialog tab and then click Create Dialog. Two conversation nodes will be automatically generated – Welcome and Anything else.
Click on Welcome to expand it.
Here you can see the basic structure of the dialog node. If the bot recognizes a certain condition (such as an intent) then it will respond in the way you define.
While we didn’t create a custom intent in this case, let’s head over to the Intents tab and have a look at the intent called #General_Greetings. Just click on #General_Greetings in the list of intents to open it.
This is exactly how you would make your own intent. Give it a name, give it a description and add as many ways as you can think of that the user would indicate this intent. Here IBM has already done the work for us, but it’s perfectly clear how it works. You can also modify this existing intent by adding more examples. Perhaps in your own local dialect.
We are going to use this intent as part of our chatbot’s dialog, so head back to the dialog tab and click Create Dialog. Our custom dialog is going to happen between the Welcome and Anything else nodes. All you have to do, is click Add node.
We are going to call this node Friendly Greetings and are going to use the #General_Greetings intent to power it. So under If bot recognizes just type the name of the intent and choose it from the dropdown menu.
Now we leave our response as “text” and write what we want the bot to say in response to our greeting.
You can close the dialog node by clicking on the X button. Now we should have a bot that can respond to a basic greeting. Click the Try It button at the top right of the page to test the bot we’ve built so far. Type Hello in the chat bar that pops up and see what happens.
Wow! Watson recognizes our intent is to greet it and then uses the rules we specified in the dialog builder to respond. Congratulations, you’ve just gone through one full cycle of building a chatbot!
While you could build a pretty awesome chatbot using this basic loop of steps, there is of course much more to Watson Assistant than this. Using all the features of this tool you could build a bot that takes care of bookings or gives the user a list of products that are in stock.
The sky’s the limit and you don’t have to be some highly-technical genius to get going. IBM has plenty of tutorial videos and documents to turn you into a chatbot master. Now that you’ve had a taste, nothing should hold you back!