Updated on 2023-09-20 GMT+08:00

Adding Entities

Context

Entities can impose specification constraints on the values filled in a slot, similar to defining data types for variables. Some entities are preset, such as system.date, system.time, system.number, and system.phonekeyboard. You can view entities on SYSTEM ENTITY and ENVIRONMENT ENTITY (by choosing Template Management > Entity Management). You can also click Test Entity under My Entity to check whether the variables that you need can be recognized. If the preset entities do not meet your requirements, customize your entities. Customer entities are classified into the following types:

  • General Entity: entity corresponding to a single variable. For example, a departure city, a destination city, and a flight company are general entities. For customized general entities, only enumerated values and their synonyms can be set. Complex functions such as fuzzy match cannot be implemented.
  • Composite Entity: combination of multiple entities. For example, an identity entity, a city entity, a region entity, and a street entity form a mailing address entity together. Composite entities are usually used to define complex and structured texts.
  • Rule Entity: entity that defines a fixed format (prefix and suffix), and part-of-speech (POS) rules. When a type of entity has fixed features in sentence expressions, for example, all entities have the same prefix or suffix, you can define a rule entity to expand the capture range of this entity.

During the application of an entity, the system matches the entity values with customer statements. If the matching is successful, the system considers that the entities are contained in the customer statements and uses the entity values for subsequent processing.

Configuring a General Entity

To add a flight company entity, perform the following steps:

  1. Choose Configuration Center > Flow Configuration > Intelligent IVR.
  2. Choose Knowledge Management > Entity Management. Click Add, and choose General Entity.
  3. Set Name and click Add to add entity values and their synonyms. Then, click SAVE and click OK in the dialog box that is displayed.

  4. Click Test Entity in the upper right corner, and enter an entity value or synonym in the text box. If the chatbot returns @Flight Company=Emirates, the configuration takes effect.

Configuring a Composite Entity

You need to add a location entity that indicates the direction and distance, for example, 100 meters eastwards.

  1. Choose Configuration Center > Flow Configuration > Intelligent IVR.
  2. Choose Knowledge Management > Entity Management. Add a general entity that indicates a direction by referring to Configuring a General Entity. A direction entity includes four elements: East, West, South, and North.
  3. Click Add, and choose Composite Entity.
  4. Set Name, and click Add.
  5. Configure a composite entity.

    1. Select the entity added in 2 from the drop-down list.
    2. Click , and select the second system entity @system.number, which indicates a number.
    3. Click behind the text box, click in the new text box to change the input mode from selecting an entity to directly entering a string, and enter Meter.

  6. Click SAVE.

Configuring a Rule Entity

You need to add a rule entity to identify a company name entity of XXX Co., Ltd.

  1. Choose Configuration Center > Flow Configuration > Intelligent IVR.
  2. Choose Knowledge Management > Entity Management. Click Add, and choose Rule Entity.
  3. Set Name.
  4. Set parameters as follows:

    A rule supports the following filtering of a character string:

    • If both POS and suffix are specified, the character string that meets the POS requirements is obtained after the suffix is matched. The length of the character string cannot exceed the value of Max Length.

      In addition to common adjectives, nouns, numbers, and quantifiers, special nouns are further classified into the following types.

      • Gerund: If you use phrases that can be used as verbs to compose the name of an entity, for example, XX Daily Wholesale Co., Ltd., you can specify the POS as gerund to better match the entity.
      • Localizer: Without the prefix and suffix, the remaining characters indicate a localizer such as front, back, upper, and lower.
      • OU name: Without the prefix and suffix, the remaining characters indicate an OU group.
      • Place name: Without the prefix and suffix, the remaining characters indicate a city and province.
    • When no POS is specified, characters between the prefix and suffix are used. The length cannot exceed the value of Max Length.

      Actual Matching determines whether the prefix and suffix are used for matching.

      Include Prefix In Entity Result and Include Suffix In Entity Result determine whether information corresponding to the prefix and suffix is used as the entity content. For example, in this example, Include Suffix in Entity Result needs to be enabled. After the entity is matched, the entity is XX Co., Ltd..

  5. Click SAVE.