Now that we have defined the ideas of candidate, target and fallback intents, we can look at the next concept which will help us pull all these together – the surplus intent.
A surplus intent is the opposite of the target intent – it is a candidate which you don’t want to fire at a given point in the conversation. An excellent example is the intent which was introduced at the beginning of this series which fires when it isn’t expected to: the intent which captures the first name.
Here is an explanation of surplus intents:
Les has commented:
Great tutorial, even though I had to watch it ten times to sink your unique concept of CTFS.
Well, I think it is because I hadn’t used a full example to explain target and surplus intents the first time around.
If you would like to understand CTFS using a more concrete example, you should check out my YouTube course where I use the florist bot (which was created by the Dialogflow team to explain how contexts work).
Autogenerated YouTube transcript[00:00] so we have already seen the definitions of candidate intents target intents. As well as fallback intents in this video I am going to talk about what I define as surplus in tips so what is a surplus intent the as the name indicates the surplus intent is an intent which is a candidate but one which you prefer does not fire. In other words it’s it’s just a surplus and you. Rather that it’s not even a candidate at the point so we have [00:30] already run into surplus intents before when we were discussing the follow – up intent 3 over here.
So let’s say that the user types I want to buy submarine and it comes back with what is your first name and you say Adam
And then it says so you can see that it is asking for the what is your last name second time and I think we already went over the reason for this. And the reason was that the ⌛ [01:00] context which are set by the user wants to buy submarine it’s still active after this intent has map which means that. Instead of firing this user wants to buy a submarine last name intent we should have captured the last name it simply fired this user wants to buy submarine – first name intent. Again now at this point if you think about it what we wanted was this was our target intent.
At the same time aside from the intents [01:30] which don’t have any input context at all you will
Also remember that because of the way the follow – up intent tree works in Dialogflow this. Also is a candidate intent simply because it shares the input context with this one that is these two are both having input context which are technically active at the point in the conversation where user is typing in this word Scott. Now that means even though we would prefer user wants to buy submarine – ⌛ [02:00] last name – fire the actual intent which fires as you can see is this one which is user wants to buy submarine – first name so in this situation user wants to buy submarine – first name is the surplus. In time so this is what I mean when I say a surplus intent it is a candidate.
Because of the fact that it’s got you know it’s got like the context set in that way but it’s not [02:30] something that is actually a target and we prefer that it doesn’t fire at that point now I would not call the intents which don’t have any input context as surplus intents simply because there are some situations when you have no option an example would be like an FAQ chatbot which answers
Frequently asked questions and for the most part the user when they come in and they type a question there ⌛ [03:00] are like let’s say there are 10 types of questions for each question you can not really set an input context simply because there isn’t that that could well be the starting point of the conversation for the user and if you had set an input context
That means obviously those intents can not fire at this at the beginning of the conversation
So that’s not what I would refer to as the surplus intent what I am really talking about when I mean surplus [03:30] intent are the intents like the user wants to buy Submarine – first name which do have a context. And still end up as surplus intents that is which to have an input context set. And still end up as candidates when they should not be those are the ones which I am referring to as surplus interests so going over the list we already have we created we talked about the candidate intents which are all the intents which could fire at any given step in the conversation we had ⌛ [04:00] the target intents which are the intents which we actually wanted to fire at any step in the conversation we had the fallbacks where we didn’t know how to handle the users input and.
Transcript auto-formatted using ATF