Home / DialogFlow ES / Do this when Dialogflow ES matches the wrong intent
Debugging | DialogFlow ES | Tools

Do this when Dialogflow ES matches the wrong intent

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.


Learn more about the Candidate Explorer and download the tool

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

This is harder to read and follow on StackOverflow

Or you can manually type it out like the one here.

Much easier to read, but is more time consuming for you, plus you might leave out some information

The Dialogflow Viewer converts your agent into a text format that you can copy and paste quite easily into the text editor.

Learn more about the Dialogflow Viewer tool

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.

<— End of article —>

This website contains affiliate links. See the disclosure page for more details. 
"The magic key I needed as a non-programmer"

The custom payload generator was the magic key I needed (as a non-programmer) to build a good demo with rich responses in DialogFlow Messenger. I've only used it for 30 minutes and am thrilled. I've spent hours trying to figure out some of the intricacies of DialogFlow on my own. Over and over, I kept coming back to Aravind's tutorials available on-line. I trust the other functionalities I learn to use in the app will save me additional time and heartburn.

- Kathleen R
Cofounder, gathrHealth
"Much clearer than the official documentation to be honest"

Thanks a lot for the advice (of buying and following your videos)! They helped a lot indeed. Everything is very clear when you explain, much clearer than the official documentation to be honest 🙂

Neuraz T
Review for Learn Dialogflow CX
"I will strongly recommend this course because even I can learn how to design chatbot (no programming background)"

I think Aravind really did a great job to introduce dialogflow to people like me, without programming background. He organizes his course in very clear manner since I have been a college professor for 20 years. It is very easy for me to recognize how great Aravind’s course is! Very use-friend and very easy to follow. He doesn’t have any strong accent when he gives the lectures. It is so easy for me to understand. Really appreciate it.

Yes, I will strongly recommend this course because even I can learn how to design chatbot (no programming background) after studying Avarind’s course, you definitely can!

Ann Cai
Review for Learn Dialogflow ES

Similar Posts

  • Hi Aravind!
    Is it possible to acces a Follow-up intent from the main dialogue, and not from the tree itself?
    1) Intent: What do you want?
    1.1) Intent: Wants info for Black Tea
    1.2) Intent: Wants info for Green Tea
    1.3) Intent: Want to order Tea

    If a persons says “I want to order tea”, they could access intent 1.3 directly without having to go through intent 1 first.