Conversational context means knowing what a conversation is about by picking up cues from previous lines of dialogue or through environmental factors and humans have the ability to understand conversational context right from their childhood.
If you ask a child, “Candy?”, their reply will most probably be “Yes!”. The understanding of the child here is that you are offering them some candy and their choices for a response are either “Yes”, “No” or total silence.
However, if you ask a chatbot the same question, it wouldn’t know what to make out of it since chatbots do not have the innate ability to understand conversational context like humans do. So, in this article, we will discuss how you can add an understanding of the conversational context in Chatbots to make them more human-like.
The 6 Major Conversational Context Terms
As mentioned in this article by Voiceflow, there are 6 different terms that you need to understand in order to teach your chatbots conversational context:
- Dialog Context: Dialog Context refers to keeping an in-memory record of a conversation flow as it progresses through its dialog turns. It helps in keeping the momentum of a conversation moving forward.
- Context Switching: Context Switching refers to switching from one context to another during a conversation. With proper context switching, chatbots can talk freely to a human in a fluid and reciprocating manner.
- Prime Contexts: Prime Contexts are major contexts in a conversation even when the past context was widely different. For example, responding correctly as a chatbot when someone asks for an ambulance is crucial despite whatever the previous conversations were happening.
- Contextual Intents: Contextual Intents help to define the intent of a conversational context. For example, if you ask, “Can you help me?” when looking for an ATM, the contextual intent is that you want the other person to give you directions to the nearest ATM.
- Overfilled Slot Context: An overfilled slot context helps your chatbot to remember redundant information that is outside the main context of the conversation. For example, when ordering a coffee, the chatbot may store your name along with your order so that it can ping you later on with your name.
- Environmental Context: Environmental Context provides context regarding the environmental factors during a conversation. For example, if a store is already closed, a chatbot should respond to its communicator that the store is closed if the person wants to buy something. However, if the person just wants information, it should keep the conversation going on.
These six major conversational context terms define most of the things you have to think about when building a human-like chatbot.
Introducing Conversational Context in Chatbots using Recurrent Neural Networks
The state-of-the-art (SOTA) method of introducing conversational context in your chatbots is by using a specific type of neural network architecture called the Recurrent Neural Networks.
Recurrent Neural Networks architectures have the ability to use bi-directional LSTM (Long Short Term Memory) networks that store dialog context in a very efficient way. This means they can keep an in-memory record of a conversation flow as it progresses through its dialog turns and also, take notice of contextual intent.
You can also use multi-head attention and transformers RNN model architectures to process conversational context about multiple contexts in a dialogue flow. This helps the chatbot to handle both context switching as well as to focus on the prime context of a conversation.
Also, a simple approach to handle overfilled slot content and environmental context are to use simple rule-based triggers that allow the chatbot to perform as needed in various environments and overfilled slot content requirements.
You now have an intuition about what is conversational context and how to use it for building human-like chatbots through recurrent neural networks. If you have any questions, please feel free to write to us in the comments and we will get back to you.
Do you want to learn Python, Data Science, and Machine Learning while getting certified? Here are some best selling Datacamp courses that we recommend you enroll in:
- Introduction to Python (Free Course) - 1,000,000+ students already enrolled!
- Introduction to Data Science in Python- 400,000+ students already enrolled!
- Introduction to TensorFlow for Deep Learning with Python - 90,000+ students already enrolled!
- Data Science and Machine Learning Bootcamp with R - 70,000+ students already enrolled!