{"id":18053,"date":"2018-06-06T07:52:24","date_gmt":"2018-06-06T07:52:24","guid":{"rendered":"https:\/\/developer.kore.ai\/v7-1\/?post_type=docs&#038;p=14314"},"modified":"2021-03-30T12:59:56","modified_gmt":"2021-03-30T11:59:56","slug":"additional-notes-nlp-settings-guidelines","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-1\/docs\/bots\/nlp\/additional-notes-nlp-settings-guidelines\/","title":{"rendered":"NLP Settings and Guidelines"},"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<h3><span class=\"ez-toc-section\" id=\"Intent_Naming_Guidelines\">Intent Naming Guidelines<\/span><\/h3>\n<p>Follow the below guidelines when naming your task (intent identifier)<\/p>\n<ul>\n<li>Use action verb, an object and possibly a modifier (placed before or after the object). Typically, an intent name consists of 2 to 4 words.<\/li>\n<li>Use less than 5 words to convey the purpose of the task<\/li>\n<li>Use the same verb in different tasks if the action is similar (e.g. Show Issue \/ Show Report instead of Show Issue \/ Get Report)<\/li>\n<li>Avoid single-word actions<\/li>\n<li>Avoid determiners (the, a, my, that, etc.)<\/li>\n<li>Avoid digits but if you cannot, always use the numerical form<\/li>\n<li>Avoid Kore.ai platform terms such as task, alert, action, cancel, discard, amend, webhook<\/li>\n<li>Avoid using a potential entity in an intent name (e.g. Get Weather Today, where today is a potential entity)<\/li>\n<li>Don\u2019t use special characters such as () &amp; \/ \\ $ [ ] + *<\/li>\n<li>Don\u2019t use punctuation such as &#8211; , . ! ? \u2018 \u201c<\/li>\n<li>Don\u2019t use pronouns (i.e. Show Me All Issues)<\/li>\n<li>Don\u2019t use terms related to the bot name (e.g. Create Asana Task)<\/li>\n<li>Don\u2019t use a word both as a verb and as a noun (e .g. Update Issue \/ Get Updates)<\/li>\n<li>For List of Items entity type, do not have the combination of following characters while defining synonyms &#8211; (), %, \u00b0 (degree symbol for degrees i.e. 30\u00b0C).<\/li>\n<\/ul>\n<p>On-Demand tasks (Actions, Dialog, Information tasks) should always contain an action verb, an object and possibly a modifier (placed before or after the object). You should map almost all actions to the form \u201c how + what\u201d and complete the sentence \u201cthe goal is to\u201d:<\/p>\n<ul>\n<li>Do Something<\/li>\n<li>Get Status<\/li>\n<li>Send Detailed Report<\/li>\n<li>Email Report Critical<\/li>\n<li>Get 3 Day Forecast<\/li>\n<\/ul>\n<p>Alerts should always contain an object and possibly a modifier (placed before or after the object). Avoid using verbs in alert altogether. Avoid using the word \u201calert\u201d in an alert name. Alerts should be mapped to the form \u201c what \u201d and complete the sentence \u201calert me on:\u201d<\/p>\n<ul>\n<li>Something<\/li>\n<li>Status Updates<\/li>\n<li>Critical Status Update<\/li>\n<li>Changes<\/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 id=\"patterns\"><span class=\"ez-toc-section\" id=\"Patterns\">Patterns<\/span><\/h3>\n<p>While using synonyms is great for words used in the name, users may sometimes refer to a task using slang, metaphors, or other idiomatic expressions.<\/p>\n<p>For example, a task name might be \u2018Get Current Weather\u2019, but the user inputs, \u2018What\u2019s happening with today\u2019s rain situation\u2019. In such cases, none of the words used in the task name are used, yet the input has the same meaning. To optimize accuracy and recognition of the NLP interpreter for your bots you can create patterns.<\/p>\n<p>When the NLP interpreter matches a synonym to one task or field, and a pattern to a different task or field, the pattern match is prioritized and used for recognition over the synonym match.<\/p>\n<div class=\"alert alert-info\"><b>Note<\/b>: Patterns are evaluated in the order of their listing. So ensure when adding patterns add in the order of most restrictive to least restrictive.<\/div>\n<div><\/div>\n<div class=\"alert alert-info\">The following are some general guideline for creating Intent patterns:<\/div>\n<ul>\n<li>Use a minimum of 3 words<\/li>\n<li>Use words in their canonical forms (i.e. infinitive verbs, singular nouns)<\/li>\n<li>Use lowercase both for words and their synonyms<\/li>\n<li>Use the US spelling of words (i.e. \u201cnormalize\u201d instead of \u201cnormalise\u201d)<\/li>\n<li>Avoid using determiners and pronouns (the, a, my, that)<\/li>\n<li>Avoid using digits<\/li>\n<li>Avoid using entity values in defining a task pattern<\/li>\n<li>Don\u2019t use elision (i.e. what \u2019s )<\/li>\n<li>Don\u2019t use special characters such as () &amp; \/ \\ $ [ ] + *<\/li>\n<li>Don\u2019t use punctuation such as &#8211; , . ! ? \u2018 \u201c<\/li>\n<\/ul>\n<p>For a quick guide towards the usage of patterns, see <a href=\"\/v7-1\/docs\/bots\/how-tos\/how-to-use-patterns-for-intents-entities\/\">How to use Patterns<\/a>.<\/p>\n<h4 id=\"pat_ops\">Pattern Operators<\/h4>\n<ul>\n<li><b>AND : ( X Y )<\/b>: An ordered relationship of words in sequence. This is the default setting i.e. when you specify a pattern as <em>cancel order<\/em> it is same as <em>(cancel order)<\/em>.<br \/>\nExample: <i>(Cancel Order)<\/i> matches \u201cCancel my phone order\u201d but doesn\u2019t match \u201cI have a pending order for an iPhone X, can I cancel.\u201d Bot Builder tool uses patterns with increasing numbers of wildcards between words (up to 3 for an intent). So a pattern of &#8220;Cancel Order&#8221; can match:<\/p>\n<ul>\n<li>&#8220;cancel order&#8221;<\/li>\n<li>&#8220;cancel my order&#8221;<\/li>\n<li>&#8220;cancel that last order&#8221;<\/li>\n<li>&#8220;cancel last weeks big order&#8221;<\/li>\n<\/ul>\n<\/li>\n<li><b>OR: [X Y Z]<\/b>: Any of these can be interchangeably used in the user utterance Example &#8211; ([get make] me [food drink dessert]) will match any of the below utterances:\n<ul>\n<li>Get me food<\/li>\n<li>Make me a drink<\/li>\n<li>Get me a drink<\/li>\n<li>Get me a dessert<\/li>\n<li>Make me some quick food<\/li>\n<\/ul>\n<\/li>\n<li><b>NOT: !X<\/b>: Words that should not appear in the user utterance for an intent match Example &#8211; (!forecast) is marked as a pattern for intent named \u201c Get current weather\u2019 and the bot supports another intent called \u2018Get 3-day weather forecast\u2019\n<ul>\n<li>User utterance: \u201cPlanning a trip to California get me the forecast\u201d\n<ul>\n<li>will not match \u2018Get current weather\u2019<\/li>\n<li>will match \u2018Get 3-day weather forecast\u2019<br \/>\nNote that the !word means &#8220;not after this point&#8221;. So (!forecast the weather) and (get weather !forecast) are different. The utterance &#8220;get forecast for the weather&#8221; matches the second but not the first.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li><b>Optional: {X}<\/b>: Example &#8211; {phone} If the user utterance is \u201cGet me a phone number\u201d or \u201cget me a number\u201d the platform will treat it equally.<\/li>\n<li><strong>Enforce Phrase:<\/strong> X_Y: To enforce occurence of the phrase as is in the user utterance, without any words in between. Example &#8211; transfer_funds. The utterance &#8220;transfer funds&#8221; or &#8220;I want to transfer funds&#8221; will match but not &#8220;Can I transfer some funds&#8221;.<\/li>\n<li><b>Concepts: ~<\/b>: Platform has a large set of inbuilt concepts that developers can use to define a pattern. Example &#8211; (I [like love] ~world_country) will match\n<ul>\n<li>I like India<\/li>\n<li>I love traveling to Australia<\/li>\n<li>I would like to visit an African country<\/li>\n<\/ul>\n<\/li>\n<li><b>Unordered: &lt;&lt;, &gt;&gt;<\/b>: Used to find words in any order Example &#8211; &lt;&lt;Cancel Order&gt;&gt; matches \u201c<i>Cancel my phone order<\/i>\u201d and also \u201c<i>I have a pending order for an iPhone X, can I cancel<\/i>\u201d<\/li>\n<li><b>Start\/End of Statement: &lt;, &gt;:<\/b> Example &#8211; ( what is love &gt; ) will match \u201c<i>Do you know what is love?<\/i>\u201d but will not match \u201c<i>I am in love, can you help<\/i>\u201d<\/li>\n<li><b>Quote: \u2018 &#8211;<\/b>: If you quote words or use words that are not in canonical form, the system will restrict itself to what you used in the pattern Example &#8211; ( I &#8216;like you ) This matches \u201cI like you\u201d but not \u201cI liked you\u201d.<\/li>\n<\/ul>\n<h4>Entity Patterns<\/h4>\n<p>As above, to detect entities developers can use a combination of Entity patterns and NER training. Entity patterns guide Kore as to where to look for a valid value for the entity. It is possible for an entity pattern to be found in several places in a sentence and Kore will extract the value from the first instance that has a valid value. Apart from the task pattern guidelines above, follow the below guideline for entity patterns:<\/p>\n<ul>\n<li>Include the positional wildcard * that indicates the expected position of the entity ( i.e. \u201c(from * to)\u201d, \u201c(in * &gt;)\u201d ); without it the pattern is invalid.<\/li>\n<li>Use words that should be present in the pattern before and after the position of the entity. Words after the positional wildcard help to delimit the search range for a valid entity value.<\/li>\n<li>Use start and end of sentence symbols ( \u201c&lt;\u201d and \u201c&gt;\u201d) to separate the positional wildcard, but these are not strictly necessary because the Bot Builder tool does not cross a sentence boundary to extract an entity value (except for a Description).<\/li>\n<li>Don\u2019t use other positional wildcards in your field pattern. All field patterns are processed in the same way and all other positional wildcards except one are ignored.<\/li>\n<li>Don\u2019t use field names or their synonyms in patterns Entity patterns only consider up to two wildcard words between the specified words.<\/li>\n<\/ul>\n<p><strong>Examples<\/strong>:<\/p>\n<p>Following are some examples of entity patterns to recognize &#8220;from&#8221; and &#8220;to&#8221; account number for the intent &#8220;transfer funds&#8221;.<br \/>\n<a href=\"#pat_ops\">Pattern operators<\/a> defined above can be applied to entity patterns also.<\/p>\n<ul>\n<li><strong>Pattern<\/strong>: word1 *n &#8211; upto n words after the occurence of word1;<br \/>\npattern for entity ToAccount &#8211;\u00a0 <em>to *1<\/em>;<br \/>\nToAccount captured from user utterance <em>&#8220;transfer funds to ABC123&#8221; <\/em>but <span style=\"text-decoration: underline\">not<\/span> from <em>&#8220;transfer funds for ABC123&#8221;<\/em><\/li>\n<li><strong>Pattern<\/strong>: word1 * word2 or word1 word2 *n &#8211; multiple entities\u00a0 from a user utterance;<br \/>\npatterns for entity ToAccount &#8211;\u00a0 <em>to * from<\/em>; and\u00a0 <em>from to *1;<\/em><br \/>\npatterns for entity FromAccount &#8211;\u00a0 <em>from * to;<\/em> and <em>to from *1<\/em>;<br \/>\nToAccount &amp; FromAccount captured from user utterance <em>&#8220;transfer funds from XYZ321 to ABC123&#8221;<\/em> and <em>&#8220;transfer funds to ABC123 from XYZ321&#8221;<\/em> but <span style=\"text-decoration: underline\">not<\/span> from <em>&#8220;transfer funds for ABC123 using XYZ321&#8221;<\/em><br \/>\nNote: when multiple patterns are entered for an entity, match of either one will be taken.<\/li>\n<li><strong>Pattern<\/strong>: [ word1 word2 ] *n &#8211; match against any one word or phrase as defined within [&#8230;];<br \/>\npattern for entity ToAccount &#8211;\u00a0 <em>to *1<\/em>;<br \/>\npattern for entity FromAccount &#8211;\u00a0 <em>[ using <\/em><em>from ] *1<\/em>;<br \/>\nToAccount &amp; FromAccount captured from user utterance <em>&#8220;transfer funds from XYZ321 to ABC123&#8221;<\/em> and <em>&#8220;transfer funds to ABC123 using XYZ321&#8221;<\/em> but <span style=\"text-decoration: underline\">not<\/span> from <em>&#8220;transfer funds for ABC123 using XYZ321&#8221;<\/em><\/li>\n<li><strong>Pattern<\/strong>: ~concept *n &#8211; pattern built using concepts;<br \/>\npattern for entity ToAccount &#8211;\u00a0 <em>to *1<\/em>;<br \/>\npattern for entity FromAccount &#8211;\u00a0 <em>~from<\/em><em> *1<\/em>; where\u00a0<em>from\u00a0<\/em>is a concept as (using) (from)<br \/>\nToAccount &amp; FromAccount captured from user utterance <em>&#8220;transfer funds from XYZ321 to ABC123&#8221;<\/em> and <em>&#8220;transfer funds to ABC123 using XYZ321&#8221;<\/em> but <span style=\"text-decoration: underline\">not<\/span> from <em>&#8220;transfer funds for ABC123 using XYZ321&#8221;<\/em><\/li>\n<\/ul>\n<p>For more information on how to add patterns, see <a href=\"https:\/\/developer.kore.ai\/v7-1\/v7-1\/docs\/bots\/bot-builder-tool\/train-nlp-optimization\/fundamental-meaning\/fundamental-meaning\/#Managing_Patterns\">Managing Patterns<\/a>.<\/p>\n<h4>Negative Patterns<\/h4>\n<p>Negative patterns\u00a0can be used to eliminate intents detected by the Fundamental Meaning or Machine Learning models.<\/p>\n<p>For example, a\u00a0user says \u201c<em>I was trying to Book a Flight when I faced an issue<\/em>\u201c.\u00a0Though the machine identifies the intent as \u201c<em>Book a Flight<\/em>\u201c, that is not what the user wants to do. In such a case, defining \u201c<em>was trying to *<\/em>\u201d as a negative pattern, would ensure that the matched intent is ignored.<\/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 id=\"synonyms\"><span class=\"ez-toc-section\" id=\"Synonyms\">Synonyms<\/span><\/h3>\n<p>Synonyms need to be used when the words used to identify an intent\/entity can be used interchangeably. Synonyms can be defined for both intents and entities.<\/p>\n<p>Each intent has a name, for example, if your intent name is <em>Guided Search<\/em>. There are many synonyms that a user might enter to start this task, such as \u201cbrowse products,\u201d \u201cShow me makeup,\u201d or \u201cshow me products.\u201d<\/p>\n<p>As a developer, you should limit the name of a task to only two or three words. And then consider synonyms for each of those words.<\/p>\n<p>For example:<\/p>\n<ul>\n<li>Browse \u2013 Find, Search<\/li>\n<li>Product \u2013 Makeup, Goods, Kit<\/li>\n<\/ul>\n<p>Also consider misspellings, such as:<\/p>\n<ul>\n<li>makeup \u2013 make up<\/li>\n<\/ul>\n<p>Synonyms should be ideally defined only for words defined as part of the task name. The synonyms added at the bot level are applicable for all the tasks, i.e. when a developer adds a synonym for a word in Task A, those synonyms are also used for any other tasks with the same words in the task name. For example, synonyms defined for the word browse in the <i> Guided Search<\/i> are also used for the <i>Keyword Search<\/i>. Synonyms can (and should) be used to increase the number of variations that we expect from a user requesting an intent. They supplement existing intent name with alternative wording, while not being so generic as to match everything. Remember that synonyms are unidirectional so foo=bar does not mean bar=foo.<\/p>\n<p>The general guideline for Synonyms:<\/p>\n<ul>\n<li>Use words in their canonical forms (i.e. infinitive verbs, singular nouns)<\/li>\n<li>Use lowercase both for words and their synonyms<\/li>\n<li>Keep synonym phrases to less than 5 words<\/li>\n<li>Use the US spelling of words (i .e. \u201cnormalize\u201d instead of \u201cnormalize\u201d)<\/li>\n<li>Use intent over meaning (i .e., \u201cget\u201d is a good synonym for \u201cshow\u201d if the context of the action means \u201cfind and display\u201d)<\/li>\n<li>Don\u2019t add synonyms to determiners or pronouns (the, a, my, that, etc.)<\/li>\n<li>Don\u2019t use a synonym that could match in two conflicting tasks<\/li>\n<li>Don\u2019t use special characters such as () &amp; \/ \\ $ [ ] + *<\/li>\n<li>Don\u2019t use punctuation such as &#8211; , . ! ? \u2018 \u201c<\/li>\n<li>Don\u2019t assign synonym to multiple words (e.g. this is wrong: wrong, bad)<\/li>\n<li>Don\u2019t add synonyms to digits<\/li>\n<li>Don\u2019t use the phrasal form (i.e. don\u2019t use &#8220;lookup\u201d as a synonym; simply use \u201clook\u201d)<\/li>\n<li>Don\u2019t abbreviate to less than 2 letters<\/li>\n<\/ul>\n<h4>Synonym operations<\/h4>\n<p>A match between the user input and synonym for Entity (only for List of Values and Lookup types) identification can occur in one of the following ways:<\/p>\n<ul>\n<li><strong>Partial match<\/strong> &#8211; this is the <span style=\"text-decoration: underline\">default behavior<\/span> whereby\u00a0one or more words in the input should match one or more words for a given synonym. For example, user utterance &#8216;debit card&#8217; will match the synonym <em>credit card.<\/em><\/li>\n<li><strong>Exact match<\/strong> &#8211; here the input should contain all the words for a given synonym. For example, &#8216;add-on credit card&#8217; will match &#8220;credit card&#8221;. But debit card will not match &#8220;credit card&#8221;. To trigger exact match the synonym should be enclosed within <span style=\"text-decoration: underline\">double quotes<\/span>.<\/li>\n<li><strong>Full match<\/strong> &#8211;\u00a0 the entire input should exactly match a given synonym word.\u00a0For example, &#8216;credit card&#8217; should match &lt;credit card&gt; but &#8216;my credit card&#8217; should NOT match &lt;credit card&gt;. Similarly, &#8216;credit card&#8217; should not match &lt;my credit card&gt;.\u00a0To trigger exact match the synonym should be enclosed within <span style=\"text-decoration: underline\">angular brackets<\/span>.<\/li>\n<li><strong>Canonical form match<\/strong> &#8211; this is the default behavior wherein the user input is matched with the synonym or its canonical form. For example, &#8216;<em>check my balance<\/em>&#8216; will match with synonym &#8216;<em>checking account<\/em>&#8216; since check is the canonical form of checking. <span style=\"text-decoration: underline\">To disable<\/span> this behavior prefix the synonym with <span style=\"text-decoration: underline\">single apostrophe<\/span>\u00a0as\u00a0<em>&#8216;checking<\/em>. (post ver7.1)<\/li>\n<\/ul>\n<div class=\"alert alert-info\"><b>Note: <\/b>Synonyms can be added to identify intents as well as entities. Entity identification is triggered only after an Intent is identified.<\/div>\n<div class=\"alert alert-info\">For more information on how to add synonyms, see <a href=\"\/v7-1\/docs\/bots\/bot-builder-tool\/train-nlp-optimization\/fundamental-meaning\/fundamental-meaning\/#Managing_Synonyms\">Managing Synonyms<\/a>.<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Concepts\">Concepts<\/span><\/h3>\n<p>Concepts are clusters of related and synonymous terms that you want to be considered as a group identified by a single term.<\/p>\n<p>Allowed concept naming conventions:<\/p>\n<ul>\n<li>Must have ~ as prefix<\/li>\n<li>allowed characters in concept name are\n<ul>\n<li>a to z and A-Z<\/li>\n<li>1 to 9<\/li>\n<li>_ (underscore)<\/li>\n<\/ul>\n<\/li>\n<li>at least one alphabet must follow the ~<\/li>\n<li>should not start or end with a _ (underscore)<\/li>\n<li>these are case insensitive i.e ~myConcept is same as ~myconcept<\/li>\n<\/ul>\n<p>Examples for allowed concept names:<\/p>\n<ul>\n<li>~my_concept<\/li>\n<li>~Sample<\/li>\n<li>~test123<\/li>\n<li>~my_new_concept<\/li>\n<\/ul>\n<p>Examples of Invalid concepts names:<\/p>\n<ul>\n<li>~_concept<\/li>\n<li>~concept_<\/li>\n<li>~a-concept<\/li>\n<li>~123test<\/li>\n<\/ul>\n<p>For more information refer to <a href=\"\/v7-1\/docs\/bots\/nlp\/fundamental-meaning\/#Custom_Concepts\">Custom Concepts<\/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=\"Standard_Responses\">Standard Responses<\/span><\/h3>\n<p>Standard Responses are template messages that the platform uses to respond to specific situations during a conversation. Examples of these situations include resolution of ambiguous user inputs, requisition for authorization, obtaining confirmations, informing about interruptions and resumptions, and more. Standard Responses are categorized into the following:<\/p>\n<ul>\n<li>Statements<\/li>\n<li>Greetings<\/li>\n<li>Queries<\/li>\n<li>Errors &amp; Warning<\/li>\n<li>Questions and Choices.<\/li>\n<\/ul>\n<p>While the platform does come with canned responses, developers are encouraged to customize these messages as well as additional variations.<\/p>\n<p>To provide a seamless end-user experience across the conversational journey, developers may have to review each of the Standard Responses to ensure that they fit the overall persona\/theme of the bot.<\/p>\n<p>Standard Responses can be plain text messages or can be generated through JavaScript, to compose dynamic messages and templates for supported channels. Where applicable, Standard Responses support contextual tags that help the developer in customizing the messages.<\/p>\n<p>For example, when user requests for what a bot can do, bot responds with a message &#8216;Here are the tasks I can perform for you. &lt;list-of-tasks&gt;\u2019. In this example, the developer may choose to modify this message and reuse the tag &lt;list-of-tasks&gt;where appropriate. These tags are replaced with the actual text context during the conversation with run-time values.<\/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 id=\"KG\"><span class=\"ez-toc-section\" id=\"Knowledge_Graph\">Knowledge Graph<\/span><\/h3>\n<p>For executable tasks, the intent is identified based on either the task name (used in the Fundamental Meaning model) or machine learning utterances defined for a task. This approach is appropriate when a task can be distinctively identified from other tasks, using language semantics, and statistical probabilities derived from the machine learning model.<\/p>\n<p>In case of FAQs, this approach may not fare well as most of the FAQs are similar to each other in terms of semantic variation, and will require additional intelligence about the domain to find a more appropriate answer.<\/p>\n<p>Kore.ai\u2019s Knowledge Graph-based model provides that additional intelligence required to represent the importance of key domain terms and their relationships in identifying the user\u2019s intent (in this case the most appropriate question).<\/p>\n<p>We will use the following two examples to explain the different configurations required to build a Knowledge graph<\/p>\n<table>\n<tbody>\n<tr>\n<td>Example A<\/td>\n<td>Example B<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">Consider a bot trained with the following questions:<\/p>\n<ul>\n<li><i>A1: How to apply for a loan? <\/i><\/li>\n<li><i>A2: What is the process to apply for insurance? <\/i><\/li>\n<\/ul>\n<\/td>\n<td rowspan=\"2\">Consider a bot trained with the following questions:<\/p>\n<ul>\n<li><i>B1: Can I open a joint account? <\/i><\/li>\n<li><i>B2: How do I add a joint account holder? <\/i><\/li>\n<li><i>B3: How can I apply for a checkbook? <\/i><\/li>\n<\/ul>\n<ul>\n<li><i>B4: How do I apply for a debit card?<\/i><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The following are a few challenges with intent recognition using a typical model based on pure machine learning and semantic rules:<\/p>\n<ol>\n<li>Results obtained from machine learning based models have a tendency to produce a false positive result if the user utterance has more matching terms with the irrelevant question.<\/li>\n<li>The model will fail when the bot needs to comprehend based on domain terms and relationships. For example the user utterance \u201cWhat is the process to apply for a loan ?\u201d will incorrectly fetch A2 as a preferred match instead of A1. As A2 has more terms matching with user utterance than A1.<\/li>\n<li>This model will fail to fetch the correct response if part of a question is stated in a connection with another question. Example A: the user utterance \u201cI have applied for a loan, can I get insurance\u201d will result in the ambiguity between A1 &amp; A2. Example B: User utterance \u201cI have opened a joint account, can I have a debit card\u201c will incorrectly match B1 over B4<\/li>\n<\/ol>\n<p>In Kore knowledge graph model, having all the questions at the root level is equivalent to using a model based on term frequency and semantic rules.<\/p>\n<h4>Key domain terms and their relationship<\/h4>\n<p>Identifying key terms and their relationships is an important aspect of building ontology. Let \u2019s understand this using our sample Example A. Both A1 and A2 are about an application procedure, one talks about applying for a loan while other talks about applying for insurance. So, while creating an ontology we can create a parent node \u201capply\u201d with two child nodes as \u201cloan\u201d and \u201cinsurance\u201d. Then A1 and A2 can be assigned as child nodes of \u201cloan\u201d and \u201cinsurance node\u201d respectively.<\/p>\n<h5><strong>Representation of knowledge graph<\/strong>:<\/h5>\n<h5><strong>Example A<\/strong><\/h5>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/12\/Example-A.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-14316\" src=\"\/wp-content\/uploads\/sites\/12\/Example-A.png\" alt=\"\" width=\"487\" height=\"234\" \/><\/a><br \/>\nSimilarly, in the case of Example B, the graph will be as below<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/12\/Example-B.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-14317\" src=\"\/wp-content\/uploads\/sites\/12\/Example-B.png\" alt=\"\" width=\"443\" height=\"441\" \/><\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Capabilities_of_a_Graph_Engine\">Capabilities of a Graph Engine<\/span><\/h3>\n<ul>\n<li><b>Ease of training using synonyms<\/b>: Kore.ai\u2019s Knowledge Graph has a provision to associate synonyms against a graph node. This helps capture the variation in a question. Example: In <i>Example A <\/i>above<i>, a <\/i>user can put \u201cget\u201d as a synonym to \u201capply.\u201d<\/li>\n<li><b>Better Coverage with alternate questions<\/b>: Knowledge Graph has a provision to add alternate questions. This helps us to capture the various ways a user might ask the same question. In Example B above, for the question \u201c<i>How do I add a joint account holder<\/i>\u201d we can add an alternate question as \u201c<i>Can I add my wife as a joint account holder<\/i>\u201d<\/li>\n<li><b>Improved accuracy<\/b>: Ontology-driven question-answers reduce the possibility of false positives. For example, for the user utterance \u201c<i>What is the process to apply for SSN<\/i> \u201d a term frequency based model will incorrectly suggest A2 as a match. An ontology-driven model has the capability to prevent such false positives.<\/li>\n<li><b>Weighing Phrases using classes<\/b>: Kore.ai\u2019s graph engine has introduced a concept of classes for filtering out irrelevant suggestions. See the below section on classes for a detailed explanation<\/li>\n<li><b>Ability to mark term importance<\/b>: Kore.ai\u2019s graph engine has a provision to mark an ontology term as important. For example, in a question, \u201c<i>How to apply for a loan<\/i>\u201d, \u201cloan\u201d is an important term. If a \u2018loan\u2019 keyword is not present in the user utterance, then it makes little sense to fetch A1. Whereas in term frequency based model a user utterance \u201cHow to apply for a\u201d will incorrectly fetch A1.<\/li>\n<li><b>Ability to group relevant nodes<\/b>: As the graph grows in size, managing graph nodes can become a challenging task. Using \u201corganizer node\u201d construct of ontology engine, bot developer can group relevant nodes under a node.<\/li>\n<\/ul>\n<h4>Knowledge Graph Traits<\/h4>\n<p><strong>Note<\/strong>: Traits replace Classes from ver 6.4 and before.<\/p>\n<p>When using trait ensure you use it judicially as over usage may result in false negatives. When using classes ensure:<\/p>\n<ul>\n<li>Good coverage of classes<\/li>\n<li>Classes should not get generalized improperly<\/li>\n<li>All the FAQs get tagged to mutually exclusive classes.<\/li>\n<\/ul>\n<p>Following is the example of how classes work: Let&#8217;s say we create a class called <i>Request<\/i> and add request related phrases to it. If the user says \u201d<i>I would like to get WebEx<\/i>\u201d and \u201c<i>I would like to get<\/i>\u201d is trained for the Request&#8217; class, this FAQ is only considered across the Knowledge Graph paths where the word request is tagged with. This is a positive scenario. But if the user says \u201d<i>Can you help with getting WebEx<\/i>\u201d, and we did not have similar utterances trained for the <i>Request <\/i>class, it gets tagged with &#8216;None&#8217; class and this FAQ is only used with the paths where &#8216;the word <i>request <\/i>isn\u2019t present. This results in a failure.<\/p>\n<p>Another possibility is that if user says \u201c<i>I want to request for help fixing WebEx<\/i>\u201d and we have trained the<i> Request<\/i> class with some utterances having \u201d<i>I want to request<\/i> \u201c, and based on the training provided across all classes, the engine may generalize and tag this feature (phrase containing <i> I want to request<\/i> ) to the <i>Request <\/i>class. In this case, if the <i>Request <\/i>class is not present in the help path for WebEx, this results in failure of identifying the input against &#8216;help&#8217; -&gt; &#8216;WebEx&#8217;.<\/p>\n<p>The cases where classes are useful is when we have a mutually exclusive set of FAQs. For example, if we have a set of FAQs for <i>Product issues <\/i>and also a set of FAQs for <i>Process for buying a product<\/i>.<br \/>\nFAQs for <i>Process for buying a product<\/i>:<\/p>\n<ol>\n<li>How do I buy Microsoft Office online?<\/li>\n<li>What is the process for buying antivirus software<\/li>\n<\/ol>\n<p>FAQs for <i>Product issues<\/i>:<\/p>\n<ol>\n<li>I am having issues installing software<\/li>\n<li>How to resolve an issue with antivirus<\/li>\n<\/ol>\n<p>When a user says \u201d<i>What is the process for fixing antivirus when it doesn&#8217;t work<\/i>\u201d, the engine may find that this input is similar to both A2 and B2, and may present both of them as suggestions. We know that <i>Issue<\/i> is mutually exclusive to <i>buy<\/i>, and it does not make sense present <i>buy<\/i> related FAQs at all, in this case. The opposite (matching <i>Issue<\/i> FAQs for <i>buy <\/i>related question) may be a much bigger problem. To solve this, we will create two classes, one for type <i>issue <\/i>and another for <i>buy<\/i>. Every input will be classified into either <i>buy<\/i> or <i>issue <\/i>and only the relevant questions will be used in finding an appropriate answer.<\/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":"Intent Naming Guidelines Follow the below guidelines when naming your task (intent identifier) Use action verb, an object and possibly a modifier (placed before or after the object). Typically, an intent name consists of 2 to 4 words. Use less than 5 words to convey the purpose of the task Use the same verb in...","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-18053","post","type-post","status-publish","format-standard","hentry","category-nlp"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/posts\/18053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/comments?post=18053"}],"version-history":[{"count":16,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/posts\/18053\/revisions"}],"predecessor-version":[{"id":23017,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/posts\/18053\/revisions\/23017"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/media?parent=18053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/categories?post=18053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-1\/wp-json\/wp\/v2\/tags?post=18053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}