Intent
Last updated
Last updated
As mentioned before, Intent is to understand "what the user is wanting". Therefore knowing how to identify the intentions of the user during a conversation is essential so that the attendance can flow naturally.
To start using Intentions in the bot, my suggestion is to first list the main intentions the user might have when talking to the bot.
For example, if the bot is responsible for serving a restaurant and jotting down the orders, these could be examples of intentions:
Show Menu
Meal Request
Order Closing
Also understand that the Intention must be directly related to an action (or step) of the conversation flow. That is, once we identify the Intention of the user, an action must be performed to serve this Intent.
Okay, let's first understand how to identify an intention, then we come back to this action.
For bot to understand how to identify an intention we need to include some samples of messages (or examples) of how the user could express about this intention.
So we included 3 to 10 samples just to "teach" the bot to understand that when he reads a message similar to this, he should consider the intent of this sample. How similar the bot should consider will be defined in the Matching Probability field.
When placing each sample message, if you have registered the entities, an extraction is done just below the message to validate how it will be done when the user sends a similar message.
At the same time that you define message samples, you also define the variables that can be made available for this Intent.
Using the samples from the example above, we have:
The variables can be used, for example, in the Flow Plugin step Javascript. Just make reference added 'context.' the front of the variable name.
The variables will be available only during the time of the current context, so after the context timeout these variables will be cleared.
At the end, when the intent identification is completed and the possible variables defined, an action of the Flow is indicated to be executed, in order to proceed in the service to the user.
Good considering that you have already registered one or more intentions. Let's summarize now how bot deals with this.
When the user sends a text message the bot performs 3 steps:
1. Query between registered intentions, and evaluate which intention best represents the message. This evaluation is done by comparing the message with all samples (or examples) of messages and calculates if the probability of Matching is greater than or equal to that defined in the intention register.
2. Given matching, the intention is chosen with the highest matching, and verifies if this intention has Intention Variables. These variables are responsible for identifying Entities and their respective values. This variable can be accessed within the conversation stream later, by accessing the context object.
3. To conclude, a conversation flow action is performed to continue the conversation with the user.