1. Home
  2. Kore.ai Conversational Platform
  3. Bot Builder Tool
  4. Defining Bot Tasks
  5. Dialog Tasks
  6. Working with the Entity Node

Working with the Entity Node

Bots need to extract relevant information from the user utterance to fulfill the user intent. Take a look at this sample utterance: Book me a flight from LA to NYC on Sunday.  To act on this user intent, which is to book a flight ticket, the bot should extract the entities such as the source city (LA), destination city (NYC), and the departure date (Sunday).

So, in a Dialog Task, for every critical data you want to get from a user utterance, you should create a corresponding Entity node. You can add Prompt messages to these nodes for users to input required parameters.

Kore.ai supports more than 30 entity types such as Address, Airport, Quantity, TimeZone. You can also define the entities as a selection from a list, free-form entry, file or image attachment from a user, or as regex expressions.

Note: You may need to follow one Entity node with several other Entity nodes to collect series of user inputs to complete a transaction, such as a username, location, amount, and due date, followed by a Webhook node to process a request to an API to complete an online transaction.

Setting up an Entity Node

Setting up an Entity node in a Dialog task involves the following steps:

Step 1: Adding an Entity Node to the Dialog Task

  1. Open the Dialog Task in which you want to add the Entity node.
  2. Hover over a node next to which you want to add the node, and click the plus icon on it.
  3. Click the Plus icon that appears after the node, and then select Intent > New entity node. The Component Properties panel opens.

Step 2: Configuring the Component Properties

Note: The configurations you set up or edit in these sections reflect in all other Dialog Tasks that use this node

  1. Enter a name for the Entity node. Entity names cannot have spaces.
  2. From the Type drop-down select an entity type depending on the expected user input. For example, if you want the user to type the departure date, select Date from the drop-down.
  3. In the User Prompt text box, type the prompt message that you want the user to see for this entity. For example, Enter the Departure Date. You can enter channel-specific messages for user prompts. For more information, see Using the Prompt Editor.
  4. In the Error Prompts box, review the default error message, and if required, click Edit Errors to modify it. For more information, see Using the Prompt Editor.
  5. In the Suggested Synonyms for the < Entity Name > box, enter synonyms for the name of your Entity. Press enter after each entry to save it. For more information, see Managing Synonyms.
  6. In the Suggested Patterns for < Entity Name >, click +Add Pattern to add new patterns for your Entity. The Patterns field is displayed. For more information, see Managing Patterns.

Step 3: Configuring the Instance Properties

Note: The settings in the Instance Properties pane are specific to the current Dialog Task and do not reflect in the other tasks that use the node.

Use the Instance Properties to determine whether to make the Entity value mandatory as well as choose if you want to allow used-up utterances to capture entities.

  1. Click the Instance Properties icon on the Entity node.
  2. Under the User Input section, select an option:
    1. Mandatory: This entity is required, and users must provide a valid entry before proceeding with the dialog flow.
    2. Optional: User is prompted only once for this entity and system proceeds with any input provided by the user.
    3. Hidden: If enabled, the bot will not prompt for the entity value unless explicitly provided by the user.
  3. Under the Entity Extraction section, select one of these options:
    1. Evaluate the un-used text from the previous utterance:  it’s the default option. When this option is selected, the entity only uses the text that is not used by any other entity in the dialog so far.
    2. Evaluate un-used text and text used for extracting entities from previous utterances: Select this option if you would like to reuse an entity value extracted by another Entity node in the dialog.
    3. Do not evaluate previous utterances and explicitly prompt the user: Select this option if you want the bot to ignore the previous user utterances and explicitly prompt the user to provide value for the entity.
  4. Click the Advanced controls to set up these options:
    1. User Prompts: Hit the Click to Override button to write custom user prompts for this particular instance of the Entity node. Once you override, the User Prompts section in the Component Properties pane becomes disabled.  Also, these user prompts do not apply to any other instances of the node.
    2. Error Prompts: Hit the Click to Override button to write custom error prompts for this particular instance of the Entity node. Once you override, the Error Prompts section in the Component Properties pane becomes disabled.  Also, these error prompts do not apply to any other instances of the node.
    3. Intent Detection (Applies only to String and Description entities): Select one of these options to determine the course of action of the bot if it encounters an entity as a part of the user entry for the String or Description entities:
      1. Accept input as entity value and discard intent detected: The bot captures the user entry as a string or description and ignores the intent.
      2. Use the preference selected for Hold & Resume setting and proceed: The bot refers to the preferred Hold & Resume settings. Read the Interruption Handling and Context Switching article for more information
      3. Ask the user how to proceed: The bot notifies the user about the detected entity and asks if they would like to trigger the entity. The task flow continues thereafter depending on the user’s selection.
    4. Precedence (Applies to all Entity types except String and Description nodes): When user’s input for an entity consists of a valid value for the entity and another intent, you can control the experience by choosing between “Intent over Entity” or “Entity over Intent” options. For example, if a Flight Booking bot prompts for the destination and the user enters, “Bangalore, how’s the weather there?” you get to predefine how the bot responds in such cases – pick the entity and add the intent to the Follow-up Intents stack or go ahead with the intent first
      .
    5. Hold & Resume: The node-level settings for Hold & Resume take the highest precedence over task level or bot level settings. By default, it is set to Use the task level ‘Hold & Resume’ setting. However, you can customize the settings by selecting the Customize for this node option.  Read the Interruption Handling and Context Switching article for more information.

Step 4: Configuring the Connections (or Transitions) Properties

You can add If-Else operators in the node’s Connections pane to determine which node in the dialog text to execute next. You can write the conditional statements based on the values of any Entity or Context Objects in the dialog task, or you can use intents for transitions.

To setup Component Transitions, follow these steps:

  1. Hover over the Entity node, and Click the icon. The Connections pane opens.
  2. On the Connections pane, click Add IF.
  3. Configure the conditional expression based on one of the following criteria:
    1. Entity: Compare an Entity node in the dialog with a specific value using one of these operators: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, and less than. Select the entity, operator using the respective drop-down lists, and type the number in the Value box. Example: PassengerCount (entity) greater than (operator) 5 (specified value)
    2. Context: Compare a context object in the dialog with a specific value using one of these operators: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, and less than. Example: Context.entity.PassengerCount (Context object) greater than (operator) 5 (specified value)
    3. Intent: Select an intent that should match the next user utterance.
  4. In the Then go to the drop-down list, select the next node to execute in the dialog flow if the conditional expression succeeds. For example, if the PassengerCount (entity) greater than (operator) 5 (specified value), Then go to Offers (sub-dialog).
  5. In the Else drop-down list, select the node to execute if the condition fails.
Note: If you want to write multiple If conditions, click Add Else If below the last If conditional expression.

Entity Types

The Entity Type provides the NLP Interpreter with the expected type of data from a user utterance to enhance recognition and system performance. For more information, see the Entity Types

Articles

Was this article helpful to you? Yes 6 No 2