How to build a bot – in 10 minutes

By | 2 minute read | November 10, 2016

leadspace image for IoT at World of Watson 2016

At the World of Watson Developer Conference, Dan O’Connor, Senior Software Engineer for Watson Conversation Services took to the stage to teach the audience how to create a bot – in 10 minutes. Dan’s worked for Watson for over four years and knows the conversation service, among others really well.

Building conversational bots

Users want to ask questions in their own language, and have bots help them. A statement that sounds as straight-forward as “My login isn’t working! I haven’t been able to log into your on-line billing system” might sound straight forward to us, but to a bot, there’s a lot it needs to understand. Watson Conversation Services has learned from Wikipedia, and along with its deep learning techniques, it’s able to work out what the user is asking.

It does this by working on four core concepts:

  1. Intent – what does the user want to do (in the statement above – change a password)
  2. Entity – to what does the user want to do it (in the on-line billing system)
  3. Context – this is generated by the application and is a way of personalising the conversation based on what the system already knows about the user
  4. Dialog – this is how the system then responds to the user.

Specific intents, broad entities

It’s best to have very specific intents, so that you’re clear what your user wants to do, but to have broad entities – so that the intent can apply in many places. For example, changing a password is a common activity (a narrow intent), where you change your password might be many different places (broad entities). The context then personalises the conversation based on what it knows about the user, what they’re trying to achieve, and where they’re trying to do that.

Here’s a video where Dan takes you through how to build a conversation bot using the four core concepts:

Dan O’Connor shows how to build a bot – in 10 minutes

Dan uses an example of a text to speech bot that a user might operate within a car to turn windscreen wipers on and off, and lights on and off. The users’ natural language query is processed by the conversation service to work out the intent and the entity, and then using the context, replies through the dialog in a way that the user can understand.

Getting under the bot conversation hood

A basic SMS service is available via GitHub to start building a bot which uses IBM’s BlueMix platform which hosts the Watson Conversation Services. A developer can import a workspace to setup a new service. This starts with a blank dashboard where a developer can import all the tools needed to run the conversation service. The services has a dialog flow – a series of options with yes/no answers that the service uses to work out what the user’s intent is, what entity it’s working on, how to respond and how to phrase the response in the best way for the user.

The video goes into all the details of how to set a bot up and you can find out more on the Watson Developer Cloud Conversation page.