The chatbot uses artificial intelligence to analyse users' messages and to find the most relevant reply.
Understanding the Scoring
Each default intent has a set of queries, conditions, triggers or keywords. These are used to anticipate what customers might ask the chatbot, in which circumstances. Each message the customer types will be compared against these various factors and will be assigned a match score.
The score is typically between 0 and 1, though certain factors, like triggers can increase it further. For an intent to be returned, and its reply used, the match score typically needs to be 0.8 or higher. This value is sometimes referred to as the threshold.
If there are multiple intents that get scores of more than the threshold, chatbot will return the intent with the highest score. If there are no intents that get a score of more than 0.8, chatbot will return a Fallback intent.
The closer a customer's message is to the queries and keywords you have taught the bot, the better the score is, allowing the bot's reply to be more accurate in turn.
Scoring with queries
Let's look at a practical example. We have created an intent that lets the bot respond if the customer asks how it is doing. In the intent, we define several variants of the base query to help capture several ways the customer might ask it.
If a customer asks the question in a way that exactly matches one of the variants for the query, we would expect it to have a match score of 1. If we look at a conversation where that happens in the Conversations page of Studio, we can see exactly that:
If we look at a conversation where a customer asked something similar but not exactly the same as we defined:
In this instance, the message is not an exact match (we didn't include a variant that included the word "today"). As a result, the match score is lower, 0.833, but still above the threshold of 0.8. The bot still responded.
Scoring with keywords
With keywords the match score can exceed 1. Consider this alternative to using queries in the previous example. If the customer's message includes the keyword how it would match the first keyword group. If it contained at least one of the keywords doing, everything and world it would match the second group.
As there is there is an and between each keyword group, there must be matches in all keyword groups for this to intent to be considered. When all of them match, we get a score of over 1.
In this example, matching the keywords has given a match score of 1.21, and the response was generated.
Keywords and especially keyword groups produce a higher score, letting you be more certain that particular replies will be generated. However, carefully choosing keywords is important, and the above example would likely be a poor choice in a real world scenario. The keywords are very generic and could result in false positives for all sorts of questions, such as "How in the world is this right?".