Hands-on

Lucas Agra Updated by Lucas Agra

Introduction

Now that you have Created an account, let's train an intelligence thats understands and interprets your customers' messages

We will follow some steps

It is recommended to read the section Intents and Entities to understand how intents and entities(optional) work.

Hands-on

Now, let's work on the intelligence

  1. Define intelligence context
  2. Define required Intents for its purpose
  3. Create example sentences for each intent
  4. Train the model based on theses examples
  5. Test the trained model

1 Define intelligence context

To define your intelligence purpose, it is necessary to ask a few questions: Where is it supposed to work? Which specific problems will it handle? What kind of issues will the customer address?

We will create here an intelligence to a website which will classify sentences between question, complaint and tracking.

The main ideia is to have a simple intelligence, working in a website chatbot, that will guide users to talk to its requested department.

2 Define required intents for its purpose

To be able to train, it is required to define which intents will be used in the intelligence.

We can ask some questions to help with this issue: What is the intelligence context? How to split this context in distinct intents?

Upon receiving a sentence, the intelligence will label it as one of the registered intents.

To our example, it is clear that we will use question, complaint and tracking as intents.

Advanced
At this stage, it is important to analyze whether the defined intentions do not escape the intelligence's purpose.

As an example, the user could add here greetings and farewell intents, in order to classify the sentences also in this context, and it would work. However, depending on the flow used in your chatbot, it might make more sense to use an specific intelligence to that context, which would enter the beginning and end of the flow.

This is also true for intelligences with many intents. Ideally, an analysis should be carried out to determine whether all those intents need to remain in a single intelligence. The less intents an intelligence has, the more assertiveness it will have, and the simpler it will be maintained.

As a chatbot can use several intelligences at the same time, it is recommended to think of smaller intelligences for specific topics of the flow, than a single great intelligence for all purposes.

Other good practices can be found at Guidelines and good practices.

3 Create example sentences for each intent

Each intent should receive different example sentences to be able to learn and correctly label the incoming messages.

In the Training tab, add the phrases with their respective intents. In our example, we have:

To learn more about adding sentences, check out Training your Intelligence.

The more sentences it has, the more assertive it will be.

Advanced
The markings mean that those words have been marked as an entity. In this case, product.

Entities are groupings of words used to extract extra information beyond the sentence classification. In this example, as two words were marked as products, when making the classification, the intelligence will also try to extract entities that fall into this category of products (words such as: computer, tablet, laptop, TV).

To learn more, read Intents and Entities.

4 Train the model based on theses examples

Here we take care of the work, just click on "Run Training" and the intelligence will be trained with the registered sentences, generating a new model*.

If you already have your intelligence trained and want to make changes to sentences such as some addition, edit or removal, these changes will only take effect by retraining intelligence.
The training is a heavy process that usually takes 7 to 15 minute. Just wait a little bit!
Advanced *
The training process always uses all registered sentences, whether they are already trained sentences or new sentences, not yet trained. Therefore, when training, the old model* is not updated, it is simply replaced with a new one.

* model is the component generated by the training process, as shown in the diagram:

5 Test the trained model

After the training process, your intelligence was created. To find out how it is working and if you can already interpret the different messages that your customer will send, just open the Quick Test window and send a sentence for classification. Your last trained model will be used to classify the sentence. A response will be returned with the classified intention and the confidence rate for that classification.

The confidence rate indicates how certain your intelligence is about its prediction.

To put together a more effective test, it is recommended to go to the Test tab and add the test sentences you want, along with the real intention of each sentence.

When running the test, Bothub will use your model to classify the test sentences one by one, and compare the predicted result with the actual value entered by you, showing them in the test results.

For more information, see Tests

How did we do?

Glossary

Contact