Is your Dialogflow bot triggering the wrong intent?
I see questions such as these on forums sometimes:
In this article, I explain a few things you can do when you need some help figuring out why your Dialogflow agent is behaving like that.
This article only applies to Dialogflow ES bot and not for CX bots.
Understand Candidate Intents
The concept of candidate intents is a very powerful one in Dialogflow ES bots.
What is a candidate intent?
It is easier to understand candidate intents by understanding non-candidate intents.
If an intent cannot match at a given step in the conversation because it has an input context which is not active at that point, it cannot be a candidate. Every other intent in your agent is a candidate intent at that step.
This has three implications:
Using an input context for an intent reduces the number of candidates available for selection
Reducing the number of candidate intents at each step can improve the accuracy of your Dialogflow bot by giving the Machine Learning algorithm fewer ways to make a poor prediction
When you say that Dialogflow selects the wrong intent, what you are usually saying is that out of all the candidate intents, Dialogflow selected either a surplus intent or a fallback intent rather than selecting the target intent.
Use the candidate explorer to verify which intent is being mapped
I have created a free tool called the Candidate Explorer. It allows you to see which intents are candidate intents at each step.
In turn, you can see if the candidate intents at a given step match what you expect.
Use the Dialogflow Viewer and get the text output of the agent
Are you still unable to figure out why Dialogflow is detecting the wrong intent?
Maybe you are thinking of asking your question on some online forum?
So you need to manually describe your agent details as you prepare your question. Normally, this would be quite time consuming, and more importantly, might leave out some important detail. In fact, in my opinion, the sheer tedium of this step is why a lot of Dialogflow questions go unanswered on StackOverflow.
There are effectively two ways in which you can show all the details about your agent when asking questions.
You can take a screenshot of the full intent, and add it into your question like here
Or you can manually type it out like the one here.
The Dialogflow Viewer converts your agent into a text format that you can copy and paste quite easily into the text editor.
Leave a comment
Finally, if you don’t get an answer on any of the forums, paste your Dialogflow Viewer output into the comments section below and ask your question. If it is NLU-logic related (and not about your webhook code), I will try and answer your question myself.
All comments are moderated, so don’t be worried if your comment doesn’t show up right away.
- 3 ways to pass parameters between intents in Dialogflow ES
- Do this when Dialogflow ES matches the wrong intent
- How to bulk upload intents from a CSV file in Dialogflow
- How to move bot from Dialogflow CX to Dialogflow?
- Understanding Dialogflow service account roles and their use cases
- Course Discounts
- How to debug Dialogflow Python webhook using ngrok
- EU VAT MOSS Tips for online course creators
- How to integrate Dialogflow into your Flutter app
- Get your DialogFlow agent to initiate the conversation before user types a message