Training your Intelligence

Giovana Borges Feitosa Updated by Giovana Borges Feitosa

Overview

We call "Training" in BotHub the action of generating a new model (intelligence) from all existing training sentences. This model will be responsible for receiving user inputs (sentences) and classifying them according to the intentions it knows, based on the sentences, intentions and entities (dataset) that were used in the training.

Training sentences are phrases and expressions that the final user will probably type or ask, about the main purpose of the bot. So, for each intent, you must insert several training phrases that simulate the actual phrases received by the user.

As an example, the intent "outside" with the sentence "I would like to go outside" teaches your intelligence to classify end-user text entries that are similar to that phrase. Similar sentences, like "I’d love to go out" and "let me go outside" should also be classified as "outside".

That means that an intelligence is mainly based on how this training phrases and intentions are made! 

In this article, we will learn how to create your sentences and run the training following some of the good practices for training.

In the examples below, we will create an intelligence that predicts if the user wants to stay inside or go outside (and we will make these two, our intents).

Let's go!

Adding a training sentence

To add training sentences to your dataset, go to the Training section in your intelligence, then type the example that you want to train and select the intent that it represents.

Press Submit add it to the dataset.

It is worth noticing that if you associate your phrase to an intent that does not exist in the dataset already, BotHub you create a new intent to associate with that sentence!

Good!

Keep in mind that the more examples you add for each intent, the more the intelligence will be effective and assertive if you follow BotHub's training good practices.

See more about intents!

Adding Entities

To add a training sentence that has an entity in it, you must highlight the word that represents the entity, click on Add Entity and name it. After doing that, you can add your sentence as usual, by clicking in “Submit”.

Ps.: just like with intents, BotHub creates new entities in case the name of the entity does not exist already in the intelligence!

See more about entities!

Run Training

Once you finish adding sentences to your dataset, you have to tell the intelligence to "learn it" by triggering the training!

Just click on Run training and BotHub's algorithm will process your dataset to train a new model that will be used to classify user's inputs.

To Run the algorithm, your dataset needs:

  • at least 2 intents
  • at least 2 examples for each intent
  • for each entity, at least 2 examples

All right! Just wait for the training to run and you will be able to use your intelligence!

Searching a sentence

Sometimes you will have to find a specific training sentence in a big dataset. In Weni you can do it easily by using the search bar in the Training section, there you can search in four different ways:

  1. by text: you can type the phrase or parts of it in the search bar, and all phrases that match that search will appear;
  1. by intent: select a specific intent and the search finds the sentences related to it;

  1. by entity: select a specific entity and the search finds the sentences related to it;

  1. by language: select a base language and the search finds the sentences related to it;

Deleting a sentence

To delete a training sentence, just go to the sentences list in the Training section, select the phrase that you want to remove from your dataset, click in the trash can icon and confirm;

When you delete a sentence, it will not have effect until the next training. As the process of adding new sentences, the inteligence needs to be re-trained to replace the model by a new one with the current dataset.

How did we do?

Creating an Intelligence

Intelligence Force

Contact