{"id":18149,"date":"2019-03-04T07:00:45","date_gmt":"2019-03-04T07:00:45","guid":{"rendered":"https:\/\/developer.kore.ai\/developer-2\/?post_type=docs&#038;p=16989"},"modified":"2021-03-25T09:17:20","modified_gmt":"2021-03-25T09:17:20","slug":"nlp-detection","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-0\/docs\/bots\/nlp\/nlp-detection\/","title":{"rendered":"Ranking and Resolver"},"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>The Kore.ai NLP engine uses Machine Learning, Fundamental Meaning, and Knowledge Graph (if any) models to match intents. All the three Kore.ai engines finally deliver their findings to the Kore.ai Ranking and Resolver component as either exact matches or probable matches. <strong>Ranking and Resolver<\/strong> determines the final winner of the entire NLP computation.<\/p>\n<p>The NLP engine uses a hybrid approach using Machine Learning, Fundamental Meaning, and Knowledge Graph (if the bot has one) models to score the matching intents on relevance. The model classifies user utterances as either being\u00a0<i>Possible Matches<\/i>\u00a0or\u00a0<i>Definitive Matche<\/i>s.<br \/>\n<i><\/i><\/p>\n<p><i>Definitive Matches<\/i>\u00a0get high confidence scores and are assumed to be perfect matches for the user utterance. In published bots, if user input matches with a single\u00a0<i>Definitive Match<\/i>, the bot directly executes the task. If the utterances match with multiple\u00a0<i>Definitive Matches<\/i>, they are sent as options for the end user to choose one.<\/p>\n<p>On the other hand,\u00a0<i>Possible Matches<\/i>\u00a0are intents that score reasonably well against the user input but do not inspire enough confidence to be termed as exact matches. Internally the system further classifies possible matches into good and unsure matches based on their scores. If the end user utterances were generating possible matches in a published bot, the bot sends these matches as\u00a0<i>\u201cDid you mean?\u201d<\/i>\u00a0suggestions for the end user.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>Based on the ranking and resolver, the winning intent between the engines is ascertained. If the platform finds ambiguity, then an ambiguity dialog is initiated. The platform initiates one of these two system dialogs when it cannot ascertain a single winning intent for a user utterance :<\/p>\n<ul>\n<li><b>Disambiguation Dialog<\/b>: Initiated when there are more than one <i>Definitive <\/i>matches returned across engines. In this scenario, the bot asks the user to choose a <i>Definitive <\/i>match to execute. You can customize the message shown to the user from the NLP Standard Responses.<\/li>\n<li><b>Did You Mean Dialog<\/b>: Initiated if the Ranking and Resolver returns more than one winner or the only winning intent is an FAQ whose KG engine score is between lower and upper thresholds. This dialog lets the user know that the bot found a match to an intent that it is not entirely sure about and would like the user to select to proceed further. In this scenario, the developer should identify these utterances and train the bot further. You can customize the message shown to the user from the NLP Standard Responses.<\/li>\n<\/ul>\n<p><a href=\"\/docs\/bots\/bot-builder-tool\/test-your-bot\/testing-your-bot-with-nlp\/#Analyzing_the_Test_Results\">Learn more about model scores and resolver<\/a>.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium 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=\"nlp-detection\"><span class=\"ez-toc-section\" id=\"NLP_Detection\">NLP Detection<\/span><\/h3>\n<p>The Natural Language Analysis will result in the following scenarios:<\/p>\n<ul>\n<li>NLP Analysis identifying a Definitive match with FM or ML or KG engines<\/li>\n<li>NLP Analysis with Multiple engines returning probable match and selecting a single match<\/li>\n<li>NLP Analysis with Multiple engines returning probable match and resolver returning back multiple results<\/li>\n<li>NLP Analysis with No match<\/li>\n<\/ul>\n<p>Each of the above cases is discussed in this section.<\/p>\n<p>To understand NLP detection, let us use the example of a Bank bot with the following details:<\/p>\n<ul>\n<li>The bot consists of 5 Dialog Tasks and a Default Dialog<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/Example-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14296 size-full\" src=\"\/wp-content\/uploads\/sites\/11\/Example-1.png\" alt=\"\" width=\"945\" height=\"451\" \/><\/a><\/li>\n<li>The intents have been trained with Synonyms, Patterns and ML utterances<\/li>\n<li>The bot consists of a knowledge graph defined with 86 FAQs distributed in 4 top-level terms<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/Example-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14297 size-full\" src=\"\/wp-content\/uploads\/sites\/11\/Example-2.png\" alt=\"\" width=\"862\" height=\"541\" \/><\/a><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium 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<h4>Scenario 1 &#8211; NLP Analysis with FM identifying a <i>Definitive match<\/i><\/h4>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/Scenario-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14298 alignnone\" src=\"\/wp-content\/uploads\/sites\/11\/Scenario-1.png\" alt=\"\" width=\"804\" height=\"405\" \/><\/a><\/p>\n<ul>\n<li>The Fundamental meaning(FM) model identified the utterance as a <i>Definitive match<\/i>.<\/li>\n<li>The Machine Learning (ML) model also identified it as a<i> Possible match.<\/i><\/li>\n<li>The score returned for the task identified is 6 times more than other intent scores. Also, all the words in the intent name are present in the user utterance. Thus the FM model termed it a <i>Definitive match<\/i>.<\/li>\n<li>The ML model matches the Find ATM intent as a <i>Probable match<\/i>.<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium 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<h4>Scenario 2 &#8211; NLP Analysis with ML identifying a <i>Definitive match<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/scenario-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14299 alignnone\" src=\"\/wp-content\/uploads\/sites\/11\/scenario-2.png\" alt=\"\" width=\"858\" height=\"435\" \/><\/a><br \/>\n<\/i><\/h4>\n<ul>\n<li>The ML Model returns a Definitive match with other models returning no match<\/li>\n<li>The FM model could not identify this task as none of the words in the task name <i>Transfer Funds<\/i> matched the words in the user utterance.<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium 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<h4>Scenario 3 &#8211; NLP Analysis with KG identifying a <i>Definitive match<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/scenario-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14300 alignnone\" src=\"\/wp-content\/uploads\/sites\/11\/scenario-3.png\" alt=\"\" width=\"850\" height=\"420\" \/><\/a><br \/>\n<\/i><\/h4>\n<ul>\n<li>The user utterance is &#8220;<i>How do I make transfer money to a London account?&#8221;<\/i><\/li>\n<li>The user utterance contains all the terms required to match this Knowledge task path Transfer, Money, International.<\/li>\n<li>The term international is identified as a synonym of London that the user used in the utterance.<\/li>\n<li>As 100% path term matched the path was qualified. As part of confidence scoring, the terms in the user query are similar to that of the actual Knowledge task question. Thus, it returns a score of 100.<\/li>\n<li>As the score returned is above 100, the intent is marked as <i>a Definitive match<\/i> and selected.<\/li>\n<li>FM engine found it a <i>Probable match<\/i> as the key term <i>Transfer <\/i>is present in the user utterance<\/li>\n<li>ML engine found the utterance as a <i>Probable match<\/i> as the utterance did not fully match any trained utterance.<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium 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<h4>Scenario 4 &#8211; NLP Analysis with Multiple engines returning probable match and selecting a single match<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/scenario-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14301 alignnone\" src=\"\/wp-content\/uploads\/sites\/11\/scenario-4.png\" alt=\"\" width=\"957\" height=\"466\" \/><\/a><\/h4>\n<ul>\n<li>All the 3 engines returned possible match and no definitive match<\/li>\n<li>ML Model has 1 possible matches and FM Model has 2 possible matches, of which 1 is common. Knowledge Graph has 1 possible match. All possible matches identified are re-ranked in the Ranking and Resolver.<\/li>\n<li>The Ranking and Resolver component returned the highest score for the single match (Task name &#8211; \u201c When can I start making payments using BillPay plus? \u201d) from Knowledge graph engine. The scores for other probable match come out to be lower than 2 percentile of the top score and are thus ignored. The winner, in this case, is the \u2018KG\u2019 returned query and is presented to the user.<\/li>\n<li>Though most of the keywords in the user utterance map to the keywords in the KG query, still this is not a definitive match because\n<ul>\n<li>The number of path term matched are not 100%<\/li>\n<li>The KG engine returned the score with 64.72% probability. Had we used the word \u2018Billpay\u2019 instead of \u2018bill pay\u2019 the score would have been 87.71%. (still not a 100% match)<\/li>\n<li>Now as the score is between the 60%-80% threshold the Query is presented as part of the \u2018Did-you-mean\u2019 dialog and not as a complete winner. If the score was above 80% the platform would have given out the response without re-confirming with the \u2018Did-you-mean\u2019 dialog.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/scenario-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14302 alignnone\" src=\"\/wp-content\/uploads\/sites\/11\/scenario-5.png\" alt=\"\" width=\"951\" height=\"451\" \/><\/a><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium 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<h4>Scenario 5 &#8211; NLP Analysis with Multiple engines returning probable match and resolver returning back multiple results<\/h4>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/scenario-5-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14303 alignnone\" src=\"\/wp-content\/uploads\/sites\/11\/scenario-5-1.png\" alt=\"\" width=\"688\" height=\"370\" \/><\/a><\/p>\n<ul>\n<li>All the engines detected probable matches<\/li>\n<li>KG returned with 2 possible paths<\/li>\n<li>Ranking and resolver found the 2 queries with a score less than 2% apart.<\/li>\n<li>Both the Knowledge tasks are selected and presented to the user as \u2018Did-you-mean\u2019<\/li>\n<li>Both the paths were selected as terms in both matched and the score for both the paths is more than 60%<\/li>\n<\/ul>\n<h4><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/scenarion-5-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14304 alignnone\" src=\"\/wp-content\/uploads\/sites\/11\/scenarion-5-2.png\" alt=\"\" width=\"684\" height=\"364\" \/><\/a><\/h4>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium 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<h4>Scenario 6 &#8211; NLP Analysis with No match<\/h4>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/scenario-6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14305 alignnone\" src=\"\/wp-content\/uploads\/sites\/11\/scenario-6.png\" alt=\"\" width=\"705\" height=\"435\" \/><\/a><\/p>\n<ul>\n<li>None of the engines could identify any trained intent or Knowledge query<\/li>\n<li>In this scenario, the default intent will be triggered.<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium 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":"The Kore.ai NLP engine uses Machine Learning, Fundamental Meaning, and Knowledge Graph (if any) models to match intents. All the three Kore.ai engines finally deliver their findings to the Kore.ai Ranking and Resolver component as either exact matches or probable matches. Ranking and Resolver determines the final winner of the entire NLP computation. The NLP...","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-18149","post","type-post","status-publish","format-standard","hentry","category-nlp"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts\/18149","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=18149"}],"version-history":[{"count":6,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts\/18149\/revisions"}],"predecessor-version":[{"id":20749,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts\/18149\/revisions\/20749"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/media?parent=18149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/categories?post=18149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/tags?post=18149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}