{"id":22586,"date":"2019-10-03T07:42:23","date_gmt":"2019-10-03T06:42:23","guid":{"rendered":"https:\/\/developer.kore.ai\/v7-3\/?p=22586"},"modified":"2020-03-13T09:55:37","modified_gmt":"2020-03-13T09:55:37","slug":"knowledge-ontology","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-3\/docs\/bots\/bot-builder-tool\/knowledge-task\/knowledge-ontology\/","title":{"rendered":"Knowledge Graph"},"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>Kore.ai\u2019s Knowledge Graph helps you turn your static FAQ text into an intelligent, personalized conversational experience. It goes beyond the usual practice of capturing FAQs in the form of flat question-answer pairs. Instead, Knowledge Graph enables you to create an ontological structure of key domain terms and associate them with context-specific questions and their alternatives, synonyms, and Machine learning-enabled traits. This Graph, when trained by the platform, enables an intelligent FAQ experience.<\/p>\n<p>This document talks of the concepts, terminology and implementation of Knowledge Graph. For a use case driven approach to Knowledge Graph, <a href=\"\/v7-3\/docs\/bots\/how-tos\/how-to-build-knowledge-graph\/\" target=\"_blank\" rel=\"noopener noreferrer\">refer here<\/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<h2><span class=\"ez-toc-section\" id=\"Why_Knowledge_Graph\">Why Knowledge Graph<\/span><\/h2>\n<p>Any query can be expressed in multiple ways by the user. It is a difficult task for you to visualize and add all the alternative questions manually.<\/p>\n<p>Kore.ai designed Knowledge Graph with nodes, tags, and synonyms which would make the work easier for you to cover all the possible matches. The Knowledge Graph can handle various alternate questions with the training using the nodes, tags, and synonyms.<\/p>\n<p>Whenever a question is asked by the user, the node names in the Knowledge Graph will be checked and matched with the keywords from the user utterance. Node names, tags, and synonyms will be checked and based on the score, questions would be shortlisted as likely matches or intents. These shortlisted questions are then compared with the actual user utterance to come up with the best possible intent to be presented to the user. The response can take the form of either a simple response or execution of a dialog task.<\/p>\n<p>This way, you can add a very few completely different alternative questions in the FAQ and provide tags, synonyms and node names appropriately such that any untrained question can also be matched. The performance and intelligence of the Knowledge Graph depend on the way you train it with the appropriate node names, tags, and synonyms.<\/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 id=\"ontology\"><span class=\"ez-toc-section\" id=\"Terminology\">Terminology<\/span><\/h2>\n<p>This document is intended to familiarize the reader with the terms used in building Knowledge Graph.<\/p>\n<p><a href=\"\/v7-3\/docs\/bots\/bot-builder-tool\/knowledge-task\/creating-a-knowledge-graph\/\" target=\"_blank\" rel=\"noopener noreferrer\">Jump directly to KG Creation<\/a>.<\/p>\n<h4>Terms or Nodes<\/h4>\n<p>Terms or Nodes are the building blocks of an ontology and they can be used to define the fundamental concepts and categories of a business domain.<\/p>\n<p>As shown in the image below, you can organize the terms on the left-hand panel of the Bot Ontology window in a hierarchical order to represent the flow of information in your organization. You can create, organize, edit, and delete terms from there.<\/p>\n<p>For easier representation, we identify some special nodes using the following names:<\/p>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/15\/nodes.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12099\" src=\"\/wp-content\/uploads\/sites\/15\/nodes.png\" alt=\"\" width=\"488\" height=\"419\" \/><\/a><\/p>\n<h5>Root Node<\/h5>\n<p>Root node forms the topmost term of your Bot Ontology. A Knowledge Graph consists of only one root node and all other nodes in the ontology become its child nodes. Root node takes the name of the bot by default, but you can change it if you want. This node is not used for node qualification or processing. The path qualification starts from first-level nodes.<\/p>\n<h5>First-level Nodes<\/h5>\n<p>The immediate next level nodes of the root node are known as First-level nodes. There can be any number of First-level nodes in a collection. It is recommended to keep First-level nodes to represent high-level terms such as the names of departments or functionality. Examples &#8211; Personal Banking, Online Banking, and Corporate Banking.<\/p>\n<h5>Leaf Node<\/h5>\n<p>Any node to which question-answer set or dialog task is added is called a <i>Leaf Node<\/i>, be it at any level.<\/p>\n<h5>Node Relation<\/h5>\n<p>Depending on their position in the ontology, a node can be referred to as first-level nodes, second-level nodes, etc.. A first-level node is in simple terms a category that may have one or more subcategories under it, called the second-level nodes.<\/p>\n<p>Examples: Loan is the first-level node of Home Loan and Personal Loan. Personal Loan can again have two subcategory nodes: Rate and Fees, Help and Support.<\/p>\n<div class=\"alert alert-info\"><b>Note<\/b>: This hierarchical organization of nodes is just for your convenience alone, to keep related questions together. Knowledge Graph Engine does not consider any parent-child relation while evaluating the questions for a match. The hierarchy does not in any way influence the FAQ matching processing since all the nodes will be considered the same way irrespective of their position in the FAQ organization.<\/div>\n<div><\/div>\n<h4>Tags<\/h4>\n<div>For each term\/node you can add custom tags. Tags work exactly like terms but are not displayed in the Knowledge Graph ontology to avoid clutter. You can add synonyms and traits to tags as you do to terms.<\/div>\n<h4>Synonyms<\/h4>\n<p>Users would use a variety of alternatives for the terms of your ontology. Knowledge Graph allows you to add synonyms for the terms to include all possible alternative forms of the terms. Adding synonyms also reduces the need for training the bot with alternative questions.<\/p>\n<p>For example, the Internet Banking node may have the following synonyms added to it: Online Banking, e-banking, Cyberbanking, and Web banking.<\/p>\n<p>When you add a synonym for a term in the Knowledge Graph, you can add them as local or global synonyms. Local synonyms (or Path Level Synonyms) apply to the term only in that particular path, whereas global synonyms (or Knowledge Graph Synonyms) apply to the term even if it appears on any other path in the ontology.<\/p>\n<p>Post release 7.2, you can enable the usage of Bot Synonyms inside the Knowledge Graph engine for path qualification and question matching. With this setting, you need not recreate the same set of synonyms in Bot Synonyms and in KG Synonyms.<\/p>\n<h4>Traits<\/h4>\n<p><strong>Note:<\/strong> From ver 7.0, Traits replace Classes of ver 6.4 and before.<\/p>\n<p>A trait is a collection of typical end-user utterances that define the nature of a question when they ask for information related to a particular intent. <a href=\"\/v7-3\/docs\/bots\/nlp\/traits\/\" target=\"_blank\" rel=\"noopener noreferrer\">See here for more on traits<\/a>.<\/p>\n<p>A trait can be applied to multiple terms across your Bot Ontology.<\/p>\n<div class=\"alert alert-info\"><b>Note<\/b>: Traits also help you filter nodes based on associated user utterances. So, if the user types an utterance that is present in a trait, the bot only searches the nodes to which the trait is applied. If the utterance is present in any other node to which the trait is not applied, the node is ignored by the bot.<\/div>\n<h4>Intent<\/h4>\n<p>A bot can respond to a given question from the user either with an execution of a Dialog Task or an FAQ.<\/p>\n<ul>\n<li><strong>FAQ<\/strong>: The question-answer pairs must be added to relevant nodes in your bot ontology.<br \/>\nA question may be asked differently by different users and to support this, you may associate multiple alternate forms for each question.<br \/>\nPreceding an alternate question with || will allow you to enter patterns for FAQs (post 7.2 release).<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/15\/question-answers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12100 alignnone\" src=\"\/wp-content\/uploads\/sites\/15\/question-answers.png\" alt=\"\" width=\"1047\" height=\"385\" \/><\/a><\/li>\n<li><strong>Task<\/strong>: Linking a Dialog task to a KG Intent helps to leverage the capabilities of the Knowledge Graph and Dialog tasks to handle FAQs that involve complex conversations.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/15\/question-task.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23021\" src=\"\/wp-content\/uploads\/sites\/15\/question-task.png\" alt=\"\" width=\"912\" height=\"301\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/15\/20221201095449\/question-task.png 912w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/15\/20221201095449\/question-task-300x99.png 300w\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" \/><\/a><\/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=\"Improving_Performance\"><span style=\"font-weight: 400\">Improving Performance<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">Though Knowledge Graph engine works well with the default settings, you, as a Bot developer, can fine-tune the KG engine performance in many ways:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Configure Knowledge Graph properly by defining terms, synonyms, primary and alternative questions or user utterances. Though hierarchy does not affect the KG engine performance, it does help in organizing and guiding the working of the KG engine.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Setting the following parameters:<\/span>\n<ul>\n<li style=\"font-weight: 400\"><b>Path Coverage<\/b><span style=\"font-weight: 400\"> \u2013 Define the minimum percentage of terms in the user\u2019s utterance to be present in a path to qualify it for further scoring.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Definite Score for KG<\/b><span style=\"font-weight: 400\"> \u2013 Define minimum score for a KG intent match to be considered as a definite match and discard any other intent matches found.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Minimum and Definitive Level for Knowledge Tasks<\/b><span style=\"font-weight: 400\"> \u2013 Define minimum and definitive threshold to identify and respond in case of a Knowledge task.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>KG Suggestions Count<\/b><span style=\"font-weight: 400\"> \u2013 Define the maximum number of KG \/ FAQ suggestions to be presented when a definite KG intent match is not available.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>The proximity of Suggested Matches<\/b><span style=\"font-weight: 400\"> \u2013 Define the maximum difference to be allowed between top-scoring and immediate next suggested questions to consider them as equally important.<\/span><\/li>\n<\/ul>\n<p>While the platform provides default values for the above-mentioned thresholds, these can be customized from the <b>Natural Language -&gt; Training -&gt; Thresholds &amp; Configurations<\/b>.<\/li>\n<li style=\"font-weight: 400\"><b>Qualify Contextual Paths<\/b> &#8211; This will ensure that the Bot context is populated and retained with the terms\/nodes of the matched intent. This will further smooth the user experience.<\/li>\n<li style=\"font-weight: 400\"><b>Traits<\/b> &#8211; As mentioned earlier, traits can be used to qualify a nodes\/terms even if the user utterance does not contain the term\/node. Traits are also helpful in filtering the suggested intent list.<\/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<h2><span class=\"ez-toc-section\" id=\"Working_of_KG_Engine\">Working of KG Engine<\/span><\/h2>\n<p>Knowledge Graph engine uses a two-step approach while extracting the right response to the user utterance. It combines a search-driven intent detection process with rule-based filtering. The settings for path coverage (percentage of terms needed) and term usage (mandatory or optional) in user utterance helps in the initial filtering of the FAQ intents. Tokenization and n-gram based cosine scoring model aids in the fulfillment of the final search criteria.<\/p>\n<p>Training of the Knowledge Graph involves the following steps:<\/p>\n<ul>\n<li>All the terms\/nodes along with synonyms are identified and indexed<\/li>\n<li>Using these indices, a flattened path is established for each KG Intent.<\/li>\n<\/ul>\n<p>Once the Knowledge Graph Engine receives a user utterance:<\/p>\n<ul>\n<li>The user utterance and KG nodes\/terms are tokenized and n-gram is extracted (a max of quad-gram is supported by Knowledge Graph Engine)<\/li>\n<li>The tokens are mapped with the KG nodes\/terms to obtain their respective indices<\/li>\n<li>Path comparison between the user utterance and KG nodes\/terms establishes the qualified path for that utterance. This step takes into consideration the path coverage and term usage mentioned above.<\/li>\n<li>From the list of questions in the qualified path, the best match is picked based upon cosine scoring.<\/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><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"Kore.ai\u2019s Knowledge Graph helps you turn your static FAQ text into an intelligent, personalized conversational experience. It goes beyond the usual practice of capturing FAQs in the form of flat question-answer pairs. Instead, Knowledge Graph enables you to create an ontological structure of key domain terms and associate them with context-specific questions and their alternatives,...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-22586","post","type-post","status-publish","format-standard","hentry","category-knowledge-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/22586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/comments?post=22586"}],"version-history":[{"count":13,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/22586\/revisions"}],"predecessor-version":[{"id":23313,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/22586\/revisions\/23313"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/media?parent=22586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/categories?post=22586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/tags?post=22586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}