Dialogflow Chatbot - Name Recognition With Multiple Intents (Using a Wildcard Entity)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
now I'm gonna show you how to make your name recognition a bit for more robust even when the given name system entity is limited to a certain number of names how can we make sure that we recognize all names so the way we're going to do is this is we're going to use two different intents and one is going to use this system give name entity and then there's another capsule intent that's gonna basically catch every user input so I'm starting off here with the new empty agent and first thing similar to my previous examples we're gonna kick off the interaction with the welcome intents so if any of those a hello hi inputs are recognized then we're gonna prompt the user to enter their name right and we're gonna use an output context now which is gonna be a waiting name next thing we're gonna do is create a new intent which I'm gonna call get name and it's gonna have the input context that we just set a waiting name and whenever the user enters a name so that's my name for example that the system given name entity require recognizes it's gonna go to that intent so any T will be system given name I'm gonna name it like this and it is going to be required going to add to another prompt here although I don't think that's ever gonna come up and great sorry this works the given name energy recognizes the name then we're done with our name recognition it is gonna say thanks whatever your name is cool so that's that's similar to what I explained in my previous video but now what we're gonna do is we're gonna add a second intense which I'm going to call a get name [Music] catch-all it's gonna have the same input context a waiting name and this one is going to catch a it's going to catch all the names that are not recognized by the given name entities so these are examples we're gonna add a parameter that's also gonna call name but this time we're gonna use this system any entity which will recognize every input so same names it's what's your name cool I'm going to keep assigned the input to the parameter that we just created all right and now since we want to make sure that it's a name that works what recognized correctly we're going to enter a prompt can you confirm that whatever was recognized name is your name and we're going to set an output which is a waiting name confirm cool so that's it so we're going to catch all the inputs here and now we have to create two more intents to catch the response from that which is response I'm just going to go back one second because I just realized I did not assign my name input in the other cat name intent so I'm going to do that whenever a name is input that's recognized by the system give named entity assign it to this parameter cool you're gonna save this and now like I said I've got two more intense - great one will be confirmed name yes for which the input context is waiting name confirmed and what the answer will be yes so whenever the user answers for the yes we've correctly gotten name and in that case I'm also gonna just to repeats the name we're in the response thanks so in this case we recognized the name in the previous intent so I'm going to use the context here to access today cool that should be it's nothing while we need to do in this intense and the last intent we need to create is confirmed know so in case the user says no same input context you were awaiting the name because the user says no we're gonna catch that we're just gonna say no problem and you repeat your name so what happens is these are just told us no we didn't get the name correctly and well we still want to get the names so we're asking them to input the name again so this might be the case if there was a typo in the original name in which case the system given name entity wouldn't have recognized the name and we're gonna repeat that name that was input and the person was saying no no that's not my name it was a typo so the only thing we need to do here is now go back to the previous awaiting name context in which case that's just going to redirect to the to the beginning of the name recognition so we're done with this so far just to repeat so we started with the welcome intent we're saying hi can you enter your name by output context is set to a whiting name and then we have two intents one is the system entity do you recognize the name and one uses the system any intent entity to recognize the name and then this is going to go further so if the system entity recognized the name all goods done if the system any entity recognizes the name it might have been a typo so we are going into these intents to confirm if that was the correct name if yes we're done if no we're going back to these once so then we're gonna just prompt again to enter the name so let's see if this really works hello what's your name so first example Peter right that was recognized thanks Peter another example could be the true so there's a typo now can I confirm that Peter is your name no actually that was a typo no problem can you repeat your name sure this picture got it thanks Peter now let's go with a bit more exotic name that we're not sorry I need to start from the beginning what's your name let's go with my exotic name that was not that will not be catched in the given name entity so again I'm being asked can you confirm that how much is your name yes it is my name great and we're done cool so there's one more way that you could optimize this you could instead of the given name entity you could create your own custom custom entity so there's lists out there of common names so you could just make your own entity to make to make the name recognition a bit more fluid but again there's going to be limits so I don't know there's always going to be names that are not be they're going to be recognized by your name list that you're going to input in entity so I think it's always going to be good to have a catch here in which case you can catch any kind of name that was entered and then get a confirmation and that's cool I hope you enjoyed this video and it's gonna be useful thanks for watching that's it for me for now
Info
Channel: Peter Fessel
Views: 33,404
Rating: 4.9421964 out of 5
Keywords: Dialogflow, Chatbot
Id: uI0u6xvazAM
Channel Id: undefined
Length: 10min 48sec (648 seconds)
Published: Sat Feb 10 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.