Entities
An entity is a unit of the NLU core of CAILA. An entity is a sequence of words linked by an intent or rule. For example: names, date and time, location, etc.
More about working with entities in a script
Custom entities
Custom entities are entities that the developer enters and constructs in the entity editor.
Open the project, click CAILA > Entities in the dashboard. You have navigated to the project entities dictionary.
Entity settings
Click Create entity > specify the entity name.
Recognized
Click the recognized
button above the entity name to have the entity recognized in the chat. Click this button again to disable recognition.
Let us have a look at how the script works with different settings:
State | Behavior |
---|---|
Enabled | Entity is recognized in the conversation. The intent referring the entity will be triggered, the slot will be filled, metadata for that entity will appear in the script. |
Disabled | Entity is not recognized in the conversation. The intent referring the entity will not be triggered, the slot will not be filled, metadata for that entity will not appear in the script. |
Client
Click client
under the entity name to make its value unique for each client. Click this button again to enable this function.
Let us have a look at how the script works with different settings:
State | Behavior |
---|---|
Enabled | Entity values and metadata are unique for each bot client. Data obtained from clients are filled in via the API or in the chat. |
Disabled | Entity values and metadata are specified by the bot developer and are common for all the clients of the bot. |
Learn more about using client entities
Spelling correction
The Spelling correction feature can be used to correct spelling errors in client requests. If this feature is enabled, possible spelling errors are taken into consideration when entities are being recognized.
Please note that this function is only available for Russian and Ukrainian language projects.
Let us have a look at how the script works with different settings:
Setup | Behavior |
---|---|
Correct spelling errors | Entities will be recognized after the system corrects spelling errors using the client dictionary. |
Do not correct spelling errors | Entities will be recognized in the original phrase without correcting spelling errors regardless of project settings. |
Additional settings
Word normalization
When the Normalize words setting is enabled, all the words contained in the request are normalized before being searched for entities.
Normalization is supported for English, Russian, and Ukrainian only.
Please note that words included in the entity dictionary do not get normalized, no matter what the value of the setting is. This implies that in order to achieve optimal entity recognition results, you should always specify the entity synonyms in their dictionary forms.
Fuzzy search
By default, the search for entities in client requests is performed in “strict” mode: if an entity name consists of several words, they are all required to be contained in the request one after another.
However, if the Use fuzzy/substring search setting is enabled, the search for entities allows for a greater request diversity:
- Words comprising the entity name can have unrelated words in between them.
- Some words comprising the entity name can be omitted altogether.
Consider the following example: a @City
entity matches the cities of the world. The record for New York has new york as its only synonym. However, if the entity has fuzzy search turned on, the entity will be found in such requests as york as well as new freaking york.
Intent expansion
The Automatically expand intents setting is best explained by example:
- The
@agent
entity is defined with a number of synonyms, e.g. agent, helper, support. - The
/Switch
intent is defined and trained on a single phrase, transfer me to an agent. - If the client says transfer me to support, the
/Switch
intent will be recognized.
This means that if an entity has this setting turned on, then its synonyms contained in intent training phrases are automatically expanded to all words recognized by this entity. This feature makes building the training set for your intents much easier.
This setting is only available for the STS classifier.
Dictionary
An entity is defined via a set of values that it can take on. In the dictionary window click Add record. Select one of the methods for specifying the values:
- Synonyms – specify the set of synonyms: all the spelling variants which will be equivalent to this value.
- Pattern – specify the pattern: a formal rule that describes key words and expressions. Use the basic pattern elements.
You can also specify DATA
(name of the entity in the string
or JSON
format) as additional reference data.
System entities
System entities are built-in entities that the developer can activate in the entity editor.
You can activate the recognition of system entities. Open a project and click Editor > Entities > System entities in the toolbar.
Click the entity name to view its description and recognized formats.
To activate a system entity enable the checkbox next to its name. As soon as the status is changed, the platform will start recognizing this entity in the messages sent to the chatbot.