Home / DialogFlow ES / Conversation Design / How to create “large” Dialogflow ES bots?
Conversation Design | DialogFlow ES

How to create “large” Dialogflow ES bots?

One of my students asked about creating and managing large Dialogflow ES bots.

There are three different things you need to understand when creating large Dialogflow ES bots.

  • How to select training phrases
  • How to input the training phrases for a large bot
  • How to maintain the training phrases for high accuracy

What not to do

Before we go further, definitely DO NOT do this when you create a Dialogflow ES bot.

Do not convert a user utterance in the Training tab into a training phrase

Why?

Dialogflow recommends a minimum of about 15 training phrases per intent. So clearly you can have “too few” training phrases.

But once you have a reasonable number of training phrases in each intent, you can also have “too many” training phrases.

How to select training phrases

Why shouldn’t we convert a user utterance in the Training tab into a training phrase inside an intent?

This is because every training phrase in every intent is competing with every training phrase in every other intent when Dialogflow tries to match the user’s utterance to an intent.

The more of these training phrases you have which “compete” with each other, the harder it is for Dialogflow to decide which intent should be selected.

Now, the extent to which these training phrases compete with each other depends on their similarity. This is usually computed based on their word vector representations. Computing similarity is fairly complex, and I will not be covering it here. But the gist of it is that the more similar words in two different training phrases, the more likely they will look similar to Dialogflow’s Machine Learning algorithm.

An example

Instead of converting the entire user utterance, delete sentences and phrases which clearly do not add any concrete information. For example, if the user says

“Hi. I have a problem. How can I pay my bill online?”

you don’t have to convert the whole utterance and add it into the intent called “pay.bill”. Instead, delete the first part of the user utterance (“Hi. I have a problem”), and only add

“How do I pay my bill online?”

as a training phrase.

Also, while you do want to add enough training phrases per intent, don’t add too many of them.

In my Dialogflow Conversation Design course, I talk about minimizing the intra-intent variation and maximizing the inter-intent variation. You want to use that as a rule of thumb when adding training phrases into your intents.

And converting your user utterance into a training phrase makes this harder (in the sense that the training phrases will not be carefully selected).

How to input the training phrases for a large bot

You can use the agent ZIP file feature of Dialogflow and convert a spreadsheet containing your intent training phrases into a Dialogflow chatbot with the click of a button.

This is actually better than using the Knowledge Connectors feature.

I have written about this in detail here.

Also note: using the Knowledge Connectors feature makes it harder to optimize your training phrases, because it is a blackbox.

How to maintain the training phrases for high accuracy

Once you have a working bot, you also need to maintain its accuracy.

The easiest way to do that is to set up automated conversation testing.

I explain how to do that using Python and pytest in my Improving Dialogflow ES accuracy course.