Intents in Bot Builder
and determines the closest match from the configured intents. The bot can then respond to the contact, using the response configured in a story
or rule
for the matching intent.
Every utterance a contact sends has an intent. Many messages relate to the reason the contact is reaching out to your organization. The intents for those messages relate to tasks your bot handles, such as resetting passwords or giving directions and business hours. Other messages follow social scripts where the intents are greetings, goodbyes, thanks, small talk, and so on.
Intents are the starting point when configuring a new bot. You create an intent and provide examples of messages that contacts use to convey that intent. Next, you configure how you want the bot to respond to the intent. For example, you can have the bot ask follow-up questions, respond with an answer, offer the contact choices, or transfer to a human agent.
Working with intents is an important part of configuring your bot during the implementation process. After deployment, it's critical to continue working with your intents as part of the ongoing management of your bot.
Intent Training Examples
Intent examples train your bot on the various ways a contact might express an intent. The more examples of an intent you have, the more variations of that intent your bot will be able to correctly identify. Use real-world conversation data to
During the planning phase of the implementation process, you gather records of real conversations your agents have had with contacts. Use these conversations as a source of intent training examples to add to your bot.
Intent Prediction and Confidence
Your bot analyzes each message the contact sends. It determines how closely the message matches each of its configured intents and calculates how confident it is in each match. The higher the confidence percentage, the better the match. The bot uses the intent with the highest confidence percentage that's over the configured threshold.
If the bot's confidence level falls below the threshold of all of the configured intents, the NLU fallback option is triggered. You can configure the threshold that triggers fallback on the NLU > Fallback tab in Bot Builder.
Out-of-Scope Intents
There may be tasks that you haven't configured your bot to handle yet, but that you know contacts will ask about. Out-of-scope intents help your bot recognize questions about tasks the bot cannot help with and provides the contact information about how they can accomplish the task. They can also provide lists of what they are able to help with.
For example, if contacts regularly ask your bot to do balance checks, but you haven't configured this task yet, you can create a balance_check intent. Add training data examples to it from the requests made by contacts. Then, create a rule for the intent with bot responses such as:
- "I'm sorry, I can't do a balance check yet. Would you like me to transfer you to someone who can help with that?"
- "I'm sorry, I'm not able to do a balance check yet. I can help you with updating your address, resetting your password, and finding branch locations. What would you like to do?"
Along with an out-of-scope intent, you also need to create a story to train the bot for an out-of-scope path. This teaches the bot how to handle various situations that aren't covered by other intents.
Out-of-scope intents are similar to fallback, but they can provide a better customer experience. Having intents for the common questions people ask your bot that are out of scope allows you to provide responses customized for each question. This helps your bot seem more human-like and conversational.
Intent Confusion
A bot may sometimes choose the wrong intent for the contact's message. This can happen when two intents are similar enough that the bot has a hard time telling them apart. This is intent confusion, and it can happen if you use the same training data for more than one intent. Two user goals might seem different but start to gather similar examples over time.
Keep your intents and their training data distinct. If you want to reuse training examples for more than one intent, it's a sign that you might be able to merge the intents into a single, more general intent instead.
There are two common scenarios where intent confusion happens:
- Providing information: Your bot might ask the contact to provide information at various points in a conversation, so you could end up with intents such as provide_email and provide_name. However, training data examples for these variations are too similar:
- "My name is Sherry Khan."
- "My email is sherry.khan@email.com."
- "It is Nathoo Mannkind."
- "It's nathoo@otheremail.com."
- Asking for information: A contact might ask the bot for information, such as an account balance. If there are several types of information a contact could ask about, you might have an intent for each type. For example, for an account balance request, you could have intents for balance_checking and balance_savings. However, training data examples for these variations are too similar:
- "Could I have my checking account balance?"
- "What's my savings balance?"
- "Can you tell me my checking account balance?"
The only real difference in the training data examples for each of the preceding scenarios is the entity that's provided.
Avoid Intent Confusion
The general rule to follow to fix intent confusion—or to avoid it—is to merge intents and train on entities. It's better to have a single, general intent that you apply all your training examples to, then use stories to train the bot to recognize the entities. When the bot can recognize the entities in contact utterances, it can take the appropriate path.
The following table shows the common scenarios from the preceding section. It demonstrates the original intents, the new general intent, and example training stories to use.
Scenario | Original Intents | New, General Intent | Train with Stories |
---|---|---|---|
Providing information |
provide_address provide_email provide_name |
provide_info |
Create several stories that start with contact message examples that contain the various types of information the bot can collect:
All stories trigger the same intent, provide_info. Each story uses a different entity, such as accountAddress, accountEmail, and accountName. The last example, "I need to update my info," doesn't state a specific type of information, so the bot might need to ask a follow-up question. |
Asking for information |
balance_checking balance_savings balance_giftcard |
balance_checks |
Create several stories that start with contact message examples such as:
All stories trigger the same intent, balance_checks. Each story uses a different entity, such as balanceChecking, balanceSavings, balanceGiftCard. The last example, "What's my account balance," doesn't specify an account type, so the bot might need to ask a follow-up question. |
Multi-Intents
Bots built with Bot Builder can identify one or more intents
in a contact's message
. Identifying more than one intent in a message allows your bot to correctly handle requests such as "Please show me my balance and transfer $200 to my savings account."
If you create a multi-intent from two existing single intents, you don't have to provide many examples. Your bot can recognize the single intents in the message and handle them as a multi-intent.
Only use multi-intents when they are really necessary to the natural flow of conversation. Too many multi-intents can make your bot too complicated to manage easily.
Intent Review and Management
Each intent on the Intents tab in the NLU section has a number next to it. The number indicates how many training examples that intent has. The numbers are color-coded to indicate if the training examples are sufficient:
-
Red: Intent is used up to seven times. Add more training examples.
-
Orange: Intent is used between eight and fourteen times. Add more training examples if possible.
-
Green: Intent is used more than fifteen times. No more training examples are required.
Some intents may have a yellow triangle next to the number of training examples. This indicates that there are no dialogues
that include this intent. If you have intents with this symbol, add them to stories or rules as appropriate.
On the Intents tab, you can also perform the following intent management tasks:
- View the dialogues (stories and rules) an intent appears in.
- See recent contact messages and the intent predicted for each one.
- Hide an intent from training.
Best Practices for Intents
Follow these best practices when creating intents:
- Intents aren’t always clear-cut. Two user goals might seem different but start to gather similar examples over time. Keep your intents and their training data distinct. If you want to reuse training examples for more than one intent, it's a sign that you might be able to merge the intents into a single, more general intent instead. This helps you avoid intent confusion.
- Always include an out-of-scope intent. Out-of-scope intents allow your bot to respond to contact requests that are outside the tasks the bot is trained to do.They allow you to recover the conversation and often result in improved performance.
- Use multi-intents sparingly. Only use multi-intents when they are really necessary to the natural flow of conversation. Too many multi-intents can make your bot too complicated to manage easily.