Adding intelligence to the chat bot

Adding intelligence to the chat bot

[This article gives a basic understanding on how the chat bot uses machine learning or the intelligence. Also it talks about how we can add more features which adds more intelligence to the bot.]

Today everyone wants to add a chat bot into their application. Some of the bots will do actions in the system like fetching few user specific data or updating them. And some of the bots will respond you some kind of predefined solution. We design them keeping customers in mind, how we can resolve end user's queries with less human effort. Giving these basic queries also, bot needs to understand what user is telling. Let's look at where and how the AI is coming into picture and how it can be improved more.

Understanding user input : The first basic thing required in the chat bot is understanding the statement provided by the user. To do that bot should understand the statement and classify into one of the trained intent. This involves language processing and classification algorithm. In technical words, each statement will be converted to a vector of numbers using a pre-trained word-vector and then classify into one of the domain specific intent. There are other NLP based pre-processing happens like noise word filter, tokenizer, lemetizer etc.

No alt text provided for this image

Extracting entities: To fulfill an intent, it requires parameter which are called entities. For example, if you want to order pizza, you need to tell which pizza and what size. Extracting entities in another algorithm used here. Most of the Natural Language Understanding(NLU) engine also uses few of the techniques like Regex, Synonym etc apart from regular machine learning algorithm.

No alt text provided for this image


Most of the bots which responds static predefined solution, may need above two algorithms. However you can also put information retrieval algorithm to fetch more relevant topic and corresponding text.

Prompts or Dialog : When user sends a query, user may not be aware of the number of parameter required for this intent. In such cases, chat bot should prompt user to fill some extra entities, and entity extraction logic should extract them and store in memory, they are called slots. Though it looks very simple, but in actual execution it adds lot of value, and user feeling the bot is intelligent enough to ask what it needs.

No alt text provided for this image


Context or memory : During the dialog exchange between user and the chat bot, you may expect the bot to remember few parameters. For example, you are asking the bot, which is the recent movie and in the next statement, you ask to book a ticket without specifying the name of the movie. It is very important to know what to remember and till how much. Most of the available NLU engine allows you to remember the slot/memory for specific number of queries or minutes. If you try to memorize for longer period, it will be difficult to switch to a new context, so it is important to forget also.

"As of now whatever has been discussed are basic features available in all the NLU engines."

What extra can be added in the bot as part of intelligence?

Auto-fill in chat bot : When a chat bot is implemented, chat window's text field is a mandatory part and you expect user to type. Typing is tedious work, is not it? I think so. You can have a prediction logic here to fill the next word, yes definitely AI (sequence model).

Auto-correction for spelling mistake : There are available libraries to auto correct the mistakes in specific language. You can also build small algorithms to remove extra characters. Or even if your entity list is fixed you can do soundex api check to find right entity.

Intelligent Greet : You can design intelligent greeting when a user says hello to the bot. You can provide some user specific suggestions based on last transactions. If it is movie ticket, you can give latest movie or upcoming booked ticket information. This could be a quick reference for the user.

Voice enabled : When you have already built a chat bot, you are just a step behind voice-enabled chat bot. Once you convert voice to text, rest all task is done by the existing chat bot. You may need a text to voice system, so your bot can also speak in stead of text.

Actions : Actions are the task used to do a transaction with the system, like booking a ticket or fetching latest movie ticket. There are a lot of use cases can be build behind the actions as you will have access to all the data. One of the basic use case would be to fetch any information from the system. One way is to have separate intent for each query and provide static text, other way is to implement information retrieval system and provide most appropriate and relevant information.

These small features adds lot of value to a chat bot. Please comment below if you have any more idea on adding more intelligence to a chat bot.

To view or add a comment, sign in

More articles by Bidyapati Pradhan

Others also viewed

Explore content categories