Entity types are used to control how data from the end-user input is extracted.
Entity type defines the type of information you want to extract from the user’s input. For example, vegetable could be the display name of an entity type.
Customer Care provides pre-defined system entities that can match many common types of data. For example, there are system entities for matching dates, email addresses, true/false and text.
You can also create your own custom entities for matching custom data. For example, you could define a furniture entity that can match the types of furniture available for purchase at an online interior design store..
Methods (Type kryssar man för när man lägger till en entity)
There are 2 types of methods to
1. Key. (Vi säger Keywords)(Entity entry)
For each entity type, there could be many Keywords (entity entries). Each entity Key (entry) provides a set of words or phrases that are considered equivalent. For example, if vegetable is an entity type, you could define these three Keys (entity entries):
- scallion, green onion
- bell pepper, sweet pepper
Keywords. (Entity reference value and synonyms)
Some Keys have multiple words or phrases that are considered equivalent, like the scallion example above. For these Keys, you provide one reference value and one or more synonyms.
By default, entity matching requires an exact match for one of the Keys (entity entries). This works well for single-word Key (entity entry) values and Keywords (synonyms) but may present a problem for multi-word values and synonyms. For example, consider a ball entity that should be matched for the following end-user expression parts:
”small red ball”
”small ball red”
”red small ball”
”red ball small”
”ball small red”
”ball red small”
For a match to occur, you normally need to define a Key (entity entry )value and Keywords (synonyms) for each of these permutations. However, with fuzzy matching enabled, the ordering of the words in a value or synonym does not matter. The following will trigger a match for all of the examples above:
”small red ball”
2. Regular expression.
Some entities need to match patterns rather than specific terms. For example, national identification numbers, IDs, license plates, and so on. With regular expression entities, you can provide regular expressions for matching.
Each Regular expression entity corresponds to a single pattern, but you can provide multiple Regular expressions if they all represent variations of a single pattern. During bot AI training, all Regular expressions of a single entity are combined with the alternation operator ( | ) to form one compound regular expression.
For example, if you provide the following regular expressions for a phone number:
The compound regular expression becomes:
Limitations of Regular expression
The following limitations apply
Fuzzy matching cannot be enabled These features are mutually exclusive.
Maximum number of 50 regular expression entities.
The maximum length of compound regular expression for an entity is 1024 characters.