This site is no longer updated.Go to new Conversational Cloud docs

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:

  1. Patterns.
  2. A group of STS classifier samples.
  3. Intents.

Rule activation mechanism

  1. 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.
  2. 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.
  3. If the user request has been triggered in a state with an intent only, then only the intent will be handled.
  4. In all other cases the user request will be handled by the CatchAll state.

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 it

Use 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:

  1. In response to the request Pattern the Pattern state is processed.
  2. In response to example the Second example state is processed.
  3. In response to Intent the IntentI state is processed.
  4. All requests not handled by the script are handled by the CatchAll state.

When patterns, intents and example groups are used in the same script, the developer can define the priorities of rule activation.