{"id":26919,"date":"2021-02-19T09:57:37","date_gmt":"2021-02-19T09:57:37","guid":{"rendered":"https:\/\/developer.kore.ai\/v9-1\/?p=26919"},"modified":"2021-08-17T11:06:48","modified_gmt":"2021-08-17T10:06:48","slug":"intent-scoping-using-group-node","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-1\/docs\/bots\/how-tos\/intent-scoping-using-group-node\/","title":{"rendered":"Intent Scoping using Group Node"},"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>Adding contextually relevant sub-intents is one of the important elements in building conversational bots. Contextually relevant intents could be required for various purposes like taking a different path in the dialog flow, amending previously provided entity values, etc.<\/p>\n<p>We have seen how to use the contextual data in combination with the interruption handling to achieve a more natural and human-like interaction with the bot in <a href=\"\/docs\/bots\/how-tos\/context-switching\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Manage Context Switching<\/a>.\u00a0This feature primarily aims to let you define the interruption behavior across any two intents. Defining behavior for contextual relevant intents with custom fulfillment behavior can be difficult using this feature.<\/p>\n<p>With the objective of simplifying the contextual NLU, the Group node functionality has been enhanced with intent scoping, training, and fulfillment configuration, <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/grouping-nodes\/\" target=\"_blank\" rel=\"noopener noreferrer\">refer here for details<\/a>.<\/p>\n<p>In this How-To, we will explore a scenario in a Flight Booking Bot which includes digressions, amending input values, and contextual follow-ups queries. We will be using the Group Node to achieve all this easily and from a single place.<\/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=\"Problem_Statement\">Problem Statement<\/span><\/h2>\n<p>During the course of booking a flight ticket:<\/p>\n<ol>\n<li>the user might change their mind regarding the destination, and\/or the travel date;<\/li>\n<li>the user might want to check for weather information, that is not part of the book flight task, before confirming the booking;<\/li>\n<li>the user might have a follow-up question regarding their booking;<\/li>\n<li>the user may choose to cancel the task.<\/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=\"Prerequisites\">Prerequisites<\/span><\/h2>\n<p>In this how-to, we are using a Flight Details bot with the following dialog tasks<\/p>\n<ol>\n<li><strong>Book Flight<\/strong> dialog which\n<ol>\n<li>prompts the user for source, destination, date of travel, and web check-in options;<\/li>\n<li>display a booking confirmation message (for simplicity we have not added the service call to do the actual booking);<\/li>\n<li>check if the user needs any further assistance;<\/li>\n<li>end the conversation.<\/li>\n<\/ol>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105518\/ht_group_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31531\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105518\/ht_group_1.png\" alt=\"\" width=\"775\" height=\"643\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105518\/ht_group_1.png 775w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105518\/ht_group_1-300x249.png 300w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/a><\/li>\n<li><strong>Weather Report<\/strong> dialog which\n<ol>\n<li>prompts the user for the location they want the weather report;<\/li>\n<li>display the weather report message (for simplicity we have not added the service call to do the actual weather lookup);<\/li>\n<\/ol>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105601\/ht_group_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31532\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105601\/ht_group_2.png\" alt=\"\" width=\"525\" height=\"453\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105601\/ht_group_2.png 525w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105601\/ht_group_2-300x259.png 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><\/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=\"Implementation\">Implementation<\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Amend_Entities\">Amend Entities<\/span><\/h3>\n<p>Let us look at the case where the user might want to change the destination and\/or travel date.<br \/>\nFollowing are the steps to achieve the same:<\/p>\n<p><strong>Step 1: Group the nodes for sub-intent scoping<\/strong>:<\/p>\n<p>The first step would be to define the scope for the sub-intent which would trigger changes to the destination and travel date.<\/p>\n<ol>\n<li>The user should be able to change the destination or the travel date any time during the conversation but before the actual booking, hence the scope would be entity nodes.<br \/>\nUsing the mouse, select the entities forming a Group Node.<\/li>\n<li><strong>Name<\/strong> the Group, say <em>Travel Details Group<\/em><br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105713\/ht_group_3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31533\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105713\/ht_group_3.png\" alt=\"\" width=\"695\" height=\"468\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105713\/ht_group_3.png 695w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105713\/ht_group_3-300x202.png 300w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/a><\/li>\n<\/ol>\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><strong>Step 2a: Define sub-intents, train and set behavior properties for destination and travel date changes<br \/>\n<\/strong><\/p>\n<p>Next, we need to define the sub-intents, add training, and optionally set the conditions when the sub-intent should be identified, and the bot behavior in such a case.<\/p>\n<p>Let us first consider the case of enabling changes to destination and travel date:<\/p>\n<ol>\n<li>From the Entity Group window, click the <strong>Add Intent<\/strong> button\n<ol>\n<li><strong>Create Intent<\/strong> for allowing a change in travel date and destination\n<ul>\n<li>Enter a <strong>name<\/strong> for the intent, say\u00a0<em>Change Date and Destination<\/em><\/li>\n<li>Enter a <strong>description<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>Using the <strong>Machine Learning<\/strong> option under <strong>Training<\/strong>, let us train with user utterance that would identify this intent\n<ul>\n<li>Add an utterance, say &#8220;<em>Let&#8217;s try a different date and destination<\/em>&#8220;<\/li>\n<li>Optionally add another utterance, say &#8220;<em>I have changed my mind, let&#8217;s start over again<\/em>&#8220;<\/li>\n<li><strong>Train<\/strong> the sub-intent for this utterance<\/li>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105817\/ht_group_4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31534\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105817\/ht_group_4.png\" alt=\"\" width=\"1133\" height=\"381\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105817\/ht_group_4.png 1133w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105817\/ht_group_4-300x101.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105817\/ht_group_4-1024x344.png 1024w\" sizes=\"auto, (max-width: 1133px) 100vw, 1133px\" \/><\/a><\/li>\n<li>Reset the destination and travel date values:\n<ul>\n<li>In the\u00a0<strong>Set Context Variables<\/strong> option under\u00a0<strong>Fulfillment<\/strong> reset the destination city and the travel date using the following key-value pairing:<br \/>\n<table>\n<tbody>\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>context.entities.To<\/td>\n<td>null<\/td>\n<\/tr>\n<tr>\n<td>context.entities.When<\/td>\n<td>null<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ul>\n<\/li>\n<li>Optionally <strong>Present a Message<\/strong> to the user regarding the changes, say <em>&#8220;Alright, starting all over again&#8221;<\/em><\/li>\n<li>Under <strong>Transition Flow<\/strong>, take the flow back to the <em>From<\/em> entity node using the\u00a0<strong>Jump To A Node<\/strong> option. Since the\u00a0<em>From<\/em> entity value is not changed, the flow would go to the next entity\u00a0<em>To<\/em> and\u00a0<em>When<\/em><br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105951\/ht_group_5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31535\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105951\/ht_group_5.png\" alt=\"\" width=\"454\" height=\"1310\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105951\/ht_group_5.png 454w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105951\/ht_group_5-104x300.png 104w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817105951\/ht_group_5-355x1024.png 355w\" sizes=\"auto, (max-width: 454px) 100vw, 454px\" \/><\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\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><strong>Step 2b: Define sub-intents, train and set behavior properties for destination changes along with NER training<\/strong><\/p>\n<p>Continuing with the above use case of changing original entity values, chances are users would be specifying the changes in their utterance. Consider the case where the user indicates the change in the destination in their utterance.<\/p>\n<ol>\n<li>Click the <strong>Add Intent<\/strong> button to add a new sub-intent\n<ol>\n<li><strong>Create Intent<\/strong> for allowing a change in destination\n<ul>\n<li>Enter a <strong>name<\/strong> for the intent, say\u00a0<em>Change Destination<\/em><\/li>\n<li>Enter a <strong>description<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>Using the <strong>Machine Learning<\/strong> option under <strong>Training<\/strong>, let us train with user utterance that would identify this intent\n<ul>\n<li>Add an utterance, say &#8220;<em>Instead let&#8217;s go to Chicago<\/em>&#8220;<\/li>\n<li>Using the NER approach, annotate the To entity in the utterance.<\/li>\n<li><strong>Train<\/strong> the sub-intent for this utterance<\/li>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110253\/ht_group_6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31537\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110253\/ht_group_6.png\" alt=\"\" width=\"1137\" height=\"409\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110253\/ht_group_6.png 1137w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110253\/ht_group_6-300x108.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110253\/ht_group_6-1024x368.png 1024w\" sizes=\"auto, (max-width: 1137px) 100vw, 1137px\" \/><\/a><\/li>\n<li>Set the destination values to the captured value. This value is stored as an <em>identifiedSubIntents<\/em> array in the context object. Note that the latest identified sub-intent is always stored at the 0th index of the array.\n<ul>\n<li>In the\u00a0<strong>Set Context Variables<\/strong> option under\u00a0<strong>Fulfillment<\/strong> set the destination city using the following key-value pairing:<br \/>\n<table>\n<tbody>\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>context.entities.To<\/td>\n<td>context.identifiedSubIntents[0].entities.To<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ul>\n<\/li>\n<li>Optionally <strong>Present a Message<\/strong> to the user, say <em>&#8220;Changing destination to {{context.identifiedSubIntents[0].entities.To}}&#8221;<\/em><\/li>\n<li>Under <strong>Transition Flow<\/strong>, take the flow back to the <em>From<\/em> entity node using the\u00a0<strong>Jump To A Node<\/strong> option.<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110136\/ht_group_7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31536\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110136\/ht_group_7.png\" alt=\"\" width=\"459\" height=\"705\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110136\/ht_group_7.png 459w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110136\/ht_group_7-195x300.png 195w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\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><strong>Test the bot<\/strong><\/p>\n<ol>\n<li>Using the\u00a0<strong>Talk to Bot<\/strong> option test the bot<\/li>\n<li>Try the various amend scenarios and see the bot response<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218083959\/CNLU-amend-test.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26849\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218083959\/CNLU-amend-test.png\" alt=\"\" width=\"487\" height=\"1575\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218083959\/CNLU-amend-test.png 487w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218083959\/CNLU-amend-test-93x300.png 93w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218083959\/CNLU-amend-test-317x1024.png 317w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/a><\/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=\"Contextual_Digression\">Contextual Digression<\/span><\/h3>\n<p>Conversations never happen in a linear fashion. Users might digress from the main intent and then come back to it.<br \/>\nLet us look at the steps in achieving this using Group.<\/p>\n<p>While booking a flight, users might want to check the weather at the destination city before committing to the date of travel. They might ask <em>&#8220;What is the weather like at XYZ city tomorrow&#8221;<\/em> while the bot is waiting on the travel date input. In such a case, the user should be presented with the weather information before being re-prompted for the date.<br \/>\nSame as the above Amend Entity case, the steps would be to set the scope for the Weather Report dialog, train, and set the behavior.<\/p>\n<ol>\n<li>Since the scope for a query related to Weather Report would be anytime before the actual booking, we will go with the same Entity Group used for the Amend Entity use case.<\/li>\n<li>Add a Dialog Task node to run the Weather Report dialog from the current dialog.<br \/>\n<strong>Tip<\/strong>: Add Weather Report Dialog task to an existing node and then remove it from the connection, making it a floating node &#8211; not connected to any other node.<\/li>\n<li>This task needs\u00a0<em>location<\/em> as input and in our case, it can be set to the destination city entered by the user.<\/li>\n<li>The connection rule for this dialog should loop back to the From entity. This would ensure that the user resumes from where he left in the original conversation flow.<\/li>\n<li>From the Entity Group settings dialog\n<ol>\n<li><strong>Add New<\/strong> intent<\/li>\n<li>Select <em>Weather Report<\/em> from the <strong>Choose Intent<\/strong> drop-down<\/li>\n<li><strong>Training<\/strong> is populated from the Weather Report dialog training utterances, patterns, and rules. You can add to this list, but be aware that this would be common training data and would affect all the instances where Weather Report is used.<\/li>\n<li>Ensure that the\u00a0<strong>Transition Flow<\/strong> is set to\u00a0<em>Jump to a Node<\/em> and the Weather_Report node is selected<\/li>\n<\/ol>\n<\/li>\n<li>Using\u00a0<strong>Talk to Bot<\/strong> test the scenario<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218085631\/CNLU-dialog-test.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26855\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218085631\/CNLU-dialog-test.png\" alt=\"\" width=\"491\" height=\"1293\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218085631\/CNLU-dialog-test.png 491w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218085631\/CNLU-dialog-test-114x300.png 114w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218085631\/CNLU-dialog-test-389x1024.png 389w\" sizes=\"auto, (max-width: 491px) 100vw, 491px\" \/><\/a><\/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=\"Contextual_FAQ\">Contextual FAQ<\/span><\/h3>\n<p>Group nodes can also be used to answer contextual queries.<\/p>\n<p>A user might have a query regarding the check-in process after completing the booking.<br \/>\nLet us see how that can be achieved, the steps are the same as amending input values, contextual digression &#8211; scoping, training and behavior definition:<\/p>\n<ol>\n<li>Since the scope now would be after booking confirmation, we will group the nodes post-booking formalities\n<ul>\n<li><strong>Name<\/strong> the group, say\u00a0<em>Query Group<\/em><\/li>\n<li>Enter a\u00a0<strong>Description<\/strong><\/li>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110528\/ht_group_8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31538\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110528\/ht_group_8.png\" alt=\"\" width=\"787\" height=\"529\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110528\/ht_group_8.png 787w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210817110528\/ht_group_8-300x202.png 300w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><\/a><\/li>\n<li>From the Query Group settings dialog, <strong>Add New intent<\/strong>\n<ol>\n<li><strong>Create Intent<\/strong> for allowing a query from user\n<ol>\n<li>Enter a <strong>name<\/strong> for the intent, say <em>Checkin Query<\/em><\/li>\n<li>Enter a <strong>description<\/strong><\/li>\n<\/ol>\n<\/li>\n<li>Using the <strong>Machine Learning<\/strong> option under <strong>Training<\/strong>, let us train with user utterance that would identify this intent\n<ol>\n<li>Add an utterance, say \u201c<em>What time should I report at the airport?<\/em>\u201c<\/li>\n<li>Optionally add another utterance, say &#8220;<em>What is the check in time?<\/em>&#8220;<\/li>\n<li><strong>Train<\/strong> the sub-intent for this utterance<\/li>\n<\/ol>\n<p>&nbsp;<\/li>\n<li>Use the <strong>Present a Message<\/strong> entry to answer the user, say \u201c<em>Since you have opted for web-check-in, you need to report 30mins before flight take-off<\/em>\u201d<\/li>\n<li>Ensure that the <strong>Transition Flow<\/strong> is set to <em>Resume the Dialog<\/em><\/li>\n<\/ol>\n<p>&nbsp;<\/li>\n<li>Using\u00a0<strong>Talk to Bot<\/strong> option, test for the scenario.<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218094433\/CNLU-FAQ-test.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26863\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218094433\/CNLU-FAQ-test.png\" alt=\"\" width=\"499\" height=\"1013\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218094433\/CNLU-FAQ-test.png 499w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-1\/wp-content\/uploads\/sites\/22\/20210218094433\/CNLU-FAQ-test-148x300.png 148w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/a><\/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><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"Adding contextually relevant sub-intents is one of the important elements in building conversational bots. Contextually relevant intents could be required for various purposes like taking a different path in the dialog flow, amending previously provided entity values, etc. We have seen how to use the contextual data in combination with the interruption handling to achieve...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[],"class_list":["post-26919","post","type-post","status-publish","format-standard","hentry","category-how-tos"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/26919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/comments?post=26919"}],"version-history":[{"count":5,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/26919\/revisions"}],"predecessor-version":[{"id":31539,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/26919\/revisions\/31539"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/media?parent=26919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/categories?post=26919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/tags?post=26919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}