Entities
Contact utterances can contain a lot of information. You don't need entities for all of the information. You should only create entities for information that your bot needs to accomplish its goals. For example, contacts may provide their first and last name during an interaction. If the goal is simply to enable the bot to call the contact by their first name, there's no need to create an entity for the last name or the contact's full name.
When you create an entity, a corresponding slot Entity extracted from contact's message and saved for use in bot responses. Similar to a variable. is automatically created to hold the extracted information. Automatically-created slots must be modified to change the default settings.
Entities are closely related to slots. Slots hold information during an interaction until it's needed. An entity extracts information from an utterance and stores it in a slot. You can use the slot as a variable to use the information it holds.
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. |
Entity Types
There are two types of entities in Bot Builder:
- Regular expression (regex): Entities that follow regular patterns, such as phone numbers, order numbers, or email addresses.
- Lookup table: Entities that don't follow a pattern, such as ice cream flavors, report titles, sock styles, or colors.
Regular Expression Entities
A regular expression (regex) is a sequence of characters that specifies a search pattern. Creating a regular expression to extract entities teaches your bot a pattern to look for to identify the correct information for that entity Keyword or phrase defined in your company profile in Interaction Analytics. Related to an entity type. Can include variants.. This is useful for data that has similar, regular patterns, such as email addresses, phone numbers, and account or invoice numbers.
You can add a regex entity from the NLU section in Bot Builder:
- Entities tab
- Intents tab
Lookup Table Entities
Lookup entities are categories of information. In Bot Builder, they're lists of words, where every word is one member of the category. The list must contain every member of the category that your bot needs to know about. For example, if you create an entity for ice cream flavors, you need to provide every flavor that your company offers. You may also want to add flavors that your company doesn't offer but that are frequently requested, so your bot can respond to those requests with an out-of-scope path.
You can add a lookup table entity from the NLU section in Bot Builder:
- Entities tab
- Inbox, when viewing messages
- Intents tab, when working with intent examples
Lookup entities are not case-sensitive.
How Entities Work
To have your bot extract an entity Keyword or phrase defined in your company profile in Interaction Analytics. Related to an entity type. Can include variants. from an utterance What a contact says or types., you must label it in the appropriate intent examples and in the dialogues Bot stories and rules in CXone Bot Builder. for that intent. Labeling tells your bot when you want it to extract an entity from an utterance and helps associate the entity with the intent. Labeling is required for regex entities, but still helpful for lookup table entities.
To label an entity, you must select it in the utterance and then choose the kind of entity that the word or phrase represents. You can do this from the NLU Inbox, in intent examples, and from a story or rule.
During an interaction, the bot predicts an intent for an utterance. If the intent contains a labeled entity, the bot checks the utterance for a string that matches the pattern established in a regex entity or one of the examples in a lookup table entity. If it finds a match, the bot extracts the value and stores it in the entity's corresponding slot Entity extracted from contact's message and saved for use in bot responses. Similar to a variable.. That information is then available to use during the interaction.
Entities are always extracted and saved in the corresponding slot when the bot recognizes them. If the bot recognizes an entity but doesn't have a story Used to train bot for interaction handling based on intent and context or rule Used to define bot's response to messages that don't change with context. that shows it what to do with the information, it will ignore it. However, the presence of the entity it doesn't know what to do with can lower the bot's confidence in predicting the correct intent The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish.
There may be times when you only want the bot to fill an entity's slot in certain circumstances. You can configure restrictions on when the bot can fill each slot. Restrictions can be based on the intent, a form, or both. Not every slot filling method supports both restrictions.
Entity Examples and Synonyms
After creating an entity, you must provide examples to help the bot learn to recognize it. Examples are different for each type of entity:
- For regex entities, examples should be real-world representations of the type of data the bot will encounter during interactions. For example, for a phoneNumber entity, use real phone numbers.
- For lookup table entities, the examples must be members of the category that the entity represents. For example, the iceCreamFlavors entity might have examples such as chocolate, vanilla, and strawberry. The examples list must contain every member of the category that your bot needs to know about.
For lookup table entities, you can also identify synonyms for each example. Synonyms allow you to teach the bot the various ways contacts might refer to the same entity value. For example, New York City can also be called NYC, NY, New York, and the Big Apple.
You can add entity examples and synonyms in the following places in Bot Builder:
- The Intents tab, when adding examples to an intent.
- The Stories and Rules tabs, when creating a dialogue Bot stories and rules in CXone Bot Builder..
- The NLU Inbox, when reviewing messages sent to the bot.
Label Entities to Teach the Bot to Use Them
After you create entities A piece of information gathered from the contact's messages during conversations with a bot., you need to select and label them in the stories Used to train bot for interaction handling based on intent and context, rules Used to define bot's response to messages that don't change with context., intent The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish training data, and NLU Inbox messages where they appear. Labeling teaches the bot that an entity is important in the context of the intent of the messages where it's labeled. Labeling also:
- Adds the highlighted text as an example of the entity you select. If the example already exists, nothing new is added.
- Instructs the bot to extract that entity from the utterance. You can then use or store the entity's value, such as updating a customer record or allowing the bot to use the contact's name.
Both regex and lookup entities need to be labeled. For regex entities, this is required to teach your bot to recognize the regex pattern. For lookup entities, it teaches your bot that the entity is an important part of the intent.
You can label entities in stories and rules, intent training data, or NLU Inbox messages.