Adding Entities
Entities are variables or parameters, which can be used to configure multiple dialogs of a task-oriented robot to recognize specific customer purposes. They can also be used to temporarily store parameter values in interfaces for future calculation. For example, when a customer needs to purchase a flight ticket, you need to know the departure city, destination city, departure time, and flight company for the flight. The departure city, arrival city, departure time, and flight company can be considered as 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 ). 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 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.
- Choose .
- Choose Create, and choose General entity. . Click
- Set Name, click Create to add entity values and their synonyms, and click Save.
- Click Test Entity in the upper right corner, and enter an entity value or synonym in the text box. If the AI robot 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.
- Choose .
- Choose Configuring a General Entity. A direction entity includes four elements: East, West, South, and North. . Add a general entity that indicates a direction by referring to
- Click Create, and choose Composite entity.
- Set Name, and click .
- Configure a composite entity.
- Select the entity added in 2 from the drop-down list.
- Click to add the second drop-down list, and select @system.number (indicating a number) from the drop-down list.
- Click to add the third drop-down list, hover the pointer over the drop-down list, click next to the drop-down list to switch from the entity selection mode to the text input mode, and enter Meter.
- Click Save.
Configuring a Rule Entity
You need to add a rule entity to identify a company name entity of XXX Co., Ltd.
- Choose .
- Choose Create, and choose Rule entity. . Click
- Set Name.
- Set parameters as follows:
A rule supports the following filtering of a character string:
- If both Part-of-speech and Suffix are set, the character string that meets the part-of-speech requirement is obtained after the suffix is matched. The length of the character string cannot exceed the value of Maximum 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 set Part-of-speech to 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.
- If Part-of-speech is not set, characters between the prefix and suffix are used. The length cannot exceed the value of Maximum length.
Exact 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. The matched entity is XX Co., Ltd.
- If both Part-of-speech and Suffix are set, the character string that meets the part-of-speech requirement is obtained after the suffix is matched. The length of the character string cannot exceed the value of Maximum length.
- Click Save.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot