Sairam Rathod
11 min readMay 27, 2021


What Is Chatbot?

A chatbot is a software application used to conduct an online chat conversation via text or text-to-speech instead of providing direct contact with a live human agent. A chatbot is a type of software that can automate conversations and interact with people through messaging platforms. Designed to convincingly simulate the way a human would behave as a conversational partner, chatbot systems typically require continuous tuning and testing, and many in production remain unable to adequately converse or pass the industry standard Turing test

Chatbots are used in dialogue systems for various purposes including customer service, request routing, or information gathering. While some chatbot applications use extensive word-classification processes, natural language processors, and sophisticated AI, others simply scan for general keywords and generate responses using common phrases obtained from an associated library or database.

Most chatbots are accessed online via website popups or through virtual assistants. They can be classified into usage categories that include: commerce (e-commerce via chat), education, entertainment, finance, health, news, and productivity.

Types of Chatbots

Mainly, chatbots are classified into three types: Rule-Based, AI-Based and Hybrid.

  1. Rule-Based Chatbot: It is also known as Decision treebots. It has a set of predefined responses from a database for a particular query based on the keywords uttered in the query. So it can be tedious to extract a very lengthy and informative response from the bot. It is just like a decision tree. It gives a response based on the keywords extracted from the user’s utterance. Most of them don’t use NLP/NLU. The advantage of using this type of is that it is economic.
  2. AI-Based Chatbot: They are built using ML, NLP/NLU. It also provides answers from a given database but the thing that makes it unique is that it becomes more intelligent over time with the help of past interactions with the users.
  3. Hybrid Chatbot: These are the most common type of chatbot. It is basically a mix of both Rule-based and AI-based chatbots. They interact with humans and provide a personalized reply i.e It can start the conversation with the user but when the conversation gets deeper chatbot can be replaced by a human being.


  1. Natural language processing (NLP) :

A chatbot can answer users queries in natural language which is made possible by using an artificial intelligence term natural language processing or NLP. Natural language processing gives the machine the ability to ingest the given input, break it down, extract its meaning, determining appropriate action and answering user in their natural language. Natural language processing (NLP) has two subsets Natural language understanding (NLU) and natural language generation (NLG). NLU takes unstructured data as input and converts it into structured data so the machine can understand and act upon it. NLU focuses on extracting the meaning from user input query. Natural language generation (NLG) simply converts the answer generated by a chatbot in structured data to human-understandable natural language.

Natural language processing (NLP) does processing in 5 steps. The unstructured data is first passed for lexical analysis. The structure of words is analyzed and identified. The whole input text is divided into tokens. Then the tokens are passed to syntax analysis where tokens are analyzed for grammar and arranged in a way in which relations among the word is easy to understand. Then the input is passed to semantic analysis. The meaning of words or tokens is extracted in this step. Object in task domain and mapping syntactic structure are responsible for meaning extraction from the input. The next step is discourse integration where the meaning of a sentence is tried to extracted using the previous sentence meaning. The final step is pragmatic analysis. In this analysis, the main emphasis is on what was said is reinterpreted on what does it actually meant. After all these steps the meaning of a sentence is known to the machine and it finds the answer to the user query and passes it to Natural language generation (NLG) for the generation of the final output. Natural language processing (NLP) is used in many chatbots for effective communication with humans.

Understanding Language

2.Pattern Matching Algorithm:-

Pattern matching was one of the most used algorithms in chatbots Pattern Matching Algorithm contains questions and answers stored in a database. Questions are named as patterns whereas answers are named as templates. The answer for the particular question consists of Artificial Intelligent Mark-up Language (AIML) tags. Patterns and templates are stored in the form of a tree. Questions are on the branches and answers are at the nodes so whenever the question is asked by the user first that question is searched for an answer word by word, then it fetches the particular answer from the node.

This type of structure is used in the ALICE chatbots. The advantage of this algorithm is that user can easily get an answer to the questions it’s already stored. And thus it is widely used because of its complexity. This algorithm stores only particular types of questions and thus if any question other than the stored is asked by the user it would not be able to answer. And thus, it lacks self-learning capability.

AIML Structure

3.Naive Bayes Algorithm:-

Naïve Bayes is another efficient algorithm used for a chatbot. In this algorithm, the first step is tokenization and then stemming. In tokenization, the whole sentence is divided into words called tokens. Then each token is stemmed. For example ‘have a great day is tokenized and stemmed as ‘have’, ’a’, ’great’, ’day’. The next step is to give training data. This data is stored in the form of a list of dictionaries where the dictionary has class and sentence as attributes. For example, for the above sentence class will be ‘greeting’. Then the data is organized by making the list of words of each class. When we give the input sentence it checks for each word and compares it with all the tokens then it predicts which class has the possibility of having the input sentence. There can be 2 or more predicted classes for each sentence we give as input so the score is also calculated for each class. Then from those 2 or more classes 1 with the highest score is selected. In this way, this algorithm works.

Let’s see in the above example, suppose we give more training data as-’Have a great day, ‘Good morning’, ’Hello there, ’is the weather rainy?’,’ it is too cold today. Suppose we give the input as ‘Hii, good morning’.

Training data set:-

class: greeting

‘Have a great day

‘Good morning’

‘Hello there’

class: weather

‘is the weather rainy?’

‘it is too cold today

Input:-’Hii, good morning’

term:-Hii (no match)


term:-morning(1 match, class : greeting).

Hence, the output will be classifier: Greeting and score:2

The advantage of this algorithm is that if there are predefined classes it becomes easy to predict. But in case if the data given as input does not belong to any predefined class it becomes impossible to predict the output sentence. Hence because of this disadvantage, it has limited usage.

Interesting Chatbots in the World

1. DoNotPay

Are you wrongly accused of a crime but cannot afford a lawyer? This happens to many people and they are not able to understand their rights or adequately represent their case in court. That’s where DoNotPay can help people! This chatbot is the world’s First Robot Lawyer and it is specially created for people who cannot afford lawyers or don’t understand the law. DoNotPay is still basic as compared to a real lawyer but it can help you to appeal parking tickets, obtain airline compensation for delayed flights, use anyone in a small claims court, etc. DoNotPay is quite successful as a chatbot in empowering its users to settle legal matters easily without hiring any lawyers and also learn about their rights as citizens.

2. Replika

Do you wish you had a friend who you could talk to about anything? A friend that would support you and help you whenever you needed help? You can get such a friend in Replika, a friend that is there for you 24/7! Replika is a Machine Learning chatbot that is programmed to be your friend and help you whenever you need it.

3. U-Report

Do you want to make a difference in the world? Do you want to help your policymakers in making decisions that benefit everyone in your country? You may be able to do this using U-Report, a chatbot created by the United Nations Children’s Fund (UNICEF). U-Report gathers information from young people about the problems in their country such as unemployment, racial discrimination, poverty, child marriage, etc. Then it collects this data and creates insights that are shared with the country’s government and policymakers so that they can work on eradicating these problems. U-Report has also created a COVID-19 chatbot that allows people to get more information and a transparent picture of COVID-19. The U-Report chatbot is currently active in 60 countries and is used by around 8 million users all over the world!

4. Endurance

Have you heard of Alzheimer’s disease? It is a form of dementia that causes memory loss and destroys other brain functions as well. This is where Endurance comes into play! It is a chatbot that aims to identify whenever short term memory loss occurs in Alzheimer’s disease patients by monitoring abrupt changes in conversations. Endurance is a cloud-based, Natural Language Processing chatbot that also helps doctors identify whenever memory loss occurs. All the chat communication logs are stored on the cloud, which means that physicians can access them to see irregular communication breaks, abrupt changes in chat topics, etc. that may signify short term memory loss.

advantages of Chatbots

Now let’s check out the advantages of Chatbots!

1. Chatbots have 24/7 Availability: Chatbots can be available to solve customer problems 24/7 whether it is day or night! They don’t need to sleep after all! This is much more difficult to achieve using human customer service as it would require rotating teams that would be more complicated to manage as well. This means that chatbots can answer customer queries whenever customers have queries which help in increasing customer loyalty.

2. Chatbots can gather Customer Insights: Companies thrive on customer data! The more data they have, the better they can cater to their customers and be much more successful. That’s where chatbots can be a big help. Whenever you interact with any chatbots on a company page, you provide basic data such as user preferences, buying habits, sentiments, etc. which can then be analyzed to understand market trends, operational risks, etc. And using this information, the company can solve customer issues much easier and create targeted products. This will help in increasing their customer loyalty!

disadvantages of Chatbots

Now let’s check out the disadvantages of Chatbots!

1. Chatbots sound too Mechanical: Chatbots are not human and so obviously they cannot interact as a human with customers. They sound too mechanical and can only give answers to problems that they have been programmed with. They cannot answer a customer according to the context and they cannot show any emotions if needed. Chatbots also cannot maintain a natural-sounding conversation in-depth with customers and that is why they are only useful in solving basic queries. But this can create a disconnect with customers who prefer the human approach when solving their problems.

2. Chatbots can only handle basic Questions: Chatbots are still a basic Artificial Intelligence technology and so they can only answer the basic questions of customers and provide general information that is already available to them. They cannot solve complicated queries or answer out of script questions and companies need to have human customer service employees that can manage these for them. However, this is changing with time and currently, more and more advanced chatbots are entering the market.


1.Health Care

Chatbots have also made their way into health care by easing the burden on medical professionals by facilitating faster medical diagnosis, answering health-related questions, booking appointments and lots more. A Chatbot like Super Izzy can track menstrual cycles, dates and fertile windows. The bot also asks menstruation-related questions and learns to give information about menstrual health.


Uber in partnership with Facebook has enabled users to sign up for Uber and request a ride, without having to leave Messenger or download the Uber app. Ride status updates and ride receipts are delivered to a private conversation between the customers and Uber on Messenger, making it easy to track Uber rides and payment history.

3.Market Research

The way market researchers get in touch with respondents is changing as many respondents may prefer to be contacted on WhatsApp or the Facebook messenger. Instead of having a dedicated survey app, many research firms are developing Chatbots to have personalized, engaging conversational surveys with respondents to improve the experience and increase completion rates.


The e-commerce industry is also improving shopping experience with Chatbots. Customers can now search and shop more conveniently with the help of chatbots. eBay has invested in Chatbot technology with their ShopBot, a virtual shopping assistant that helps customers find the items they want at the desired price range.

5.Book Flights

Airlines are also applying chatbots to their business operations, for instance, Icelandair’s chatbot gives their customers the ability to search for and book flights in a text-based conversational manner


From my perspective, chatbots or smart assistants with artificial intelligence are dramatically changing businesses. There is a wide range of chatbot building platforms that are available for various enterprises, such as e-commerce, retail, banking, leisure, travel, healthcare, and so on.

Chatbots can reach out to a large audience on messaging apps and be more effective than humans. They may develop into a capable information-gathering tool in the near future.

Authors: Sairam Rathod, Shashank Joshi, Neha Sagar, Prerna Shinde.

Guide: Prof.(DR.) Patil Shrishailappa Tatyasaheb

We hope you found this blog interesting, feel free to drop your queries in the comments below. Stay tuned for more!