Building bot-ready knowledge bases #4: The Dialogflow console and adding entities and intents

Our experimental initiative to prototype a bot-ready information solution using Google’s Dialogflow

This post is part of a series. For more information and links to other posts in the series, see the “Building bot-ready knowledge bases” home page.

The Dialogflow console

The Dialogflow console is the dashboard where you set up, configure, train, and debug your chatbot. The following image shows the console for our GROCERYbot (on the left), with some of our initial intents displayed on the right.

Dialogflow console for our GROCERYbot
Dialogflow console for our GROCERYbot

The most important sections of the console are Intents, Entities, Knowledge, Training, and Validation.

Intents are shorthand labels that represent user requests to a chatbot. Entities are keywords.

We first created intents related to entities (for example, fruits and  vegetables) in our produce KB articles.

The Knowledge section of the console  is where we stored our DITA output files and FAQs that serve as natural-language training material for the bot. We’ll describe these in detail in our next post.

Information gathered by Dialogflow during the bot training process is visible in the Training section.

Training section of the Dialogflow console
Training section of the Dialogflow console

Information available in the Validation section of the console is helpful in troubleshooting and debugging the bot.

Validation section of the Dialogflow console
Validation section of the Dialogflow console

How we got started

To be honest, in the beginning we couldn’t quite figure out how to begin setting up the chatbot we had so carefully planned out! The Dialogflow documentation is pretty good at explaining concepts, but not so good at providing a step-by-step procedural information for chatbot newbies.

Fortunately a search of the Internet turned up the valuable, beginner-level educational video “Step by Step Dialogflow for Non-Programmers,” which was created by Aravind Mohanoor, a Dialogflow trainer and consultant. What we had in mind for GROCERYbot was similar to what Aravind created with the “Planets” bot in his course.

Aravind’s website, Mining Business Data, is definitely worth a look: his clear and relevant explanations and demonstrations got us unstuck and on our way.

Initial GROCERYbot entities

A detailed description of entities and the role they play in chatbots is beyond the scope of these posts, but below are examples of some of the initial entities we created in GROCERYbot.

Instances of the fruit entity
Instances of the fruit entity
Attributes of fruits and vegetables
Attributes of fruits and vegetables. Note that each attribute has one synonym.

Initial GROCERYbot intents

Below are screenshots showing examples of the initial intents that were available by default and that we created for GROCERYbot.

Default Fallback and Default Welcome intents

These intents are provided to every new Dialogflow chatbot. As you can see from the images below, they contain phrases suitable for initial contact with the user (welcome) and when the bot has no clear course of action (fallback). We didn’t change or add any training phrases to these intents.

Training phrases in the Default Welcome Intent
Training phrases in the Default Welcome Intent
Text responses in the Default Fallback Intent
Text responses in the Default Fallback Intent

Intents we added to the GROCERYbot

Below are training phrases for the “UserAsksForAttributesOfFruit” intent. Note that Dialogflow uses color to “acknowledge” the entities and attributes of which it is already aware.

UserAsksForAttributesOfFruit intent
UserAsksForAttributesOfFruit intent

Our GROCERYbot makes use of Dialogflow’s sophisticated context capabilities. For example, if a user asks about an attribute of apples (say, color), she can ask a follow-on question in the format “And how about location?” and the bot will remember that the entity in question is still apple.

GROCERYbot remembers the context of the previous question
GROCERYbot remembers the context of the previous question

What’s next?

In post #5 we’ll talk about how we added text files to the Knowledge section of Dialogflow from our DITA grocery shopping project.