fbpx

Handling Multiple Questions in Dialogflow

Chatbot Marketing

Waterfall - Water

Utilising NLP platforms like Dialogflow to create conversational chatbots is a great way to provide your customers with quick and easy answers without having to resort to a human customer service agent. But like all new cutting-edge technologies, they all have their limits and rough edges. One example of this with Dialogflow is that it can only process one intent per query at a time. Or, in other words, it can only handle one question at a time. And from the chatbots that we’ve built, we’ve found that people like to ask chatbots A LOT of questions at once A LOT of the time.

Most often, these multi-question queries end up confusing Dialogflow and it ends up hitting a fallback intent, like the Default Fallback Intent, which is what happens when Dialogflow can’t process the query and match it to an intent. Usually the responses for these default fallback intents are asking the user to rephrase or to say a question again, such as “I didn’t get that. Can you say it again?”

Screenshot - Redmi 3

But what we’ve found is that often people might rephrase their questions yet still ask multiple questions, ultimately leading to the same result and a bad user experience. Is there a better way to handle multiple questions in an intent?

Build an multi-question handling intent

One way is to handle it is by building an intent utilising Dialogflow’s sys.any entity. According to the Dialogflow documentation, sys.any “matches any non-empty input”, which is unique within Dialogflow and gives it a tremendous power. We’ll be using sys.any similar to a regular expression wildcard (*) to create an intent that detects multiple question marks. Using this intent, we’re able to give better feedback and instructions to users, clearly stating that the issue is asking more than question at a time and directly instructing them to ask one question at a time.

Screenshot - Product

Setting up a training phrase like above will have Dialogflow look for queries that have at least two question marks separated by any amount of text. To create this training phrase, add the training phrase “sys.any? Sys.any?” and then highlight the “sys.any” parts to annotate them as @sys.any entities. Make sure to leave the ?s out of the annotation. Afterward, add your desired response as usual and save the intent.

Sodium carbonate - Catalysts
Product design - Product

This intent will then pick up when a user asks two questions by checking whether they have used multiple question marks, and you can then reply asking the user to please ask one question at a time. In the above left example, Dialogflow picks up the two question marks (?) and fires the multi-question intent correctly. In the example on the right, one question is asked and Dialogflow fires the regular Default Fallback Intent. 

Of course, it’s not entirely foolproof and you can’t always predict how users will ask questions. Below you’ll see a few examples of how this intent can be missed. Also, it is definitely a good idea to test your chatbot to ensure that this intent doesn’t override or block any of your other intents, as sys.any can be dangerous if not used correctly.

Code - Product design
Product design - Product

Suggestions using design and copy

In addition to creating a multi-question handler intent, you can also use affordance in the design of your chatbot widget and the copy to try and stop users from asking multiple questions in the first place. The concept of affordance in human-computer interaction and user-centered design refers to the properties of objects which show users the actions that they can take. Giving hints or subtle instructions (but not too subtle) to convey that the chatbot can handle one question at a time is a much better user experience.

Consider changing your welcome intent from something like “Feel free to ask me any questions” to “Feel free to ask me a question”. Similarly, from some of the interactions with chatbots we’ve seen, the more obvious you make the user aware they’re talking to a computer, the more they’ll simplify their questions in the hopes that the computer will understand. So consider adding a robot avatar for your chatbot or clearly labelling it as a chatbot in the title or name. Try and get creative and have some fun with it. And if worst comes to worst, you can always just change your welcome intent to say “One question at a time please.”

Conclusion

Conversational chatbots are still a new frontier and as chatbot builders, we sometimes have to find ways of getting around platform limitations. But getting creative with intents, responses and design is part of what makes this whole process fun and interesting. Hopefully you’ll be able to implement some of the suggestions we’ve outlined here, and if you find a creative solution, drop me a line or comment below because I would love to see it.

rotating_orange_square_giphy

Like this blog post? Sign up to our email newsletter – Lab Report – and never miss a new one. Or, get it sent straight to your Messenger!