Teach Your Bot to Have Conversations
This page describes the essential tasks required to build a bot in CXone Bot Builder. This is the third step in the bot implementation process.
Concept | Definition | Example | What the Bot Does |
---|---|---|---|
Utterance |
Anything a contact says in an interaction. Sometimes called a message. |
"I lost my password." "What is my balance?" "Are you a bot?" |
The bot uses Natural Language Understanding (NLU) to analyze each contact utterance to determine its meaning, or intent. |
Intent |
What the contact wants to communicate or accomplish. Every message the contact sends has an intent. |
"I lost my password" has the intent of "reset password". "Hello" has the intent of "greeting". |
The bot analyzes a contact's message using NLU This process expands on Natural Language Processing (NLP) to make decisions or take action based on what it understands. to determine the intent. Once it knows that, it can respond with a message of its own. You configure the response you want the bot to use for each intent. |
Entity |
A defined piece of information in a contact's message. | Person or product name, phone number, account number, location, and so on. | The bot uses NLU to identify entities in a contact's message. Entities help the bot understand what the contact's message means. |
Slot |
An entity extracted from a contact's message and saved for use in bot responses. Similar to a variable. | Creating a slot for contact name lets the bot use that name in responses during an interaction, making it more personal. | When configured to do so, the bot extracts an entity from a contact message and saves it in a slot. You can have the bot use this information later in the conversation. |
Rule |
Defines a bot's response to messages that don't change meaning with context. |
|
Rules are one of two ways you can configure how the bot responds to an intent. Rules are useful for certain kinds of intents, but not all intents. |
Story |
Trains a bot to handle an interaction based on message intent and conversational context. | In an interaction about a forgotten password, the bot would respond to, "How do I do that?" in one way. If the interaction were about creating a new account, the response would be quite different even though in both cases the contact is using the same words with the same intent – to get more information. | Stories are the second of two ways you can configure how the bot responds to an intent. Stories teach the bot how to use the context of the conversation to respond appropriately. |
Bot Action |
Anything a bot says or does while handling an interaction. |
In an interaction about a forgotten password, the bot responds by sending the link to the password reset FAQ on the website. When a contact expresses frustration, such as "I don't understand! It's not working!!!" the bot responds with "I'm sorry. Would you like me to transfer you to a human agent?" When the contact says yes, the bot initiates the transfer. |
Actions are the options you have when defining how you want the bot to respond to each intent. They give you the flexibility to configure each response to achieve the outcome that meets the contact's needs. |
Teaching Your Bot to Have Conversations
You don't need to script each possible variation of a conversation. Bot Builder bots use conversational AI technologies, which allow them to understand contacts' meaning and respond appropriately without being scripted. However, you do need to teach the bot how to handle conversations with contacts. You do this by creating conversation templates using rules Used to define bot's response to messages that don't change with context. and stories Used to train bot for interaction handling based on intent and context in Bot Builder.
Rules and stories, also known as dialogues, teach the bot how to respond to the contact utterance What a contact says or types. by utterance. Each dialogue focuses on a specific, small part of the conversation. They generally consist of a contact utterance, the corresponding intent The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish, and the bot's response.
You may need more than one dialogue for a given intent. There might be some situations where you want your bot to respond differently to the same intent based on certain criteria. You can teach the bot how to tell the difference by creating multiple dialogues, each their own unique response and the criteria that define when the bot should give that response.
How Dialogues Teach the Bot
During an interaction with a contact, the bot analyzes the contact's utterance and identifies the intent. If the intent only has one configured dialogue, the bot responds according to that dialogue's configured response. If there are several dialogues for the intent, the bot analyzes the conversation to detect clues for which version of the dialogue it should use.
The following diagram shows the bot's logic in responding to a contact:
Bot Responses
Bot responses can be as simple or as complex as you want to make them. Bots can:
- Reply with information or questions.
- Display images, GIFs, videos, or links to web pages. They can include buttons or lists that the contact can interact with.
- "Choose" which action to take using conditions. You can configure multiple possible responses based on what the contact says.
- Follow a form to collect information from the contact.
- Escalate the interaction to a human agent.
Bot responses are built in dialogues Bot stories and rules in CXone Bot Builder. and consist of one or more of the available bot actions. Bot actions perform a specific function. Some bot actions send content to the contact, such as a message or a list of options to choose from. Other bot actions perform tasks that are invisible to the contact, such as calling an API or pulling data from or storing data in a third-party application.
Bot Builder has a set of default bot actions that you can choose from, but you can create custom bot actions. Custom bot actions can be make API calls or be designed with custom JavaScript.
Skill Store
Bot skills allow you to group your bot's configurations and training data according to what your bot can do. You can use them to filter training data, which makes it easier to focus more specifically each task your bot can accomplish.
Bot skills are also used to distribute pre-made abilities to Bot Builder users via the Bot Builder Skill Store. NICE CXone uses the Skill Store to provide integrations with various CXone features and products.
For example, if you want to use your CXone Expert knowledge base with your Bot Builder bot, you can add the Enlighten Autopilot Knowledge bot skill to your bot. This adds all the necessary rules, stories, intents, entities, slots, scripts, and so on to your bot.
You can design bot skills and submit them for approval to be added to the Skill Store. NICE CXone reviews them and will add them to the Skill Store if they're approved.
Train Your Bot
Training your bot helps it learn from the configurations you've made. The better the quality of the training, the better the bot's ability to correctly predict intents will be. Training happens in the following ways:
- When you add training data to the bot: Training data are the examples you add to intents The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish. If you add lots of high-quality examples, your bot can more effectively build associations between words, phrases, and intents.
- When you create stories and rules: Stories Used to train bot for interaction handling based on intent and context and rules Used to define bot's response to messages that don't change with context. teach the bot how to respond to an intent. If the intent has enough high-quality training data, the bot learns to recognize different ways contacts express the same intent .
- When you create stories to teach the bot about intent variations: For general intents with variations that impact the bot's response, you use stories to teach the bot to differentiate between the variations. This helps your bot learn to navigate the nuances of contacts' requests and respond correctly.
You can test how well-trained your bot is by chatting with it in Bot Builder. By chatting with your bot, you can see where it has problems and make corrections immediately.
Part of the ongoing training process is working with your bot to make it smarter. The smarter your bot is, the more effective it is at predicting intents and choosing the correct response. You can make your bot smarter by reviewing conversation data and making changes to your bot in response to problems found in the conversation data. You can review and improve your bot
Training Data
Intent The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish 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
You can review your intents to see which ones need more training examples. Each intent has a number next to it that indicates the number of examples it has. Intents with 14 or fewer examples need more, if possible.
Train and Stage Option
When you are ready to test changes you've made to your bot, you can click Train and Stage. This adds the changes to the bot so you can test them. Additional training through conversations may be required to refine the bot's understanding of the configuration.
If you are making improvements to a bot that's been deployed to production, Train and Stage creates a new bot model Version of a bot that has been trained and staged and deploys that model to
You can use the health monitor to track the progress of trainings initiated with Train and Stage.
Train Your Bot with Stories and Rules
Stories allow you to teach your bot how to respond to messages Anything a contact says in a bot interaction, whether question or statement, written or spoken. in the context of an interaction The full conversation with an agent through a channel. For example, an interaction can be a voice call, email, chat, or social media conversation.. You can create stories from scratch or convert actual conversations into stories. Rules teach your bot to respond to messages whose meaning doesn't rely on context.
Sometimes you may need to create multiple stories for a single intent. This is useful when there you want your bot to respond differently depending on small differences in the intent. For example, if a bot can check account balances, you might want the bot to respond differently depending on the type of account the contact wants to check.
Stories and rules may need periodic updates and revisions. For example, if, after reviewing conversation data you discover that one of your stories is causing the bot to be confused and predict the wrong intent, you can address the problem by changing the story. In some cases, you might need to change the intent as well as the story.
Training Data Best Practices
When planning your approach to gathering training data and training your bot, keep the following best practices in mind:
- Always opt for quality over quantity. It's okay to start with a small data set and build it over time as you gather more high-quality examples.
- Use examples from real-world conversations. This ensures that the data you use is realistic. It comes from things real contacts have said.
- Don't use tools that auto-generate data and claim to train your bot A software application that handles customer interactions in place of a live human agent. faster. They often produce examples that don't reflect what contacts really say. They also can result in a bot that loses its ability to generalize. Over time, the bot reaches a point where it only recognizes phrases it's seen before.
- Do not use the same training data for more than one intent. If you re-used training data, the bot won't be able to reliably determine the intent in live interactions with contacts.
- Remain flexible and willing to adjust intents and stories over time. As you review conversation data, you may discover that what you thought was two separate intents are really shades of the same, more general intent. Or you may find that an intent is too broad, and you must break it down into more distinct intents.
- Add new training examples only if they will help.
- Do not add new training examples that are very similar to existing examples. If the bot correctly predicts the intent with a high confidence for an utterance, it doesn't help the bot to add additional similar examples.
- Do add more training examples of utterances the bot has previously predicted incorrectly or with low confidence.
Create Bot Responses to Train Your Bot
Configure bot responses with the following process:
- Create an intent.
- Create a rule or story for the intent The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish you created to define how the bot responds to that intent. Which one you create depends on the intent. Refer to the plan you made earlier in the bot implementation process. The high-level process of creating stories Used to train bot for interaction handling based on intent and context and rules Used to define bot's response to messages that don't change with context. is:
Stories and rules begin with something the contact might say. For example, for an intent called check_balance, the contact might say "Can you tell me my account balance?"
- After you enter an example of what the contact might say, Bot Builder attempts to predict the intent of the example contact message.
- Confirm the bot's prediction or choose the correct intent, then confirm it. If the bot's prediction confidence seems low, add more training examples to the intent.
Now you can add the bot's response using any of the available bot actions.
- Add another contact utterance, if the real-world conversation examples for this intent show that contacts tend to follow up the response (from an agent or a bot) with the same type of question or statement.
Continue the conversion in the story or rule, following the real-world examples you collected. Add as much back-and-forth interaction as you need to teach the bot how conversations about the intent should go.
Typically rules will consist of one contact message and one bot response. Stories can be made up of a series of exchanges between the bot and the contact. However, stories should not be complete conversations. When the next statement in the conversation would necessarily start a new intent, it's time to stop and create a new story. Alternatively, consider breaking stories into smaller substories.
Create multiple stories for the same intent if there are variations of how the conversation might go, based on the contact's unique situation and needs. This trains the bot to tell the difference between variations of a single intent.
Don't include variations of the conversation flow in the same story. This could confuse the bot.
If there are variations to the way a contact might phrase a message, or similar messages that all mean essentially the same thing, you can add them as examples of the intent.
Think in terms of happy and unhappy paths. Each intent can have more than one happy path and more than one unhappy path.
- If the intent, rule, or story requires them, create entities, slots, or forms.
Create entities only for information you need the bot to extract from the conversation.
- Create slots for data you need to save or use during the conversation.
- Consider using a form in a story or rule if you need to collect more than a couple pieces of information from the contact.
-
When you're finished making changes, click Train and Stage to update your bot model Version of a bot that has been trained and staged to test this change.
- Chat with your bot to test it. Based on the results of your conversation with the bot, you might need to make adjustments to the story or rule you created. You might also need to add or change the training data for the intent you're working with. Repeat the the training and testing steps as often as necessary until you're happy with the bot's performance.