Candidate Intents

Website Name Change

I have changed the name of this website from Mining Business Data to BotFlo. I am offering a 40% off discount (on any course of your choice) until May 15th 2021 for people who help me spread the word.

At any point in the conversation, there is a set of intents which can fire. We will call these candidate intents. To understand candidate intents, it helps to first understand which intents cannot fire.

Which intent cannot fire?

Suppose an intent has an input context called ContextA. Unless ContextA is active at that point in the conversation, the intent cannot fire.

An intent with no input context can fire anytime

If an intent doesn’t have an input context, it can fire (i.e. be mapped) at any point during the conversation. Of course, it will only actually fire if Dialogflow uses its pattern matching and decides that the pattern of the user’s message is close to one of the training phrases in the intent.

The video below explains candidate intents:

I also have another article where I go into this topic in some depth.

Autogenerated YouTube transcript

[00:00]. So in the previous videos we saw that

having a context lifespan which is smaller than one was causing a couple of issues the first is it wasn’t letting the intent that we expected to be mapped and it was also causing the intents we did not want to get mapped to actually get triggered. Right. So this means that having a context lifespan which is more than one was leading to some unpredictable behavior in your chat BOTS

[00:30] let’s take a look at this in some

more detail and see if we can come up with a more systematic way to study the whole the whole problem and as well as see if we can come up with some heuristics and see if we can make our BOTS more predictable by following certain conventions. So the first thing I want to talk about is the notion of the

[01:00] candidate intents what do I mean by

candidate intents at any given point in the conversation there are a certain set of intents which can fire now we already know that if an intent has an input context unless that context is active it’s not possible for that intent to fire at that point in the conversation now what this also means is that if you

[01:30] have an intent which has no input

context it means it can fire at any point during the conversation which means it’s a candidate intent at every point in the conversation and you also know that if the input context of that intent is active at that point in the conversation it’s possible for that intent to fire which means it will be a

[02:00] candidate intent at the point in the

conversation now to make it a little more concrete let’s take a look at the pot we’ve been building and let’s just look at it at the starting point so here we already know that the default fallback the default welcome don’t have any input context we know that these two are context based fallbacks which means that they do have input context and we also know based on the previous videos that

[02:30] user draw its first name and user

provides last name will have input context user wants to by Island won’t have an input context. So it’s a candidate intent at the first step in the conversation and the same way user wants to by submarine has no input context. But these two follow-up intents will have input context and these two cannot trigger at the starting of the conversation now there is another way to study this I have built an app called the the dialog

[03:00] flow navigator. So the Dialogflow

navigator allows you to take the zip file of your agent and filter the intents by input and output context. So here you have it can also do like a search within and all that but for now let’s we are only concerned with the context and you can see that it’s basically as soon as you load the zip file it’s going to show you all the details of each intent you have the intent name and the input context the

[03:30] output context. And then you have like

actions and so forth. And then you have on the two columns on the right you have the user size places as well as three responses now you see at the top here there is a way to filter by input context. So what I’m going to do is you can see that you can even either choose all the intents or you can choose the input context the intents which have input context none that is if they don’t have any input context let’s say I

[04:00] select that and this list has changed

and you can see that it’s come back to the list I was just talking about you have the default fallback the default welcome the user wants to by Island and the user wants to by submarine so these intents are the ones which do not have an input context. And they are the candidate intents at the very first step of the conversation now let’s say that at this point the user says I want to buy a submarine. So it’s going

[04:30] to trigger this user wants to buy a

submarine intent and it’s also going to set this user wants to buy submarine – follow-up context. So this is now active at this point in the conversation let’s take a look at which current which intents can actually fire so we are looking at this context over here let’s select that and you can see that these are the two intents which can now fire

[05:00]. It’s the first name fallback intent as

well as the user wants to buy submarine – first name intent so this can these are the two intents which can fire at this point in the conversation but I also want you to remember one more thing the input context whether it’s active or not also matters so what do I mean by. They like if I go back here. And I say that if I just give my first name let’s say the usual the atom. So what do you see here

[05:30] is the user wants to buy submarine –

follow-up is still active and you can see that the user wants to buy submarine – first name – follow-up is also active so effectively what this means for us is if either this or this context is active if either if this or this context whatever intents are using them as the

[06:00] input context they are all going to be

candidate intents at that point in the conversation. So when I move this to users wants to buy submarine first name follower you can see that now we have these two intents last name fallback and user wants to buy submarine – last name but remember that this context is also still active which means these two in terms the first name fallback and the user wants to buy submarine are also candidates so if I come back to this list here what I just told you is at

[06:30] this step in the conversation user wants

to buy submarine – last name is active because of this context. Okay last name fallback is an is a candidate intent because of this context but first name fallback is also a candidate intent because this context is still active and in the same way user wants to buy submarine – first name. Is a candidate intent because this context is

[07:00] active in other words you can take a

look at the active context from this in the Dialogflow simulator over here and based on that you will be able to look at this list and figure out which of these intents are candidates and don’t forget at every step we still have these fallback and the welcome and the user wants to buy I’ll end-user was to buy submarine all these are also still candidate intents simply because they

[07:30] don’t have an input context. So they are

the other other way to look at it is if an input context is set that can still trigger intents which don’t have any input context at all set in other words the like I said before the intents which don’t have any input context will be

[08:00] candidate intents at every step in the

conversation now that actually has some benefits for example you want the fallback to always be active to always be a candidate at every step because you know if we can’t handle it then you certainly you want the fallback to get triggered but it also means that you have to be careful when you create intents which don’t have input context because you want to be pretty sure that they will not be conflicting with the other intents which you want to actually

[08:30] fire at that point in the conversation

. So that’s a quick overview I hope you got a good idea of what makes a candidate intent at each step in the conversation we will be building on top of this. The notion of candidate intents in the upcoming videos.

Transcript auto-formatted using ATF

"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