How do chatbots work?

Konstantin Sadekov
June 7th, 2021

Read more
how do chatbots work

How do chatbots work and what is the technology behind them? How are chatbots made? What are the technological advances that make modern chatbots such a valuable addition to the workforce? 

In this article, we’ll take a look at

  • Natural Language Processing

  • Natural Language Understanding

  • Solution Flow Management

  • Natural Language Generation

Chatbots have come a long way in just a few years. While the first versions could be clunky and unnatural to converse with, today’s AI-enhanced chatbots offer valuable support to customer service teams. By improving response times, automating routine processes, and handling queries, chatbots enable agents to focus on complex, high added value cases that require a human touch. But not only: chatbots can also help qualify leads, support HR staff in recruitments and streamline operations in sectors as diverse as healthcare, finance and online and offline retail. According to recent research, chatbots could be saving businesses up to $8 billion by 2022.

So let’s find out how do chatbots work.

All about NLP, or natural language processing

Not all chatbots are made equal. Some types of chatbots, e.g. rule-based chatbots, depend on pre-programmed answers that they will offer in response to given keywords. More sophisticated AI-enhanced chatbots use Natural Language Processing (or NLP) to read, interpret, understand and respond to human speech.

NLP is a branch of artificial intelligence and machine learning that explores the way machines analyze and interpret human language, to provide context-based responses and improve their performance over time. It’s behind many of the NLP applications we use on a day-to-day basis, such as automatic translation, autocorrect, predictive typing, and virtual assistants such as Siri and Alexa. 

There are more than 7 billion people on the planet, and the millions of conversations they have per day generate huge volumes of text-heavy, unstructured but potentially valuable data. By bringing together computer science, linguistics, cognitive science, and data science, NLP facilitates human-to-machine communication by allowing machines to obtain and process that data.  

How do chatbots work with regards to NLP? There are three main building blocks involved in building a chatbot, two of which are NLP subsets. Let’s take a closer look.

How do chatbots use natural language understanding?

We humans can usually understand each other even when the sentences we write or pronounce aren’t grammatically perfect. Unfortunately, the same can’t usually be said for machines, which can be easily floored by misspellings, mispronunciations, or contractions, not to speak of colloquialisms. How do chatbots work when it comes to understanding typos, hurriedly-typed out requests and just generally finding out what it is a user means to say? 

This is where NLU comes in. Natural language understanding is a deep and complex subject that has been fascinating researchers for several decades – the first known attempt at a NLU program dates back to 1965. Specific examples of NLU include machine translation, automatic routing of customer service tickets, and automated reasoning, i.e the ability to make logical inferences based on previous examples. Basically, NLU is what enables us to be understood by machines, without having to type code into our smartphones (and if you’re wondering what the difference is between NLP and NLU, the answer is simple: Natural Language Understanding is a subset of NLP).

nlp and nlu
Source:https://nlp.stanford.edu/~wcmac/papers/20140716-UNLU.pdf

Most NLU systems are based on three main aspects:

  1. Syntactic parsing, i.e syntactic analysis of a sentence in order to identify the function of each word and how they relate to each other.
  2. Semantic parsing, in which the meaning of words are identified independently of their context.
  3. Contextual interpretation, which removes any remaining ambiguities.

Various machine learning classifiers and other techniques are used to achieve the above. In a nutshell, Natural Language Understanding is what enables chatbots to gauge intent and convert it into structured data that a machine can understand, thus going beyond simple keyword recognition.

Solution flow management and chatbots

But once the chatbot has correctly interpreted what the user is looking for, how does it know how to select the correct reply? The answer will be based both on the question and the bot’s knowledge using solution flow management, or SFM.

solution flow management

Solution flow refers to the process of managing and implementing a conversation, with the main aim of finding a relevant answer or response to a user question. In some cases (“What’s the temperature today in Sarasota, Florida?”), this can be relatively simple. However, us humans aren’t always that clear when we express ourselves, in which case the conversational flow will be more complex. 

Let’s take the example of a user who poses the question “Where’s a great place to eat?”. Here are some dialog principles the chatbot would have to take into account:

  • Grounding: the chatbot has to ensure that both the user and the bot are on the same page. It could do this by replying “Great! Let’s find you a nice restaurant”.
  • Slot filling: the chatbot may need to request more information in order to provide a relevant answer, such as “Where are you located?” or “What would you like to eat?”.
  • Context: the bot will need to save and refer back to all sorts of different information throughout the conversation. The context may change in the middle of the conversation (i.e, the user suddenly decides they would rather see a movie rather than go out to eat). This is known as “context switching”.
  • Initiative: the person posing the question is usually the one who has the initiative in a conversation. The bot can either follow or take over the initiative. In mixed-initiative, the initiative switches between both parties.
illegal adds

It is very important that every solution flow has an owner who provides the most up to date information about the service the customer is asking about. It can be an expert in the field, or a product owner that knows everything about the service. Sometimes it might happen that service conditions are changed just overnight, and your customers should get correct information from the chatbot.

Besides, having a product owner in charge of the solution flow management helps the person to understand what the most common questions are that the clients ask. This allows the product owner to adjust the manuals and improve the quality of the provided information, which at the end might decrease the number of unnecessary contacts.

Where natural language generation (NLG) comes in

So far, we’ve found out what enables chatbots to understand and interpret language, as well as how they process information and create conversation flows that feel natural and deliver relevant information. But how do chatbots work to produce text and speech that’s comprehensible to humans?

NLG or Natural Language Generation is another subset of NLP. Its purpose is to transform structured data into natural language, i.e text that us humans can easily read and understand. NLG can be understood as the opposite of Natural Language Understanding: while the latter makes human speech or writing understandable to machines, NLG converts data back into plain English (or any other language). When it comes to chatbots, both NLP subsets are necessary in order to produce a smooth and coherent conversation.

In summary

Today’s AI-powered chatbots are a far cry from the clunky, unnatural versions of just a few years ago. But behind the bots that help you book cheap flights, select the best candidates for your latest recruitment drive or tell you how to make your office more energy-efficient, there’s some very sophisticated technology at work. MindTitan builds machine learning-based chatbot software built on NLU, and solution flow management to go beyond simple command flows to provide true added value for your business. Get in touch with us to find out more.

Do you want to implement a chatbot?

Do you want to implement a chatbot?

Kristjan Jansons
Co-founder, CEO

Kristjan has helped various companies from Japan, Saudi Arabia, and Switzerland to implement the latest AI solutions. Having a strong technological background and understanding of the business processes helps him to understand specific business needs and offer necessary AI solutions for matching these goals.

Contact us

Do you want to implement a chatbot?

Do you want to implement a chatbot?
kristjan jansons
bot

Chatbot: The Ultimate Overview

Read the full overview of the chatbot, and learn everything from A to Z before you implement one in your business.

Chatbot
Go back