{"id":20055,"date":"2019-05-06T08:20:07","date_gmt":"2019-05-06T08:20:07","guid":{"rendered":"https:\/\/developer.kore.ai\/developer-2\/?p=20055"},"modified":"2021-03-25T09:16:44","modified_gmt":"2021-03-25T09:16:44","slug":"traits","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-0\/docs\/bots\/nlp\/traits\/","title":{"rendered":"Traits"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>In natural conversations, it is very common that a user provides background \/ relevant information while describing a specific scenario. <strong>Traits<\/strong> are specific entities, attributes or details that the users express in their conversations. The utterance may not directly convey any specific intent, but the traits present in the utterance can be used in driving the intent detection and bot conversation flows.<\/p>\n<p>For example, the utterance \u2018<em>my card is being rejected and am on a business trip<\/em>\u2019 expresses two traits \u2018<em>card decline<\/em>\u2019 and \u2018<em>emergency<\/em>\u2019. In this scenario, the utterance does not convey any direct intent or at best it can be used to trigger the \u2018<em>unblock card<\/em>\u2019 flow. However, the presence of \u2018<em>emergency<\/em>\u2019 trait can be used to directly assign the conversation to a human agent.<\/p>\n<p><strong>Traits feature<\/strong> of the Bots platform is aimed at identifying such characteristics present in user utterances and use them for intent detection and in customizing the bot definition using these characteristics.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Use_Case\">Use Case<\/span><\/h2>\n<p><strong>Book a Flight<\/strong> bot might have an added requirement to book a flight based on the cost preference.<\/p>\n<p>User utterance: \u2018<em>I am looking for a low cost option to London<\/em>\u2019 should result in ordering the available flights and picking the lowest priced ticket.<\/p>\n<p>This can be achieved by:<\/p>\n<ul>\n<li>adding a Trait Type called Travel Class with Trait Economy trained with the utterance \u201clow cost\u201d<\/li>\n<li>adding a Rule for \u201cbook flight\u201d to be triggered in the presence of Economy Trait<\/li>\n<li>add transition condition in case Trait Economy is present in the context<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Configuration\">Configuration<\/span><\/h2>\n<p>Configuring Traits involves:<\/p>\n<ul>\n<li>Trait Definition<\/li>\n<li>Trait Association Rules<\/li>\n<li>Trait Detection<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Trait_Definition\">Trait Definition<\/span><\/h3>\n<p>Traits can be defined from the <strong>Traits<\/strong> section under <strong>Natural Language -&gt; Training<\/strong>.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-blank.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21546\" src=\"\/wp-content\/uploads\/sites\/11\/traits-blank.png\" alt=\"\" width=\"820\" height=\"461\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094750\/traits-blank.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094750\/traits-blank-300x169.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><br \/>\nFollowing are the key features to be considered while defining Traits:<\/p>\n<ol>\n<li><strong>Trait Type<\/strong> will be a collection of related traits like Travel Class in the above example.<\/li>\n<li>Trait Type can be &#8216;<em>ML Based<\/em>&#8216; or &#8216;<em>Pattern Based<\/em>&#8216;. Each trait of a trait type can be trained using words, phrases, utterances or patterns based on the type. <strong>Manage<\/strong> Trait Type allows you to define the training configuration.\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>ML-based trait types can be configured to set the ML threshold value between 0 and 1.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-trainingtype.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21547\" src=\"\/wp-content\/uploads\/sites\/11\/traits-trainingtype.png\" alt=\"\" width=\"820\" height=\"461\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094750\/traits-trainingtype.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094750\/traits-trainingtype-300x169.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/li>\n<li>A Trait Type can have one or more Traits.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-creation.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21548\" src=\"\/wp-content\/uploads\/sites\/11\/traits-creation.png\" alt=\"\" width=\"820\" height=\"461\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094749\/traits-creation.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094749\/traits-creation-300x169.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/li>\n<li><strong>Traits<\/strong> name should be unique in a group. But trait with the same name can be present in multiple groups.\n<ul>\n<li>For ML-based Traits, you can define the words, phrases or utterances that identify the trait. One trait per trait type will be detected for ML-based trait types.<\/li>\n<li>For Pattern-based Traits, you get to define the patterns associated with the given trait. There is a possibility of multiple traits getting detected for pattern-based trait types. Ordering of Traits within the Trait Type signifies the importance of a trait in a trait type and detect only one trait.<\/li>\n<\/ul>\n<\/li>\n<li>Once added, <strong>Train<\/strong> the Bot for the Traits to be detected from user utterances.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-train.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21544\" src=\"\/wp-content\/uploads\/sites\/11\/traits-train.png\" alt=\"\" width=\"820\" height=\"461\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094750\/traits-train.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094750\/traits-train-300x169.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/li>\n<\/ol>\n<p><strong>Notes<\/strong>:<\/p>\n<ol>\n<li>You can add language specific traits in case of multi-lingual Bots.<\/li>\n<li>When a trait name is modified, ensure that all the rules defined using that trait are corrected. This has to be done manually, the platform will not take care of it.<\/li>\n<li>Trait name should be unique in a group.<\/li>\n<li>Traits with the same name can be present in multiple groups, but distinguishing them in trait rules or trait detection results would be difficult.<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Trait_Association_Rules\">Trait Association Rules<\/span><\/h3>\n<p>Trait Rules define Dialog Execution and Knowledge Intent detection.<\/p>\n<h4>Dialog Execution<\/h4>\n<p><em>Intent detection<\/em> or <em>Dialog execution<\/em> can be achieved using traits, along with the ML utterances and patterns. To achieve this, an intent needs to be associated with the required traits by adding <strong>Rules<\/strong>.<\/p>\n<p>There are multiple ways to add rules:<\/p>\n<ol>\n<li>From the Traits section using the <strong>Add New Rule<\/strong> link<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-rule1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21550\" src=\"\/wp-content\/uploads\/sites\/11\/traits-rule1.png\" alt=\"\" width=\"820\" height=\"461\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094749\/traits-rule1.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094749\/traits-rule1-300x169.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/li>\n<li>From the Intent Node using the <strong>Rules<\/strong> section under the <strong>NLP Properties<\/strong><br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-rule2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21551\" src=\"\/wp-content\/uploads\/sites\/11\/traits-rule2.png\" alt=\"\" width=\"820\" height=\"461\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094749\/traits-rule2.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094749\/traits-rule2-300x169.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/li>\n<li>From the <strong>Patterns and Rules<\/strong> section using the <strong>Rules<\/strong> tab for a given Intent.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-rule3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21552\" src=\"\/wp-content\/uploads\/sites\/11\/traits-rule3.png\" alt=\"\" width=\"820\" height=\"461\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094748\/traits-rule3.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094748\/traits-rule3-300x169.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/li>\n<\/ol>\n<p>Each rule can have one or more conditions with AND as the operator. Multiple trait rules can be defined for a given intent and the intent will be considered as a definite match if any one of the rules matches.<\/p>\n<h4>Knowledge Intents<\/h4>\n<p>Knowledge Collection can also be part of the discovery process using Traits. For this, each term or node can be associated with a trait. A given term can be associated with a single Trait.<\/p>\n<p><strong>NOTE<\/strong>: Traits will replace the Classes from releases 6.4 and previous.<\/p>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-kc.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21554\" src=\"\/wp-content\/uploads\/sites\/11\/traits-kc.png\" alt=\"\" width=\"820\" height=\"461\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094748\/traits-kc.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094748\/traits-kc-300x169.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Trait_Detection\">Trait Detection<\/span><\/h3>\n<p>Only one trait from a group (trait type) will be detected and will be considered as a &#8216;definite match&#8217;.<\/p>\n<p>Traits detected are included in the context object. The context will be populated with unique traits identified (without reference to trait type). This information can be used in:<\/p>\n<ul>\n<li>intent identification<\/li>\n<li>dialog transition<\/li>\n<li>entity population<\/li>\n<li>bot definitions<\/li>\n<\/ul>\n<p><em>Batch Testing<\/em> reports also include information about traits detected as do the <em>Find Intent API<\/em>.<\/p>\n<h4>Intent Detection<\/h4>\n<p>The Ranking and Resolver gets input from the three NL engines and Traits to analyze and come up with the possible\/definitive matches.<\/p>\n<ul>\n<li>Intent will be considered as &#8216;definite match&#8217; only if all the traits present in a trait rule are detected.<\/li>\n<li>A KC term will be qualified only if all the traits present in a trait rule are detected<\/li>\n<li>NL Analysis will include information of traits detected and the NLP Flow will show the information about traits detected.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-testing.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21555\" src=\"\/wp-content\/uploads\/sites\/11\/traits-testing.png\" alt=\"\" width=\"820\" height=\"461\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094748\/traits-testing.png 820w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094748\/traits-testing-300x169.png 300w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/li>\n<\/ul>\n<h4>Dialog Transition<\/h4>\n<p>Conversation Flow can be controlled using Traits. For a Dialog, <strong>Connection Rules<\/strong> can be defined using the Trait Context. This can be done from the Connection tab under the Properties Panel for the Dialog.<\/p>\n<p>The Traits Context can be accessed using <code>context.traits<\/code>. It returns an array of all traits matching the intent, hence the condition to be used would be <em>contains<\/em>.<\/p>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/traits-transition.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21597\" src=\"\/wp-content\/uploads\/sites\/11\/traits-transition.png\" alt=\"\" width=\"450\" height=\"355\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094746\/traits-transition.png 450w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/11\/20221201094746\/traits-transition-300x237.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"In natural conversations, it is very common that a user provides background \/ relevant information while describing a specific scenario. Traits are specific entities, attributes or details that the users express in their conversations. The utterance may not directly convey any specific intent, but the traits present in the utterance can be used in driving...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-20055","post","type-post","status-publish","format-standard","hentry","category-nlp"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts\/20055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/comments?post=20055"}],"version-history":[{"count":15,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts\/20055\/revisions"}],"predecessor-version":[{"id":22776,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts\/20055\/revisions\/22776"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/media?parent=20055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/categories?post=20055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/tags?post=20055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}