Intents
Intents are the fundamental units underlying the NLU service which represent the intentions expressed in user requests. Each intent is a combination of:
- User intention metadata.
- A set of phrases and/or patterns for training the classifier to understand this intention.
- Information on slots — entities which specify the intention.
Intent creation
Open a project and select CAILA > Intents in the toolbar. You are now in the project intents menu.
Click Create intent and fill out the intent data. Only the Name field is required.
Field | Description | Note |
---|---|---|
Name | Intent name. | Under the input field, you can see the full path to the intent in the project intent tree. This path is calculated automatically and is used to reference the intent from the script. |
Description | An additional comment to the intent. | |
Answer | The default reply to the intent. | You can reference this reply from the bot script as $context.intent.answer . |
The toggle next to the name input field enables or disables the intent. Disabled intents are ignored by the classifier.
Training phrases
In the Training phrases section, you can add phrases and/or patterns which will be used for training the classifier to recognize the intent.
To add a new phrase to the training set, enter the phrase into the input field and press Enter. You can search for training phrases by clicking . Tick the checkboxes to the left to select and delete unneeded phrases from the set.
Don’t forget to click on the top navigation bar to train the classifier using the new training set.
Patterns
Phrases are the default way to train the classifier,
but you can also use patterns to write formal descriptions of phrases matching a specific intent.
This approach to using patterns is alternative to using the q
and q!
tags.
Click to switch to pattern input mode or to convert an existing training phrase into a pattern. Click to switch back to phrases.
The syntactic features of patterns used in intents include all basic and most advanced pattern elements, with a small number of exceptions:
- The
$morph
pattern and mappings like(one:1/two:2)
are not supported. - Modifying the pattern weight with the
$weight
element is not supported either. - Instead of named patterns
$pattern
and entities$entity<>
, you should use CAILA entities.
The names for CAILA entities start with @
.
Batch phrase insertion
Instead of adding each new training phrase one by one, you can compile the training set in your favorite text editor and then paste the whole set into the input field.
Every pasted line will be converted to a separate training phrase.
Slots
Slots are entities mentioned in the initial request or during request clarification so that it can be fulfilled. The process of requesting this data is called slot filling.
Click Add slot and fill out the slot parameters:
- Name is the slot name.
- Entity is a system or user-defined entity defining the slot data type.
Customize the following parameters if necessary:
- Required: enable this toggle if the intent cannot be processed with this slot unfilled.
- Is Array: enable this toggle so that all entities of the matching type are placed into the slot as an array.
- Questions: specify the questions asked by the bot to clarify unfilled slots.
Nested intents
Intents can be nested into one another.
Click
next to the intent name and select Create nested intent.
Intents can be nested to an arbitrary depth.
All intents form a tree structure shown on the sidebar.
The tree nodes are sorted alphabetically.
Next to each node, the /
character delimits the number of training phrases in the current intent and that within all nested ones.
Nesting can help organize intents into a hierarchy and group similar intents together. This makes it easier to navigate and edit them.
How to use intents in the script
Intents supplied with the necessary data can be used to trigger states in the bot script.
Refer to the local intent
or the global intent!
tag reference to learn how.