{
    "componentChunkName": "component---src-templates-doc-page-js",
    "path": "/docs/en/NLU_core/project_migration/",
    "result": {"data":{"site":{"siteMetadata":{"title":"Gatsby-doc-engine"}},"markdownRemark":{"id":"1894f298-1b98-54ea-a937-b53147ad52c7","excerpt":"Migrating projects to CAILA?> Projects that were created based on patterns or phrase examples can be migrated to the CAILA NLU kernel. All the CAILA features…","html":"<h1>Migrating projects to CAILA</h1>\n<hr>\n<p class='warn'>Projects that were created based on <a href=/1.10.3/docs/en/Patterns/about_patterns  >patterns</a> or <a href=/1.10.3/docs/en/classificator/classificator  >phrase examples</a> can be migrated to the CAILA NLU kernel.</p>\n<p>All the CAILA features will be available for the project: intent recognition, system and user-defined entities, slot markup and filling, CAILA API, etc.</p>\n<p>We will cover the process of migrating projects to CAILA in this article:</p>\n<ol>\n<li><a href=\"#Configuration-file\">Editing the project configuration file</a>.</li>\n<li><a href=\"#Migrating-NLU-settings\">Migrating NLU settings</a>.</li>\n<li><a href=\"#Configuring-activation-rules\">Configuring activation rules</a>.</li>\n<li><a href=\"#Testing-and-updating-the-script\">Testing and updating the script</a>.</li>\n</ol>\n</br>\n<h3>Configuration file</h3>\n<p>Specify the <code class=\"language-text\">chatbot.yaml</code> parameters in the configuration file:</p>\n<div class=\"gatsby-highlight\" data-language=\"yml\"><pre class=\"language-yml\"><code class=\"language-yml\"><span class=\"token key atrule\">botEngine</span><span class=\"token punctuation\">:</span> v2\n<span class=\"token key atrule\">language</span><span class=\"token punctuation\">:</span> ru\n \n<span class=\"token key atrule\">sts</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">noMatchThreshold</span><span class=\"token punctuation\">:</span> <span class=\"token number\">0.2</span>\n<span class=\"token key atrule\">caila</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">noMatchThreshold</span><span class=\"token punctuation\">:</span> <span class=\"token number\">0.2</span></code></pre></div>\n<ul>\n<li><code class=\"language-text\">botEngine</code> – classifier type; specify <code class=\"language-text\">v2</code> to use CAILA.</li>\n<li><code class=\"language-text\">language</code> – specify the language for compatibility with the STS classifier.</li>\n<li><code class=\"language-text\">noMatchThreshold</code> – sets the minimum required similarity of the phrase to one of the classes. We have empirically determined that the optimal value for this parameter is 0.2 in the process of the NLU service development.</li>\n</ul>\n<p class='tip'>Please note that we also set the <code class=\"language-text\">noMatchThreshold</code> value for the STS classifier. This is required for the project’s backward compatibility.</p>\n</br>\n<h3>Migrating NLU settings</h3>\n<p>Most NLU settings in <code class=\"language-text\">chatbot.yaml</code> become inactive when migrated to CAILA. Some of the settings can be <a href=\"/1.10.3/docs/en/platform_ux/nlu_core_caila/project_setting\">defined when you configure the project in the <em>NLU settings</em> section</a>.</p>\n<p>Let us have a look at the changes in a <a href=\"/1.10.3/docs/en/classificator/connection_classificator\">sample project with an STS classifier</a>:</p>\n<div class=\"gatsby-highlight\" data-language=\"yml\"><pre class=\"language-yml\"><code class=\"language-yml\"><span class=\"token key atrule\">nlp</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">morphology</span><span class=\"token punctuation\">:</span> myStem\n  <span class=\"token key atrule\">tokenizer</span><span class=\"token punctuation\">:</span> myStem\n \n  <span class=\"token key atrule\">vocabulary</span><span class=\"token punctuation\">:</span> common<span class=\"token punctuation\">-</span>vocabulary.json\n  <span class=\"token key atrule\">lengthLimit</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">enabled</span><span class=\"token punctuation\">:</span> <span class=\"token boolean important\">true</span>\n    <span class=\"token key atrule\">symbols</span><span class=\"token punctuation\">:</span> <span class=\"token number\">400</span>\n    <span class=\"token key atrule\">words</span><span class=\"token punctuation\">:</span> <span class=\"token number\">100000</span>\n  <span class=\"token key atrule\">timeLimit</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">enabled</span><span class=\"token punctuation\">:</span> <span class=\"token boolean important\">true</span>\n    <span class=\"token key atrule\">timeout</span><span class=\"token punctuation\">:</span> <span class=\"token number\">10000</span>\n  <span class=\"token key atrule\">spellcheck</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">enabled</span><span class=\"token punctuation\">:</span> <span class=\"token boolean important\">true</span>\n    <span class=\"token key atrule\">dictionary</span><span class=\"token punctuation\">:</span> dict.txt\n    <span class=\"token key atrule\">frequency</span><span class=\"token punctuation\">:</span> frequency.txt\n    <span class=\"token key atrule\">minWordLengthForEditDistance</span><span class=\"token punctuation\">:</span> <span class=\"token number\">3</span>\n    <span class=\"token key atrule\">maxWordEditDistance</span><span class=\"token punctuation\">:</span> <span class=\"token number\">0</span>\n  <span class=\"token key atrule\">speller</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">dictionary</span><span class=\"token punctuation\">:</span> speller.dict\n \n<span class=\"token key atrule\">classifier</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">enable</span><span class=\"token punctuation\">:</span> <span class=\"token boolean important\">true</span>\n  <span class=\"token key atrule\">engine</span><span class=\"token punctuation\">:</span> sts\n  <span class=\"token key atrule\">noMatchThreshold</span><span class=\"token punctuation\">:</span> <span class=\"token number\">0.2</span>\n  <span class=\"token key atrule\">parameters</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">algorithm</span><span class=\"token punctuation\">:</span> aligner2</code></pre></div>\n<ul>\n<li><code class=\"language-text\">morphology</code> – parameter is inactive; the text is marked up in CAILA. Can be overridden in advanced NLU settings.</li>\n<li><code class=\"language-text\">tokenizer</code> – parameter is inactive; the text is marked up in CAILA. Can be overridden in advanced NLU settings.</li>\n<li><code class=\"language-text\">vocabulary</code> – parameter is inactive, cannot be overridden.</li>\n<li><code class=\"language-text\">timeLimit</code> – parameter is only active for the <code class=\"language-text\">q</code>, <code class=\"language-text\">e</code>, <code class=\"language-text\">eg</code> tags. The <code class=\"language-text\">intent</code> tag is set to a default value, cannot be overridden.\n<ul>\n<li><code class=\"language-text\">enabled</code> – parameter is inactive.</li>\n<li><code class=\"language-text\">timeout</code> – parameter is inactive.</li>\n</ul>\n</li>\n<li><code class=\"language-text\">spellcheck</code> – spellchecker module, the parameter is inactive. The format of the dictionary is not compatible with CAILA. <a href=\"/1.10.3/docs/en/platform_ux/nlu_core_caila/spellcheck\">Create and upload a dictionary in the new format</a>.</li>\n<li><code class=\"language-text\">speller</code> – new format spellchecker module, the parameter is inactive. The format of the dictionary is compatible with CAILA. <a href=\"/1.10.3/docs/en/platform_ux/nlu_core_caila/spellcheck\">You can use the CAILA API to upload a dictionary</a>.</li>\n<li><code class=\"language-text\">classifer</code> – parameter is only active for the <code class=\"language-text\">q</code>, <code class=\"language-text\">e</code>, <code class=\"language-text\">eg</code> tags. The <code class=\"language-text\">intent</code> tag is set to a default value, cannot be overridden.</li>\n<li><code class=\"language-text\">noMatchThreshold</code> – parameter is inactive, the <code class=\"language-text\">sts.noMatchThreshold</code> parameter is used instead.</li>\n</ul>\n</br>\n<h5>Spellchecker module</h5>\n<p>The built-in spellchecker module can be used to correct spelling errors in client requests. If can be used in combination with a user-defined dictionary. This way, the project dictionary will be used to correct the words from the domain scope and the global module will be used for other words.</p>\n<p>If you used a <code class=\"language-text\">.dict</code> dictionary before, you can <a href=\"/1.10.3/docs/en/platform_ux/nlu_core_caila/spellcheck\">migrate it to your project using the CAILA API Direct</a>.</p>\n</br>\n<h5>Tokenization and lemmatization</h5>\n<p><a href=\"/1.10.3/docs/en/NLU_core/advanced_classifer_settings\">The <code class=\"language-text\">udpipe</code> tokenizer is used for projects in Russian by default</a>. Tests have shown this is the best tokenization and lemmatization solution.</p>\n<p>If your project was created using patterns or an STS classifier, we recommend that you use <a href=\"/1.10.3/docs/en/NLU_core/advanced_classifer_settings\">the <code class=\"language-text\">morphsrus</code> or <code class=\"language-text\">mystem</code> tokenizer</a>.</p>\n</br>\n<h5>NLU advanced configuration parameters</h5>\n<p><a href=\"/1.10.3/docs/en/platform_ux/nlu_core_caila/project_setting\">Switch to project editing</a>. Specify advanced configuration parameters here: NLU language, classifier algorithm, timezone, NLU settings.</p>\n<p class='warn'><a href=/1.10.3/docs/en/NLU_core/advanced_classifer_settings  >Learn more about NLU settings</a></p>\n</br>\n<h3>Configuring activation rules</h3>\n<p>You can use patterns, phrase examples from an STS classifier and the CAILA classifier in combination to detect client intent. <a href=\"/1.10.3/docs/en/NLU_core/rule_activation\">Specify the state triggering mechanism for the combined use of intents, patterns and example groups in the bot script</a>.</p>\n<p class='warn'><a href=/1.10.3/docs/en/NLU_core/intent_detection  >Learn more about the activation rule mechanism</a></p>\n</br>\n<h5>Example dictionary</h5>\n<p>If you used an STS classifier in your project, you can migrate your <a href=\"/1.10.3/docs/en/classificator/work_with_classificator\">example dictionary</a> to the updated project.</p>\n<p><a href=\"/1.10.3/docs/en/platform_ux/nlu_core_caila/intents\">Open the <em>Intents</em> page</a>. Click Import at the top of the intents tree > upload the <code class=\"language-text\">.json</code> file.</p>\n</br>\n<h5>CatchAll</h5>\n<p>Note that if the NLU service is used in combination with patterns and classifier phrase examples, the following <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 <code class=\"language-text\">event: noMatch</code> for user requests not processed by your 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>\n        </code></pre></div>\n</br>\n<h3>Testing and updating the script</h3>\n<p>Use the <a href=\"/1.10.3/docs/en/Content_testing/test_widget\">test widget</a> built in the script editor to debug your script.</p>\n<p class='warn'>We recommend using the <code class=\"language-text\">intent</code> activation rule, system and custom entities, slot filling and <a href=/1.10.3/docs/en/platform_ux/nlu_core_caila/nlu_core_caila  >other features of the CAILA NLU kernel</a> to further update your script.</p>","frontmatter":{"title":"","description":null},"headings":[{"value":"Migrating projects to CAILA"}]}},"pageContext":{"slug":"/docs/en/NLU_core/project_migration/","previous":{"fields":{"slug":"/docs/en/NLU_core/rule_activation/"},"frontmatter":{"title":"","description":null}},"next":{"fields":{"slug":"/docs/en/NLU_core/nlu_core/"},"frontmatter":{"title":"","description":null}}}},
    "staticQueryHashes": ["1209419333"]}