Updated by Thays Oliveira
Now that you have Created an account, let's train an intelligence thats understands and interprets your customers' messages
We will follow some steps
- First, you must create a new intelligence following the steps from Creating an Intelligence.
Now, let's work on the intelligence
- Define intelligence context
- Define required Intents for its purpose
- Create example sentences for each intent
- Train the model based on theses examples
- 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.
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.
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*.
* 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