Chatbot — An untold story

Muhammad Danish Farooq
Virtual Force Inc.
Published in
6 min readAug 3, 2022
Fig.1 “Chatbot helping user in ordering pizza” (Source)

This blog post is part I of our series of blogs for chatbot technology. It’s a good starting point for anyone to grasp better understanding of chatbots. Next articles will not only cover chatbot working & usage but advancement in the field as well so stay tuned and enjoy this wonderful application of AI.

What is a Chatbot?

A chatbot is basically a combined form of two separate words chat and robot. Its other names include, chatter bot, artificial conversational entity, talk bot and chatterbox.Therefore a very basic definition of a chatbot is that it is an artificial intelligence (AI) based computer software that imitates the human speech and text with the ability to understand a human way of conversation, enabling humans to communicate with machines and devices in a more natural and real way.

A chatbot is primarily used for instant messaging replies and customer management especially when the human representative is not available to provide services to the customers. But a chatbot can vary from a simple query answering to a complex and sophisticated one, being enabled to work as a virtual assistant handling multiple tasks depending upon the usage and requirements.

History of Chatbots

When Alan Turing’s in the 1950s described intelligent machines’ concept, the chatbot actually originated. But the first ever chatbot was created in 1966 at the MIT Artificial Intelligence Laboratory by Joseph Weizenbaum. It was named as “ELIZA”.It was the simplest chatbot that took input and matched the pattern of input to provide suitable output but it was unable to learn from this process. With the advancement of artificial intelligence, chatbots also evolved according to the need and demand. With the passage of time, Chatbots were developed for engaging customers in conversation on their own and they also learnt in this process.

As the Machine learning field grew, Chatbots developed very rapidly and nowadays it has become a necessity especially of every business. Many popular chatbot examples include Apple’s SIRI, Google assistant, Facebook messenger bot etc. According to a survey, USA is on the top among the top five countries in terms of chatbot usage. Other four are India, UK, Brazil and Germany.

A survey shows that currently there are approximately 1.4 billion users of chatbots in the world.

Fig 2. “History and evolution of Chatbot” (Source)

How do chatbots work?

Working of chatbots depends broadly on how they are designed. The main function of a chatbot is “Answering” after “Understanding” what is being asked. For this purpose, the general workflow of chatbot goes like this:

Fig 3. Workflow of a chatbot (Source)

Every chatbot needs an input (in any form) and after matching the input to its stored data, it sends the best possible output to the user. This is a general and conventional workflow of a chatbot. Usually when a user enters any phrase, the relevant intent gets triggered and a response from the response section of that intent is sent to the user.

Types of Chatbots

Based on the working method, chatbots can be categorized into three main following categories and their uses are dependent on the need and objectives.

Fig 4. Types of chatbots (Source)
  1. Menu/ Button based ChatBot

A button bot is the simplest and conventional form of chatbot that does not allow any user input and offers only button inputs. It follows a strict roadmap and does not provide any facility to ask something out of the way. It looks like a survey form, but with its simple working it obtains all the information required from the user and then helps, guide & act as per the info provided. This method is one of the quickest and simplest ways for constructing a chatbot as well as its execution during conversation as well.

Fig 5. Menu-driven/ Button based chatbot (Source)

2. Keyword Rules based Chatbot

It is an AI based chatbot that follows keywords ruling and applies machine learning. It works on natural language processing (NLP). It matches keywords and responds accordingly.

Fig 6. Keyword-based chatbot (Source)

3. Intent Based/Contextual Chatbot

It works by combining Natural language processing (NLP) and Natural language understanding (NLU). It understands the input (i.e. voice or text ) of the user and triggers matching intent to respond. It can understand and learn synonyms as well as talking patterns too. It has the capabilities to extract emotions, required intents, entities, multilingual & multi-channel conversation, learn with changing environment i.e. context and much more.

Fig 7. Contextual chatbot taking intents and context from conversation (Source)

Building Blocks of a Chatbot

Basic building blocks of any contextual chatbot that are specifically needed to construct a smart bot are following:

  1. Intents
  2. Entities
  3. Context

1. Intents

Intents are thought to be the user intentions that are predefined or presumed phrases/questions usually provided to an AI chatbot as user phrases and in response to those questions, some phrases are also provided as responses. Whenever a user asks a question provided to the bot or similar to it, the bot triggers the relevant intent and sends output from the predefined responses.

Fig 9. Some Intents in Dialogflow (Medium)
Fig 10. Contents of an Intent in dialog flow (Medium)

2. Entities

Entities are specific knowledge repositories that a bot uses to identify the user’s intention or goals from the provided data by the user. These are helpful in providing more personalized and accurate information to the user. It is also helpful in taking out the information from user input, for example date, time, names, email address, home address etc. Entities are usually provided by system and called system entities but to construct a customized chatbot user can make his own entities too according to the requirements.

Fig 11. Chatbot system identifying entity from user phrases (Medium)

3. Context

Context is actually a reference of the current conversation to the past route of conversation. It tells about the flow of the conversation and can help with generating meaningful responses with some background knowledge. Context is especially good when gathering information in a flow is necessary in order to fully understand the customer requirement. A context is of two types:

  1. Input Context
  2. Output Context

When we create a flow of conversation, the output context of one intent becomes the input context of its following intent and so on. An output context can be used as input context of more than one intent. In the following Fig. 12, there is output context for the intent “Doctor Appointment” and in Fig. 13, the same output context has changed into input context of its following intent “Doctor Appointment-Date and Time”

Fig 12. Output context (Medium)
Fig 13. Input Context (Medium)

Summary

Chatbots are revolutionizing the concept of customer management in almost every industry. Chatbots are becoming a necessity for every kind of business and have great advantages over traditional ways of dealing with the customers specifically. This article focused on the basic concepts of the chatbot to have a basic understanding for beginners and chatbot is much more than this. Different types of chatbots are helpful in different use cases and industries depending on the requirements. But the basic elements of all chatbots are almost the same, just the working rules are different.

If you like to enjoy & explore the power of chatbot equipped with modern advancement in the area of NLP, visit replika.ai.

--

--