Making Of #1 – Chatbots and Conversational Interfaces.

As smartphones and Internet access have become ubiquitous, text messaging and instant messaging have slowly replaced calling as the primary means of communication. Another technological revolution underway in the world is the extensive research and development in the field of Artificial Intelligence, the science of making machines think and speak like humans. If one combines these two disciplines, a chatbot is born. Simply put, a chatbot is an artificially intelligent entity that is capable of understanding human queries – written in natural language – and answering them. One can even think of Siri, Google Now and Cortana, the popular smartphone assistants, as chatbots that have a voice. They work on the same basic principles as a chatbot – the user asks a question, they process the question and then they try to return a relevant answer.

Over the last two months, I had the opportunity to develop a chatbot that parses encyclopedic documents and answers factual questions about them. As I was brainstorming about the design of the user interface for the chatbot, I started downloading many messaging apps to see how each one of them handled the flow of messages – between the sender and the receiver – and whether they had any specific design cues that made the experience more enjoyable. The process of designing the user interface for a chatbot is also much more thought-provoking compared to designing a mobile/web application. We can say that a chatbot has what we call, a “conversational interface”. Even Microsoft CEO Satya Nadella terms the concept of chatbots as “conversation as a platform”. After deliberating for a while, I narrowed down to the visual look of iMessage – with the blue and grey bubbles – with the added customisability of choosing the colour of the bubbles taken from Facebook Messenger. The final user interface ended up looking like this:


Using Apache Solr, a backend search engine, I was able to breathe life into my bot. Initially the chatbot answered questions by using simple “keyword hitting” and was, in human terms, “dumb”. In order to allow the chatbot to better understand human queries and make it smarter, I implemented 5 key features – stemming, stop-word removal, synonym expansion, part-of-speech (POS) tagging and named-entity recognition (NER). All of the mentioned features/add-ons were meant to not only make the chatbot smarter but also increase the relevancy of the provided answers. A description of each of the features is as follows:

  • Stemming: This features allows the chatbot to break words down to their stems. For example: “running” would be stemmed down to the word “run” and then matched with all the possible verb forms of the word “run” – that is, ran, will run, running, etc.

What the user types: Who played football on Sunday?  

What the chatbot perceives: Who (play, will play, plays, is playing) football on Sunday?

  • Stop-Word Removal: Primarily a feature meant to conserve memory and processing power during the indexing process, stop-word removal involves not indexing/searching for commonly occurring words such as “the”, “a”, “on” and “this”.

What the user types: Who played football on Sunday?  

What the chatbot perceives: Who played football on Sunday?

  • Synonym Expansion: Allows the chatbot to map multiple words to one word to widen the scope of queries made by users. For example, if the words football and soccer are mapped to each other, a query for “soccer” would pull search results for both “soccer” and “football”.

What the user types: Who played football on Sunday?  

What the chatbot perceives: Who played (football/soccer) on Sunday?

  • Part-of-Speech (POS) Tagging: A feature that breaks a sentence into words – tokens – and assigns each word a tag based on what part of speech the word is. For example, NNP denotes a proper noun and NN denotes a common noun. A complete list of POS tags can be found here.

What the user types: Who played football on Sunday?  

What the chatbot perceives: WP VBD NN IN NNP?

  • Named-Entity Recognition: A feature that enables the chatbot to find and recognise people, locations, date, time, names of organisations and currency values in a sentence.

What the user types: Who played football on Sunday?  

What the chatbot perceives: Who played football on [date]Sunday[/date]?

Why are Chatbots useful and why should a company invest in creating one for their business?

A chatbot eliminates the need to have many human experts answering customer queries by providing an automated question-answer mechanism that improves itself after every user query. It also provides a personalized conversation with each user, making the investment in the technology not only efficient in the long run, but also savvy. In addition to this, compared to human experts that are only available during specific hours to solve customer queries, a chatbot is available online no matter where you are or what time it is. An organisation can use chatbots in a variety of places such as:

  • Customer Service and FAQs: The “conversational interface” of the chatbot, alongside its ability to understand and answer questions posed in natural language, allows the chatbot to be a great replacement for a standard FAQ page. Its use also makes the application more interactive for the user increasing user-retention numbers for the application.
  • Supplementary Applications: Chatbots can be used to supplement existing applications by providing its users with an additional way to interact with the service that the parent company provides through its application. For example, Uber has a chatbot that allows users to book a ride from and to a specific location using Facebook Messenger. In the food industry, Domino’s has a chatbot that allows users to place an order for a pizza – the user sends his order to a chatbot and the chatbot understands and places the appropriate order.
  • To Eliminate Complex User Interfaces: A chatbot can be used to eliminate complex user interfaces that are crowded with many buttons and options. The chatbot understands what a user is looking for based on the user’s input, saving the user’s time and energy – the user doesn’t have to think about what each button in the application or on the webpage does. 

Chatbots are becoming very popular among businesses because of their ease of use and low maintenance infrastructure needed to set one up. Large companies such as Facebook and Microsoft are already leveraging their dominance in the cloud computing and text messaging to allow developers to create chatbots. Facebook is trying to push chatbots as an integral part of its Messenger application – developers and entrepreneurs can use the APIs provided by Facebook to create a chatbot that supplements their application/business. Faceboot calls chatbots Microsoft is also pushing chatbot integration into Skype.

Facebook Bot for KLM Dutch Airlines that allows passengers to get their boarding pass on Facebook Messenger.
Facebook Bot for KLM Dutch Airlines that allows passengers to get their boarding pass on Facebook Messenger.

In my opinion, in the long run, chatbots are going to become so ubiquitous that they’re going to become the primary way through which humans will interact with technology. Conversational interfaces are driving applications sales and allowing companies to better serve their customers. By using chatbots, a small-size software company can serve its users with the same amount of efficiency and accuracy as a large-size conglomerate. In a way, chatbots are going to level the application playing field and will make technology more focused on uniqueness and creativity and not scale and man-power. As artificial intelligence gains traction and becomes better, chatbots will become the new disruptive force that hold the power to either make or break a company. 

Okay Google, post this article to my blog.”

Subscribe to Just Ujjwal Blogs by clicking on here. Thank you for reading this article and I hope you have a great day ahead of you!