{
    "componentChunkName": "component---src-templates-doc-page-js",
    "path": "/docs/en/NLU_core/intent_detection/",
    "result": {"data":{"site":{"siteMetadata":{"title":"Gatsby-doc-engine"}},"markdownRemark":{"id":"60c4a1ca-4c02-546f-b58b-48d9919ba879","excerpt":"Activation rules?> You can detect the client’s intent using patterns, phrase examples and the CAILA classifier. Activation rules for patterns, intents and…","html":"<h1>Activation rules</h1>\n<hr>\n<p class='warn'>You can detect the client’s intent using <a href=/1.10.3/docs/en/Patterns/about_patterns  >patterns</a>, <a href=/1.10.3/docs/en/classificator/work_with_classificator  >phrase examples</a> and the <a href=/1.10.3/docs/en/NLU_core/nlu_core  >CAILA classifier</a>.</p>\n<p>Activation rules for patterns, intents and groups of examples in a script are processed for the following objects in descending priority:</p>\n<ol>\n<li>Patterns.</li>\n<li>A group of STS classifier samples.</li>\n<li>Intents.</li>\n</ol>\n</br>\n<h4>Rule activation mechanism</h4>\n<ol>\n<li>If the user request has been triggered in a state with a pattern, a group of <code class=\"language-text\">e!</code> examples and an intent, then the pattern will have the highest priority. The state with the pattern will be triggered.</li>\n<li>If the user request has been triggered in a state with a group of <code class=\"language-text\">e!</code> examples and an intent, then the group of samples will have the highest priority. The state with a group of samples will be triggered.</li>\n<li>If the user request has been triggered in a state with an intent only, then only the intent will be handled.</li>\n<li>In all other cases the user request will be handled by the <code class=\"language-text\">CatchAll</code> state.</li>\n</ol>\n</br>\n<h4>CatchAll</h4>\n<p>Note that if the NLU service is used together with patterns and classifier phrase examples, such a <code class=\"language-text\">CatchAll</code> is not used:</p>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\">    <span class=\"token keyword\">state:</span> CatchAll\n        <span class=\"token storageType\">q!:</span> *\n        <span class=\"token variableParameter\">a:</span> I did not get it</code></pre></div>\n<p>Use the <code class=\"language-text\">event: noMatch</code> for user requests not defined in the script:</p>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\">    <span class=\"token keyword\">state:</span> CatchAll\n        <span class=\"token storageType\">event:</span> noMatch\n        <span class=\"token variableParameter\">a:</span> You said: <span class=\"token constantCharacter\">{{ $request.query }}</span></code></pre></div>\n</br>\n<h4>A sample script:</h4>\n<p>Consider the following script:</p>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">theme:</span> /\n\n    <span class=\"token keyword\">state:</span> Pattern\n        <span class=\"token storageType\">q!:</span> * pattern *\n        <span class=\"token variableParameter\">a:</span> A pattern has been triggered\n\n    <span class=\"token keyword\">state:</span> Example\n        <span class=\"token storageType\">e!:</span> pattern\n        <span class=\"token variableParameter\">a:</span> This example is not triggered because a pattern is processed\n\n    <span class=\"token keyword\">state:</span> Second example\n        <span class=\"token storageType\">e!:</span> example\n        <span class=\"token variableParameter\">a:</span> The example has been triggered\n\n    <span class=\"token keyword\">state:</span>\n        <span class=\"token storageType\">intent!:</span> /pattern\n        <span class=\"token variableParameter\">a:</span> This example is not triggered because a pattern is processed\n\n    <span class=\"token keyword\">state:</span>\n        <span class=\"token storageType\">intent!:</span> /example\n        <span class=\"token variableParameter\">a:</span> This example is not triggered because a group of examples is processed\n\n    <span class=\"token keyword\">state:</span> Intent\n        <span class=\"token storageType\">intent!:</span> /intent\n        <span class=\"token variableParameter\">a:</span> An intent has been triggered\n\n    <span class=\"token keyword\">state:</span> CatchAll\n        <span class=\"token storageType\">event:</span> noMatch\n        <span class=\"token variableParameter\">a:</span> You said: <span class=\"token constantCharacter\">{{ $request.query }}</span></code></pre></div>\n<p>The training phrases for the intent are as follows:</p>\n<ul>\n<li><code class=\"language-text\">/pattern</code> — a pattern;</li>\n<li><code class=\"language-text\">/example</code> — an example;</li>\n<li><code class=\"language-text\">/intent</code> — an intent.</li>\n</ul>\n<p>We launch the test widget and check the script:</p>\n<ol>\n<li>In response to the request <code class=\"language-text\">Pattern</code> the <code class=\"language-text\">Pattern</code> state is processed.</li>\n<li>In response to <code class=\"language-text\">example</code> the <code class=\"language-text\">Second example</code> state is processed.</li>\n<li>In response to <code class=\"language-text\">Intent</code> the <code class=\"language-text\">Intent</code>I state is processed.</li>\n<li>All requests not handled by the script are handled by the <code class=\"language-text\">CatchAll</code> state.</li>\n</ol>\n<p class='warn'><a href=/1.10.3/docs/en/NLU_core/rule_activation  >When patterns, intents and example groups are used in the same script, the developer can define the priorities of rule activation</a>.</p>","frontmatter":{"title":"","description":null},"headings":[{"value":"Activation rules"}]}},"pageContext":{"slug":"/docs/en/NLU_core/intent_detection/","previous":{"fields":{"slug":"/docs/en/NLU_core/nlu_core/"},"frontmatter":{"title":"","description":null}},"next":{"fields":{"slug":"/docs/en/NLU_core/intent/"},"frontmatter":{"title":"","description":null}}}},
    "staticQueryHashes": ["1209419333"]}