Training

To make sure your agent matches user input as often as possible, it’s important to provide your agent with enough data. The greater the number of natural language examples in the Training Phrases section of Intents, the better the classification accuracy. We encourage you to use Example Mode for your Training Phrases instead of Template Mode, since the former provides better data for machine learning.

When you write training phrases within a new intent, start with examples that have the greatest number of parameters. This way, you will define what entities should be used in this intent and name all the parameters the right way. If you annotate the first few long examples, the system will start suggesting the correct entities for new examples.

When you save an intent, Dialogflow will begin training your agent with the new data you've added. Until the training is complete, the updates may not be reflected in the agent.

To make the training process more efficient, we have created a Training tool that allows you to analyze conversation logs with your agent and add annotated examples to relevant intents in bulk.

How it works

As you and your users chat with your agent, you can access the conversation logs by clicking Training in the left menu.

Assigning a training phrase to an intent adds the example as a Training Phrases entry for that intent. Training your agent using this method is good for adding specific examples from users' interactions. Whenever a user provides input, that input is recorded in the conversation logs along with the number of times that input was successfully or unsuccessfully matched to an intent. These logs can help you discover gaps in your conversation setup.

The Unmatched number means the conversation contains the displayed number of interactions in which the user said something that wasn't matched to an intent. These should be checked to see if your intents are missing potential training phrases or options that your users expect.

Upload Training Phrases

You can upload sample user inputs by clicking the UPLOAD button in the upper right hand corner.

These samples can be in a .txt file or in a .zip archive with multiple (up to 10) .txt files. Each sample input should start on a new line.

Add via API

You can add more Training Phrases using the POST and PUT API methods for the /intents endpoint.

Any changes made via the API to alter the agent's behavior initiate the training in the same way as when you save an intent. The changes delivered through the API train the agent.

Train your agent

Click on a dialog listed within the Training tab. Dialogs are named by the first user input in the session and once clicked, it expands to show the entire conversation between your agent and the user. You may see that some inputs don’t match to any intent or have incorrect annotations.

Handle unmatched inputs

Unmatched inputs are marked by an exclamation mark error_outline. You can assign unmatched inputs to intents in two ways:

  • Add inputs to one of the existing intents.

    When you click on Click to assign you'll see a list of existing intents to assign the unmatched phrase to. This will add the phrase to the intent's training phrases.

  • Create a new intent with this input.

Fix annotations

In the case of incomplete or incorrect annotations, you can fix it the same way as adding or editing examples in intents.

  • To add an annotation, highlight the word that should be annotated and select an entity from the list.

  • To edit an existing annotation, click on an annotated word and select a different entity from the list.

Manage training logs

Each interaction log that has been recorded will have options available on the listing. Once the relevant logs' options are marked, click the Approve button to submit the changes.

Add to matched intent

Clicking the check check icon will add the phrase to the matched intent's training phrases.

Add to Default Fallback intent (Negative examples)

If the input works as a negative example, click on the cancel icon not_interested right below the check button. This will add the input to the Training Phrases for the Default Fallback Intent.

Delete logs

To delete one or more logs, click on the trashcan delete icon for the entries you want to delete.

Disable interaction logs

Depending on your agent, conversation logs could include personally identifiable or confidential information and your agent may need to comply with legal or other restrictions. To help with this, you can disable logging for your agent in its settings.

  1. Click on the gear icon next to your agent's name.
  2. Click the General tab.
  3. Under Log Settings, check Disable interaction logs.

If you don't need to disable all logging, you can delete individual log entries.

Delete interaction log entries

You can delete interaction log entries from either the Training or History page. Since they're linked, deleting an entry on the Training page will also delete it from the History page, and vice versa.

You can also disable logging for your agent if you don't want anything logged.