{"id":23813,"date":"2020-07-03T16:50:15","date_gmt":"2020-07-03T15:50:15","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=23813"},"modified":"2023-02-10T11:12:33","modified_gmt":"2023-02-10T11:12:33","slug":"grouping-nodes","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/dialog-task\/grouping-nodes\/","title":{"rendered":"Sub-Intent Scoping Using Node Groups"},"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\"><div class=\"ult-spacer spacer-6ae8717671721\" data-id=\"6ae8717671721\" data-height=\"10\" data-height-mobile=\"10\" data-height-tab=\"10\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p><span style=\"font-weight: 400\">Node groups are primarily used for defining a group of nodes and representing them on the dialog canvas. Note that it is not a part of the dialog flow.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Node groups can be used to improve the user experience with follow-ups, digressions, and amending entity values. For a use case example, <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/how-tos\/intent-scoping-using-group-node\/\"><span style=\"font-weight: 400\">refer here<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<h1><span class=\"ez-toc-section\" id=\"Add_a_Node_Group\"><span style=\"font-weight: 400\">Add a Node Group<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">To add a node group to the dialog task, follow the below steps:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><strong>Open the Dialog Task<\/strong><span style=\"font-weight: 400\"> where you want to add the Group node.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Group the nodes<\/strong><span style=\"font-weight: 400\">. For steps in grouping nodes, <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/chatbot-overview\/using-the-dialog-builder-tool\/\"><span style=\"font-weight: 400\">refer here<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Once created, you cannot add or remove specific nodes from the group.<\/span><\/li>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Any node you add is added outside the group.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Any node you delete is deleted from the entire dialog.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Deleting a group will not delete the nodes within the group from the dialog.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">If you want to change the nodes contained within a group, you need to delete the respective group, then to recreate it.<\/span><\/li>\n<\/ol>\n<\/ol>\n<h1><span class=\"ez-toc-section\" id=\"Configure_a_Node_Group\"><span style=\"font-weight: 400\">Configure a Node Group<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">The Group Node functionality includes the following:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><strong>Scoping of Intents<\/strong><span style=\"font-weight: 400\"> \u2013 ability to define the sub-intents to be made available when the user is waiting at any of the nodes in the group;<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Sub-intent Training<\/strong><span style=\"font-weight: 400\"> \u2013 the ability to train the sub-intent;<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Sub-intent Properties<\/strong><span style=\"font-weight: 400\"> \u2013 ability to define the behavior of the sub-intent.<\/span><\/li>\n<\/ul>\n<h1><span class=\"ez-toc-section\" id=\"Sub-Intent_Scoping\"><span style=\"font-weight: 400\">Sub-Intent Scoping<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">Using Node Groups you can scope the sub-intents that are to be allowed to be identified from the user utterance and executed while the user is at one of the nodes within the group.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Hover over the group you want to scope the intents for and click the settings (gear) icon.<\/span><\/li>\n<p><span style=\"font-weight: 400\"><\/span><\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916120941\/node-group-settings.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916120941\/node-group-settings.png\" alt=\"\" width=\"715\" height=\"379\" class=\"aligncenter size-full wp-image-44808\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916120941\/node-group-settings.png 715w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916120941\/node-group-settings-300x159.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/a><\/p>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">From the Node Group window, select <\/span><strong>Add Intent<\/strong><span style=\"font-weight: 400\"> to add intents that should be part of this group\u2019s scope.<\/span><\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121031\/add-subintent.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121031\/add-subintent.png\" alt=\"\" width=\"260\" height=\"514\" class=\"aligncenter size-full wp-image-44811\"><\/a><\/p>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">From the <\/span><em><span style=\"font-weight: 400\">Add Intent<\/span><\/em><span style=\"font-weight: 400\"> window, select the intent to be scoped as a sub-intent for this Node Group. This would be the intent that a user might ask for when the conversation is at any of the nodes in this group. For example, asking \u201c<\/span><em><span style=\"font-weight: 400\">How is the weather at XYZ city<\/span><\/em><span style=\"font-weight: 400\">\u201d when prompted for the destination entity or asking for <\/span><em><span style=\"font-weight: 400\">\u201cFlight times\u201d<\/span><\/em><span style=\"font-weight: 400\"> when prompted for the travel date.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can choose to add new sub-intents using the <\/span><strong>Create Intent<\/strong><span style=\"font-weight: 400\"> button.<\/span><\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121142\/select-intent.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121142\/select-intent.png\" alt=\"\" width=\"464\" height=\"295\" class=\"aligncenter size-full wp-image-44814\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121142\/select-intent.png 464w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121142\/select-intent-300x191.png 300w\" sizes=\"auto, (max-width: 464px) 100vw, 464px\" \/><\/a><\/p>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Once added you can train, set behavioral properties and\/or delete a scoped intent.<\/span><\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121254\/manage-subintent.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121254\/manage-subintent.gif\" alt=\"\" width=\"258\" height=\"588\" class=\"aligncenter size-full wp-image-44817\"><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sub-Intent_Training\"><span style=\"font-weight: 400\">Sub-Intent Training<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">Once added, each of the sub-intent can be trained for recognition within this group. This would ensure that the sub-intent is identified in the group\u2019s context.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">From the <\/span><strong>Group settings<\/strong><span style=\"font-weight: 400\"> page, select the sub-intent you want to train.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can train the sub-intent with the following:<\/span><\/li>\n<ol>\n<li style=\"font-weight: 400\"><strong>Machine Learning<\/strong><span style=\"font-weight: 400\"> \u2013 Add the user utterances that should identify this sub-intent. You can also use the NER approach to annotate entities in the utterances.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Patterns<\/strong><span style=\"font-weight: 400\"> \u2013 Identify patterns in the user utterance related to this sub-intent.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Rules<\/strong><span style=\"font-weight: 400\"> \u2013 Define intent identification rules to trigger this intent.<\/span><\/li>\n<\/ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can also set the <\/span><strong>Intent Preconditions<\/strong><span style=\"font-weight: 400\"> i.e. the sub-intent would get identified only when any of the preconditions defined is available in the context at the time of intent detection. These pre-conditions will be considered as instance levels and would take precedence over the component level pre-conditions.<\/span><\/li>\n<\/ol>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121339\/subintent-training.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121339\/subintent-training.png\" alt=\"\" width=\"458\" height=\"481\" class=\"aligncenter size-full wp-image-44820\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121339\/subintent-training.png 458w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121339\/subintent-training-286x300.png 286w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sub-Intent_Properties\"><span style=\"font-weight: 400\">Sub-Intent Properties<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">The <\/span><strong>fulfillment<\/strong><span style=\"font-weight: 400\"> section can be used to define the actions when this particular sub-intent is identified from the user input. It includes the following properties:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><strong>Context Variables<\/strong><span style=\"font-weight: 400\"> \u2013 Set the key-value pairs to define the session or context variables to be updated when this sub-intent is identified. If you want to reset the values, you need to use the keyword \u201cnull\u201d, spaces would be ignored by the platform.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Present a Message<\/strong><span style=\"font-weight: 400\"> \u2013 Optionally, define a message to be presented to the user when this sub-intent is identified. As with other responses, you can define the message as plain text, JavaScript format, specify, and set <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/dialog-task\/voice-call-properties\/\"><span style=\"font-weight: 400\">Voice Call Properties<\/span><\/a><span style=\"font-weight: 400\">, where applicable.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Context Output<\/strong><span style=\"font-weight: 400\"> \u2013 Define the context tags to be set when this intent is identified. The intent name is always set as output context by the system. If you want to reset the values, you need to use the keyword \u201cnull\u201d, spaces would be ignored by the platform.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Transition Flow<\/strong><span style=\"font-weight: 400\"> \u2013 Use this option to define how the dialog should resume after executing this sub-intent. There are two behaviors you can define:<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400\"><strong>Jump To A Node<\/strong><span style=\"font-weight: 400\"> \u2013 The dialog will resume from the node selected here.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Resume The Dialog<\/strong><span style=\"font-weight: 400\"> \u2013 The dialog will resume from the node where this intent was identified.<\/span><\/li>\n<\/ul>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121509\/subintent-fulfilment.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220916121509\/subintent-fulfilment.png\" alt=\"\" width=\"258\" height=\"591\" class=\"aligncenter size-full wp-image-44823\"><\/a><\/p>\n<h1><span class=\"ez-toc-section\" id=\"Implementation\"><span style=\"font-weight: 400\">Implementation<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">Following are the changes in sub-intent behavior within a group:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">For every sub-intent identified, the context object will be updated with an array of objects with the identified sub-intent details with the latest at the top. The following information is captured:<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Name of the sub-intent;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Entities that are identified along with the sub-intent;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Name of the group to which the sub-intent belongs, where applicable;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Name of the node at which the sub-intent is identified.<\/span><\/li>\n<p><code>\"identifiedSub-Intents\": [<br \/>\n{<br \/>\n\"intent\": \"Change Destination\",<br \/>\n\"entities\": {<br \/>\n\"destcity\": \"Delhi\"<br \/>\n},<br \/>\n\"groupName\": \"Entity Group\",<br \/>\n\"identifiedAt\": \"to_date\"<br \/>\n},<br \/>\n{<br \/>\n\"intent\": \"Weather Report\",<br \/>\n\"groupName\": \"Entity Group\",<br \/>\n\"identifiedAt\": \"destcity\"<br \/>\n}<br \/>\n]<br \/>\n<\/code><\/p>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The intent would be executed if the sub-intent identified from the user utterance is within the group scope and all the input preconditions are satisfied and the transition flow directs to the concerned node.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The execution of sub-intents would involve:<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Updated context variables as per the defined mapping,<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Setting the Output Context as per the defined mapping,<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Presenting the message to the user, if applicable.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The current dialog execution should continue as per the transition flow defined.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Jump to the specified node; or<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Resume from the point where the sub-intent was identified.<\/span><\/li>\n<\/ul>\n<\/ul>\n<\/ul>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8717671eb7\" data-id=\"6ae8717671eb7\" data-height=\"12\" data-height-mobile=\"12\" data-height-tab=\"12\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"Node groups are primarily used for defining a group of nodes and representing them on the dialog canvas. Note that it is not a part of the dialog flow. Node groups can be used to improve the user experience with follow-ups, digressions, and amending entity values. For a use case example, refer here. Add a...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-23813","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/23813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=23813"}],"version-history":[{"count":20,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/23813\/revisions"}],"predecessor-version":[{"id":54061,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/23813\/revisions\/54061"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=23813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=23813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=23813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}