Entities

Entities are pieces of specific information in contact messages, such as names, addresses, phone numbers, order numbers, and item numbers. You can use them to train your bot to extract information from contact utterancesClosed What a contact says or types.. Extracted information can be saved to use in bot responses. It can also be passed to CXone, or to third-party databases or applications via integrations.

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 slotClosed 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.

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 entityClosed 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:

Lookup entities are not case-sensitive.

How Entities Work

To have your bot extract an entityClosed Keyword or phrase defined in your company profile in Interaction Analytics. Related to an entity type. Can include variants. from an utteranceClosed What a contact says or types., you must label it in the appropriate intent examples and in the dialoguesClosed 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 slotClosed 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 storyClosed Used to train bot for interaction handling based on intent and context or ruleClosed 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 intentClosed 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

Label Entities to Teach the Bot to Use Them

After you create entitiesClosed A piece of information gathered from the contact's messages during conversations with a bot., you need to select and label them in the storiesClosed Used to train bot for interaction handling based on intent and context, rulesClosed Used to define bot's response to messages that don't change with context., intentClosed 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.