As we have seen so far, we can create a fully functional chatbot through conditions in which it is not necessary to incorporate Artificial Intelligence: if the answer is equal to, if the user’s answer contains, if a global variable starts with…
It’s time to see how Artificial Intelligence works inside our chatbot. The system used is NLP (Natural Language Processing), and its function is to try to understand the meaning of a text. In order to understand a sentence, it is necessary that we have previously trained Artificial Intelligence.
Intents are the different expressions by which a human being can refer to the same action.
That is to say, a person, in order to ask about a state of mind, can do it in many different ways: How are you? How are you? How are you feeling? All of them are phrases that we would use as an example to train our chatbot in an intent that we could call: “Question_animal_status”.
For the Artificial Intelligence engine to work, it is necessary to write at least two intents, with 8 example phrases each. Although we recommend to create a higher number to improve your intelligence.
Once we have created the different intents, we must click on “Train the bot now” to start the training. Don’t worry, it will only take a few seconds.
If we want to check how Artificial Intelligence is working, you will see, in the “Intelligence” tab of our bot, you will see a tab called “Testing“.
In “Testing” you will be able to write the example phrases to check the level of precision with which your bot is working. The more intents you have, the lower the accuracy, as the weights are distributed among more options.
Once you see how accurately your bot is working, you can create “global connections” in your interactions (preferably subchats).
By default, for an interaction to be activated by detecting an intent, it must be more than 50% accurate. If in the “Testing” part you notice that because you have a high number of intents, the precisions are lower, you will be able to select the “Activate precision” option. You will find this option inside the connection, and you will be able to choose the minimum precision that must be met for that interaction to be activated.
I’ll give you an example of what the intents part looks like.
We use them to disambiguate a dialogue. It is possible that the same intention has a different meaning and we use the entities to know the correct sense of prayer.
Let’s look at an example:
Example sentence 1: I would like to drink a juice
Example sentence 2: I would like to drink a soda
If we select soft drink and juice as entities we can disambiguate the meaning of the phrase, and guide you through different dialogues.
This is why entities are used, which are a limited subset of options that can be identified by the service, disambiguing the intent.
Within the platform we will be able to create and classify these entities in two ways:
From the intent created: clicking and selecting a word you can create the entity and indicating its name.
Within the tab “Intelligence” you will find in the left side menu the “Entities”, where you will be able to create them directly.