Natural Language Understanding is at the core of advanced Virtual Agents. Cognigy.AI features an industry-leading NLU engine called Cognigy NLU.
Intent Mapping is at the core of the NLU engine and the process uses machine learning to match the user's utterance to the defined intents.
Want to learn how to use Intents?
Head over to Train your Virtual Agent to recognize Intents in the Help Center.
Watch this Episode of Cognigy Sessions for a technical deep dive
Intents can be created right within the Intents section of the NLU tab and can be fed with training data in the form of example sentences. These example sentences should include a certain degree of variation for the model to work well. The following image shows an example intent library within the intent creation menu:
Machine learning models work best with comparable amount of information on all intent classes. That is, ideally all intents have a similar amount of example sentence and are clearly separable in terms of content. While it is able to deal with imperfect input, it always helps if you make the job for the machine easier.
Make sure you do not have intents that are only a single word or sentence without useful information. Such intents may reduce the overall efficacy of the model.
If the NLU predicts the utterance is out of scope of the intent model, no intent will be triggered and intent will be set to
null in the Input object. You can add examples to the Reject Intent to intentionally prevent the NLU from recognizing any user inputs that are outside the scope of the virtual agent.
NLU model feedback¶
As soon as the model is trained, Cognigy NLU is able to provide feedback regarding the model's performance. This is shown using different colors, with green being good, orange being suboptimal and red being bad. Additional information is given on mouse-hover.
Number of example sentences
Intents must have at least five example sentences in order to train the NLU.
Intent Entrypoints can be used to alter the Entrypoint in the Flow after the NLU is executed. The three options are:
Execute normally Automatically set the Entrypoint.
Execute from START in this flow Executes the Flow using the Start Node.
Execute from a Node in this flow Executes the flow starting from a specific Node.
Intents can be configured with direct output (answers) in the form of so-called Default Replies. Default Replies are integrated Say and can be configured with channel-specific output.
You can override the setting to use the Default Replies as example sentences per each individual Intent. Per default, the setting is set to Use Flow Settings, meaning we will use the Flow Settings.
If this feature is enabled, the NLU will also use the configured default replies to train, improving the match rate for the configured intent.
Intents can be configured with a number of advanced options.
Tags can be used to categorize Intents, which makes it easier to manage them.
See Intent Conditions for more information on how to enable and disable Intents dynamically with CognigyScript Conditions.
Cognigy NLU comes with an intent confirmation mechanism that works by configuring Confirmation Sentences in each intent. Whenever an Intent score falls within a (configurable) range - let's say 0,4 - 0,6, the Confirmation Sentence is triggered and shown to the user. If the user confirms the Intent, the Intent will be triggered.
Adding Reconfirmation Sentences
Read more about how reconfirmation works on our Machine Learning Intents page.
Intent Options Menu¶
The Intent Options Menu can be selected by clicking on the three dots next to the Create Intent button. The menu provides a number of options:
Upload Intents CSV or JSON File This option lets you upload Intent collection in either CSV or JSON format.
Download Intents Intents can be downloaded in CSV and JSON formats as well.
Create Reject Intent Reject Intents can be used to explicitly filter out certain utterances. A Reject Intent can be used in case certain user utterances should not be registered as an Intent.
Delete All Intents This option can be used to batch-delete all intents in a given Flow.
When you upload intents, you get 3 options:
Skip: If an intent with this name already exists, importing this intent is skipped.
Overwrite: If an intent with this name already exists, the existing intent is deleted and the new values are imported.
Merge: If an intent with this name already exists, the properties that can have multiple values will be merged:
- Example Sentences
- Confirmation sentences
Other properties (e.g. Default Reply, Condition) will not be changed.
Uploading does not delete existing intents that are not in the upload file. If you want to delete intents, you can use the menu option "Delete All Intents" or delete individual intents, before uploading.
Individual Intent Options Menu¶
Each intent additionally has its own options menu that can be selected by clicking on the three dots next to the Intent name. The menu provides a number of options:
Create Child Intent Adds an intent as a child intent to the selection. See Intent Hierarchy. This property is included on data import/export.
Disable Intent Disables the selected intent so that it cannot be recognized or activated by a user input. This function temporarily removes the intent, and it's associated training data from the model but allows for it to be re-added in a single click. This property is included on data import/export.
Delete Intents Removes the intent and all associated training data from the model.
Cognigy NLU can take into account additional Flows and Lexicons whenever they are attached.
Whenever a Flow with Intents is attached to another Flow, the Intents in that Attached Flow are taken into account when training the NLU model. This is a practical way of combining different Intent collections into a bigger model.
Be careful with attaching Flows
Whenever a Flow is attached to another Flow, the Intents of both Flows are combined into a single model. This may lead to unexpected results.
Lexicons need to be attached to a Flow in order for a Flow to be able to detect its Keyphrases. Make sure to retrain the model whenever you attach or detach resources.
States can be used to deliberately block certain Intents. This can help with edge-cases or very large Intent collections.
Refer to State for more information.
Watch this Episode of Cognigy Sessions for a technical deep dive
Slot Fillers allow for advanced Slot filling with very little effort. They can be configured with a certain Type of Slot and are executed whenever the NLU is executed (typically with every input). Slot Fillers automatically copy found Slots to the Context object, meaning that they can be filled using a number of subsequent user utterances. When combined with Question Nodes, this allows for a very natural information gathering mechanism since it allows users to "over answer".
Example: Suppose we want to gather three pieces of information:
We would configure appropriate Slot Fillers for these pieces of information:
If we now add matching Question Nodes, we get following Flow:
Make sure to configure the Question Nodes with the "Skip if Answer exists in Context" selected, as this is where the Slot Filler results are stored.
The Flow is now ready to take different kinds of utterances and automatically ask for the missing information.
"I would like a T-Shirt in XL" →[missing email]→"What is your email?".
"I would like a T-Shirt in XL, and my email is email@example.com"→ Flow completed.
Advanced Slot Filler Options¶
A CognigyScript condition which must return
true in order for the match to be considered valid. An example would be an additional validation on an Email Question of
input.slots.EMAIL.endsWith("cognigy.com") which would guarantee that only cognigy.com email addresses pass the validation.
The location of a filled slot result is determined by default by the slot type (e.g.,
input.slots.EMAIL for Email Questions). This can be overwritten using this setting (e.g.,
input.slots.EMAIL would store all found email slots). If the result location doesn't return a value (= is falsy), the answer will be considered invalid.