Activation rules
You can detect the client’s intent using patterns, phrase examples and the CAILA classifier.
Activation rules for patterns, intents and groups of examples in a script are processed for the following objects in descending priority:
- Patterns.
- A group of STS classifier samples.
- Intents.
Rule activation mechanism
- If the user request has been triggered in a state with a pattern, a group of
e!examples and an intent, then the pattern will have the highest priority. The state with the pattern will be triggered. - If the user request has been triggered in a state with a group of
e!examples and an intent, then the group of samples will have the highest priority. The state with a group of samples will be triggered. - If the user request has been triggered in a state with an intent only, then only the intent will be handled.
- In all other cases the user request will be handled by the
CatchAllstate.
CatchAll
Note that if the NLU service is used together with patterns and classifier phrase examples, such a CatchAll is not used:
state: CatchAll
q!: *
a: I did not get itUse the event: noMatch for user requests not defined in the script:
state: CatchAll
event: noMatch
a: You said: {{ $request.query }}A sample script:
Consider the following script:
theme: /
state: Pattern
q!: * pattern *
a: A pattern has been triggered
state: Example
e!: pattern
a: This example is not triggered because a pattern is processed
state: Second example
e!: example
a: The example has been triggered
state:
intent!: /pattern
a: This example is not triggered because a pattern is processed
state:
intent!: /example
a: This example is not triggered because a group of examples is processed
state: Intent
intent!: /intent
a: An intent has been triggered
state: CatchAll
event: noMatch
a: You said: {{ $request.query }}The training phrases for the intent are as follows:
/pattern— a pattern;/example— an example;/intent— an intent.
We launch the test widget and check the script:
- In response to the request
PatternthePatternstate is processed. - In response to
exampletheSecond examplestate is processed. - In response to
IntenttheIntentI state is processed. - All requests not handled by the script are handled by the
CatchAllstate.