In the video below, I describe how Dialogflow training works.
Autogenerated YouTube transcript[00:00] All right so in this lesson we are going to learn about how dialog flow training works now you might have heard a lot of people say. And even i have mentioned this on my website at different points i say that dialogflow is very interesting and useful because it can get smarter over time. So what exactly do we mean by the statement the dialogflow bot gets smarter over time?
And when you talk about this people usually [00:30] you know they refer to it as though it were a black box.I think that it 's less of a black box than most people realize. Although the intent mapping algorithm that Dialogflow provides it is still a black box. Even though the intent mapping per se is a black box the training actually is a lot more transparent than most people seem to realize.
So that 's what i 'm going to discuss in this video. So what I have is if you go to my website [01:00] you can go to this page where I have this bot which just it 's a very simple FAQ bot. What it does is you ask a question. And based on the question that you are asking it will find any article on my site. It will only find a single article, it will find an article where the title of the article matches whatever you have typed. So to see that it works properly let 's say if i say how to do how to do slot filling [01:30] comes back with this response which is a guide to slot filling.
And you click on it and you will notice that it actually opens a new page with an article which is pretty much having that in the title - a guide to slot filling. So this is how the bot is expected to work now in Dialogflow you have a feature which is this training feature. And this is the bots console [02:00] inside the Dialogflow console this is what that chat bot looks like. So you have all these questions. And people have asked all these things. And i am very interested in a particular question that somebody has asked here where they say - how to connect with php. And notice that when they ask this how to connect with php it has actually gone to the default fallback intent.
So to show that i 'm going to go to my bot again and i 'm going to paste it [02:30]. And of course it 's going to map to the fallback intent because it 's saying i missed that can you please say that again. So now what I want to do is I want to show you an intent which I already have in my agent.
So I'm going to just search for the word php. And you can see that there is this article which is about the client library for Dialogflow for php. So I'm going to click into that article [03:00] I'm sorry into that intent. And you can see that the training phrase is very simple it says php client library for dialog flow v2 api getting started. Now this is the only training phrase you have in this intent. And it actually is going to link to this article here on my site. And let 's just quickly take a look at what it looks like. I'm going to go there and let 's wait for a second [03:30]. And this is a tutorial which explains how you can use the php client library.
But the important point is that this is how you would connect php to dialog flow. In other words if you want to integrate dialog flow into your php website or app or whatever you 're building - the way you do that is you use the dialogflow api. And you have something called the client library. I 'm not going to go into the details of what the client library is. But the the main thing is that you need to use something [04:00] auch as a php client library to connect your dialogflow agent to your php website.
So that should have been the answer. When somebody is asking this question how to connect with php. So what i can do is i can go back to my training tab. And i go to this question. And you can see that here it 's just mapping it to the default fallback intent. So instead of that what i can do is i can click on this. And i can search [04:30] for the word php. And remember that this is the article that we are interested in. So i 'm going to click on that. So what i have effectively done here is i have mapped this user utterance or training phrase to this particular intent.
And this is a variation that is the second question is just a variation of the first one. So i 'm going to also select that i 'm going to do the same thing. So you have made a [05:00] couple of changes. So your next step has to be to approve these two changes. So let me do that now I've approved it you have to give it a few seconds for it to sort of update it.
And also save it and also notice that of all the other training phrases we have inside this training tab this one has been approved. So it has this green check mark next to it. And now you can [05:30]. Also see that the agent training has been completed based on the changes that i just made. But the most important thing to notice is let us say that we go back to this intent. Again so notice what happened the two phrases that i just selected. And mapped to this intent they got added. As user utterances or training phrases into that same intent okay. So this means that [06:00]. When somebody is asking questions which are somewhat similar to these questions these phrases they are going to be now mapped to this particular intent which in turn means that they will be able to go to this particular article right.
So let me check that let me make sure that it actually works like we think it should. So let 's put it in there. So now if i were to click on this yeah it goes back to that same article which we were seeing [06:30] over here all right. So this is the first thing that is. When you click on the when you map the training phrase to that particular intent you see that it actually goes and gets added to the training phrase list in that particular intent. That 's the first thing. The second thing that you should know is that when you export this Dialogflow agent the zip file of this because it contains all these training [07:00] phrases. And all the responses and so on.
What has also happened is that the training has been effectively saved into your Dialogflow agent. I'm trying to say something which is maybe a bit abstract here. But once you think through this I think it will make sense the agent which you started with was not as smart as the agent which you ended up with. Once you did this mapping through the training tab right that is [07:30] Initially it could not answer that question which is to connect with php. And now it can answer the question to connect with php. And all the new learnings that Dialogflow was able to obtain. Because you did some additional training is now stored inside of this agent.
Which means that if you had to download the zip file and then you know send it across to someone so that they can use that zip file to create another bot. Or something like that. You have [08:00] stored that extra training, the extra learning that you have the bot has effectively become smarter. But also it has figured out a way to retain that additional knowledge by just. Like the way you have the zip file of the dialogflow agent just the way that it actually works right. So this is important because your Dialogflow agent when you say that it 's getting smarter over time [08:30] it 's not as if something is happening in the background that we do n't really understand. And we ca n't have any insight into. But it just seems to be magically getting smarter - that's not what is happening.
That is it 's not as if on the servers that dialogflow is running on there is some code which is getting updated. And that just magically makes the Dialogflow bot smarter. And it 's a black box where you don't know how it becomes smarter. It's not anything like that.
You get a good insight into the way [09:00] the training works just when you notice the fact that every time you do the training. That is if you map some user utterance to a specific intent you notice that the utterance actually gets added into the list of training phrases.
- Dialogflow Messenger Quiz Bot
- Dialogflow Zobot: Selection Triggers the next intent
- Integrating Dialogflow with Zoho live chat
- 5 things you cannot do using the Dialogflow Messenger integration
- Dialogflow Architecture
- Dialogflow Python webhook tutorial
- Dialogflow training
- Dialogflow vs Lex vs LUIS vs Watson vs Chatfuel
- Convert your WordPress website into a Dialogflow FAQ chatbot
- Dialogflow Messenger Interactive Learning Bot