Since Facebook introduced chatbots to its messaging platform, there’s been widespread enthusiasm for bots that schedule flights, book hotel rooms or order Ubers for you — this in the same app that you use to chat with your friends.
Chatbots and AI have been around for a while (look at what China’s leading messaging app WeChat has accomplished) but the fact that Facebook chose to launch this feature recently could mean that this technology is finally mature enough for mainstream adoption, at least in the Western world.
My chance to create a chatbot
With things changing so fast in the tech scene and designers struggling to stay informed on the latest trends, I was delighted to see a hackathon for chatbots on Eventbrite. What better way to learn about chatbots and AI than to mingle with developers and build one? I immediately signed up.
In this article, I’d like to focus on the design aspects of chatbots.
Chatbot 101
If you haven’t played with a chatbot before, check out the ones on Product Hunt. They range from quirky bots that impersonate Donald Trump to more functional bots that diagnose medical symptoms.
To truly appreciate chatbots, you need to understand what makes them so powerful. Well, yes, they’re intelligent “artificially”, but what does that mean? Specifically, they have the ability to understand human language and context, and respond accordingly, which leads us to natural language processing.
Natural Language Processing (NLP)
Chatbots understand what we say by passing our text through an NLP engine, such as IBM Watson, which uses its gargantuan database to deduce the meaning of a sentence.
The point of NLP is not to interpret sentences word-for-word but to extract the intent behind the message. For example, someone asking, “Is it raining in London?” could have the same intent as “What is the weather like in London?” Treating both questions with the same intent, a bot would respond to the two questions with London’s weather conditions.
Keeping context is the bot’s ability to remember and combine intents across several sentences in a conversation. Let’s say the bot in the last example responded with “It’s sunny with a couple of light showers during the day.” If then you ask, “How many degrees?” the bot would assume the context of weather and output today’s temperature.
Introducing the Don’t-Worry-Mum bot
Our team decided to create a bot that would take care of mum’s nagging messages and keep her at bay — worry-free. Two developers would build the framework for the bot. Another designer and I would determine how it interacts with the world.
We used Facebook’s wit.ai to design and train our chatbot. A good alternative is Google’s api.ai, which we later found to have a more intuitive interface.
Designing the BOT
To ensure our bot was nag-proof, we considered interactions between a mother and her son, boiling them down to 12 major scenarios which you can see listed on the left panel as Stories.
The next step was to generate questions and answers for each of the 12 Stories. Questions were marked with an Intent and paired with a response from the bot. Remember that NLP does not interpret sentences word-for-word, so any questions with a similar meaning would also trigger the same response.
With that said, we were done! Well, not quite…
Training the BOT
The bot we set up was still an infant and wouldn’t be able to fend off requests from all the pesky mums out there. To turn it into a streetsmart, gangster teenage boy, we’d have to train it through machine learning. That meant throwing everything we had at it!
We decided to let our friends (and their mums!) test our bot, so we set up a nifty website containing a text input.Apologies: I’d post the link here, but unfortunately our developer had to take the site down to save resources.]
That night, we tested our bot with more than 30 subjects. The results were logged in wit.ai, and we reviewed them the next morning.
Whenever the bot was unsure of what to say (its confidence level drops below a certain threshold), it provided the default response and logged the uncomprehended message in the Inbox.
Training the bot was simply a matter of assigning Intents to the uncomprehended messages, a process wit.ai calls validation. Next time when the bots encounter a similar message, it will give the correct response. As you can see, machine learning is a matter of trial and error.
Just when you thought you’d covered all the use cases, new ones pop up from nowhere, and you’ll most likely have to create new categories for Stories and Intents. Stay positive — the more categories you cover, the more intelligent your bot will be.
Bots make mistakes too
We had the most fun watching people test our chatbot, which surprised them with some of the funniest mumbo jumbos. Nevertheless, most of our subjects were generous and persistent with befriending our nerdy comrade. (Read the following example from the bottom up.)
Alas, it seems that our bot was still not very good at predicting mum’s reactions. Can you honestly expect an infant to grow up overnight?!
Chatbots are challenging to get right
Overall, chatbots are fun to build but difficult to get right. The conversational interface inherently lacks constraints, making it difficult to predict user behavior. There’s also nothing stopping users from randomly abusing the bot.
One way to work around this is by limiting the options given to the user, through predefined menus and buttons. This approach provides the flexibility of freestyle text while keeping the conversation within bounds.
Reasons to learn about chatbots
Whether you believe in it or not, the chatbot hype is getting businesses’ attention. It shows brand forwardness and gets rid of human redundancies.
In addition, building chatbots is a quick way to learn about AI, a trend that is only getting stronger and more impactful. Google CEO Sundar Pichai wrote in a letter to shareholders of parent Alphabet Inc. last April, “We will move from mobile first to an AI first world”.
The conversational interface of chatbots is the most natural and reliable way we use to with interact with our friends. E-commerce sites like Amazon are favoring chat-based communication with customers over phone or email. As a UX designer, you’ll get far more insights from chat than other sources of data.
Conclusion
Chatbots have just raced off the starting blocks, and it will be a few more years before we know if they’re here to stay. As we leapfrog into the era of AI, we’ll probably see an increase in human-assisted chatbots with a gradual shift towards full automation.
Even so, now is a good time to learn about chatbots and AI. There are tons of examples out there for inspiration. Your best bet are bots on Messenger, Telegram, Slack, Product Hunt and WeChat.