In this article I will tell you the best kind of chatbot you must build if you would like to learn Dialogflow as quickly as possible.
The chemical element lookup chatbot
The chemical element lookup chatbot answers questions such as:
What is the atomic number of Oxygen?
What is the chemical symbol of Boron?
In my "Must know concepts of Dialogflow" series (see sidebar), I mention that there are 5 concepts which form the building blocks of Dialogflow. Its a bit like Pareto's 80/20 rule: learning these 5 concepts thoroughly will cover about 80% of the stuff you need to know about Dialogflow, and will allow you to more easily learn the remaining concepts as and when you encounter them.
As a contrast, I received this feedback from one of my readers about the online documentation:
In general, their documentation tells you what can be done, what is possible, without explaining why you would do it in a particular way, or what the positive and negative sides to doing it are.
If you also feel the same way, be sure to check out my course (details at the end of this article).
In defense of most of us who are trying to explain how Dialogflow works, sometimes the concepts are a bit circular and figuring out the best order for teaching/training isn't very obvious!
You will be able to learn how to use multiple training phrases to specify a given concept (atomic number, chemical symbol). At the same time, the words used in these are very unique to the domain (chemistry) which means it will be easier to get going when defining your intents.
An interesting thing about chemical elements is that there are enough of them (100+) to make it useful to declare an entity without being so large that you need to put a lot of effort to bring them together. Moreover, the number of elements is more or less fixed. In addition, it isn't an already defined system entity, which means you do need to put in some effort to learn how to define them.
Once a question has been asked about a particular element, you can ask followup questions about the same element.
1: What is the atomic number of Hydrogen?
2: And what is its chemical symbol?
Notice that in question 2, you just referred to the element from question 1 using the word its. How can you help Dialogflow know what you meant by the word its? That is where contexts can help. At the same time, you can in theory use the idea of contexts to build really long conversation dialogs. But we don't need to do that for this chatbot. So a chemical element lookup chatbot provides a way to learn the idea of contexts without being too complex.
You need to write some code to do the actual lookup (unlike, say, an FAQ bot) so you do need to create webhooks for the chemical element bot. At the same time, the actual logic you will be writing in your webhook is quite simple and also easy to verify whether it is working correctly.
Since there are multiple attributes you can query for (such as atomic number, color, chemical symbol) etc, you will need to make sure you use the correct code path in your webhook for the lookup. As a result, you will also understand how to use actions.
Intro to Dialogflow course
You can try and build out this lookup chatbot by yourself. But if you need some extra help, you can also take a look at my intro course.