Dialog management – Bot Tutorials
In my latest article I discussed NLU’s and how they can be used to classify user input in more abstract concepts like intents and entities. This is of course just the first step in building a complex conversational bot. I’m afraid we need to go deeper. Let’s explore the magical world of dialogs.
A complex system can usually be decomposed into different layers of abstraction. Every layer uses the results of the previous layer and its results are used for the next layer. A good example of such a system is the OSI-model, although never completely adopted, still provides the basis on how we think about the internet.
So what’s next? After understanding what the user meant, the bot needs to select the correct reply. This reply is based on what was said and which knowledge the bot has. Depending on the complexity of the conversation this is no easy task. Managing this is done by the so-called Dialog Management (DM).
But how do you implement such a system? NLU tools like wit.ai, api.ai or LUIS provide some basic support, but they have their own flaws. You can try to implement your own system but you’ll soon discover this is not easy either. In this article I want to discuss the different ways dialog management can be done.
Let’s first talk about the basics. The primary function of dialog management is to find a response when the user says something. This can be a direct answer to a question, a question to the user for more information, stating that it doesn’t understand what the user just said or any other kind of response basically.
But there is more to it than that. Let’s discuss a few basic dialog problems that your bot might face.
Grounding is acknowledging to your user that you understood what he just said. This makes your bot feel involved and gives the feeling that it knows what’s it doing. When the user asks “Can you help me find a restaurant?”, your bot can ground that phrase by replying “Of course can I help you with finding a restaurant!”. Don’t do it after every phrase. Because it will become quite annoying.
As an extra grounding also helps the user to check your bot’s conclusions. If the user asks for a restaurant and you ground that with “looking for a flight”, then the user can correct you. If you didn’t ground then there is a chance your user will only find out your bots mistake at the end of the conversation.