Cognitive Evaluation
Category: Cognitive
Description: This extension module allows for the manipulation of cognitive evaluations, requiring a connection to the Cognitive Engine for its operation.
Functionality: Use this extension module to perform a cognitive evaluation using an active cognitive context, depending on the previously configured cognitive evaluator context.
Prerequisites
-
Create an entity in Lynn
- From the flow designer, create an entity that will later allow you to store the result of the evaluation we will perform. The structure of the entity may vary depending on the cognitive engine used. Refer to the documentation of the Cognitive Engine selected or try to retrieve a valid response to adjust the queries during the design phase of your flow.
Implementation
The expression containing the text to be evaluated: A string-type field that allows you to enter an expression to be evaluated. It can be completed with an entity or text, which should be entered in single quotes to be identified as such.
Evaluation result: Set to YES for the cognitive evaluation to be executed automatically, or set to NO for the result of the evaluation to be stored in an entity.
Entity where the evaluation result will be deposited in JSON format: A dropdown list field allowing you to select the entity where the evaluation result will be stored in JSON format.
The intent to execute in case of an error. The action flow will be interrupted and the error description will be passed to the selected intent named: 'Cognitive_Evaluation_Error': A dropdown list where you must select the name of the intent for error handling. When an error overflow occurs, the entity Cognitive_Evaluation_Error will be loaded with the error detail if available.
Implementation Example
Field | Value |
---|---|
Name: | Greeting |
Expression to evaluate: | demo_saludo |
Evaluation result: | No |
Entity where the evaluation result will be deposited in JSON format: | respuestaCliente --> empty |
The intent to execute in case of an error. The action flow will be interrupted and the error description will be passed to the selected intent named: 'Cognitive_Evaluation_Error': | Error_Handler |
Output:
Result obtained in the entity defined in “clientResponse":
{
Intent:intent_welcome,
Confidence:1.0,
Entities:
{
greeting:hello
}
}
đź”” It should be noted that 3 keys will always be obtained as a response to the evaluation:
- Intent
- Confidence Value
- Entities