It’s been roughly two years now since we started working on our first chatbot in U-Hopper. It was called Talk2Fiesta and was developed as part of the FiestaIoT EU project: it was meant to offer an alternative way of accessing environmental information (among the others temperature, humidity and wind) regarding the city of Santander, Spain.
Since then, we developed various other bots. The ones I most enjoyed working on were TalkingCity, a bot for discovering social events in the city of Aarhus, and AchiBot, a bot the we use internally in U-Hopper for monitoring and sharing with the colleagues the achievements that were reached week by week.
I can safely say that we are getting pretty good at building bots, but as our knowledge about them increases in time I still incur in doubts and questions when I talk about them with other people. What is a chabot? Is it really a computer the one answering my messages? How can it do that? So, here’s a few pieces of information that may help you understanding what a chatbot is and how it works.
What’s a chatbot?
A chatbot is a piece of software that has been designed to simulate conversations with humans. Simulate is the important concept to remember: the objective of a bot is not to mimic the way exact communication characteristics of a human-to-human discussion (either textual or spoken). It is simply not possible with the current technology and it would lead to unrealistic experiences for the users.
A chatbot can actually do much more than just writing textual messages and sending around audio responses. It can take advantage of a variety of graphical interfaces and widgets allowing to enrich and improve the way information is provided and interpreted. It can also provide precompiled answers and actionable buttons that are actually eliminating the need for users to type messages: if among the provided options there is the desired one, why not just click on it instead of writing something from scratch? It is going to be much faster and simpler.
But how can chatbots understand the meaning of an incoming message?
This is the questions that most often needs an answer. Well, there are various approaches allowing to actually teach a software to understand the content of a message but they all have a common objective. They all aim at identifying an intent and a set of entities.
The intent represents the purpose of the user message. A dedicated intent needs to be defined for each type of question that the chatbot should support. Entities represents particular terms that are relevant for a specific intent and that provide a context to the message.
Let’s say that our hypothetical chatbot receives the following message: What is the current temperature in Trento today? . As anticipated, in order to be able to correctly answer to the question, our bot should be able to extract an intent and any relevant entities that are going to add some contextual information to the message. In this case, the purpose of the user is getting information about the temperature (intent) in the city of Trento (entity giving some context about the place of interest) today (entity giving some context about the period of interest).
There are various strategies allowing to perform intent and entity extraction.
The simplest one is to look for specific words that can be univocally associated to a specific intent or entity. This can be a smart approach when building a first prototype. But the bigger and more complex the bot becomes the more difficult it is going to be handling the never ending list of known words to look for (think about plural and irregular forms).
A smarter way of extracting intents and entities is taking advantage of NLP – natural language process services. There are various alternatives out there allowing to apply NLP analysis to both textual and audio messages. Facebook also offers an integrated support if you are taking advantage of its platform. The chosen service can be easily trained by providing a few example messages for each intent and by providing instruction about the relevant entities.
Now you know all the basics of chatbots. Be sure to get in contact with us if you want to know more or would like to start a collaboration on a chatbot-related project. In the mean time, don’t forget to checkout the Three lessons we learned while developing the TalkingCity chatbot.