Chatbot Overview
Conversational Bots
Intents & Entities
Intelligent Bots
Kore.ai's Approach
Kore.ai Conversational Platform
Bot Concepts and Terminology
Natural Language Processing (NLP)
Bot Types
Bot Tasks
Starting with Kore.ai Platform
How to Access Bot Builder
Working with Kore.ai Bot Builder
Building your first Bot
Getting Started with Building Bots
Using the Dialog Builder Tool
Creating a Simple Bot
Release Notes
Latest Updates
Older Releases
Deprecations
Bot Builder
Creating a Bot
Design
Develop
Storyboard
Dialog Task
User Intent Node
Dialog Node
Entity Node
Supported Entity Types
Composite Entities
Supported Colors
Supported Company Names
Form Node
Logic Node
Message Nodes
Confirmation Nodes
Service Node
Custom Authentication
2-way SSL for Service nodes
Script Node
Agent Transfer Node
WebHook Node
Grouping Nodes
Connections & Transitions
Managing Dialogs
User Prompts
Alert Tasks
Alert Tasks
Ignore Words and Field Memory
Digital Forms
Digital Views
Knowledge Graph
Terminology
Building
Generation
Importing and Exporting
Analysis
Knowledge Extraction
Small Talk
Action & Information Task
Action Tasks
Information Tasks
Establishing Flows
Natural Language
Overview
Machine Learning
Model Validation
Fundamental Meaning
NLP Settings and Guidelines
Knowledge Graph Training
Traits
Ranking and Resolver
NLP Detection
Advanced NLP Configurations
Bot Intelligence
Overview
Context Management
Session and Context Variables
Context Object
Dialog Management
Sub-Intents & Follow-up Intents
Amend Entity
Multi-Intent Detection
Sentiment Management
Tone Analysis
Sentiment Management
Default Conversations
Default Standard Responses
Channel Enablement
Test & Debug
Talk to Bot
Utterance Testing
Batch Testing
Record Conversations
Publishing your Bot
Analyzing your Bot
Overview
Dashboard
Custom Dashboard
Conversation Flows
Bot Metrics
Advanced Topics
Bot Authorization
Language Management
Collaborative Development
IVR Integration
Data Table
Universal Bots
Defining
Creating
Training
Customizing
Enabling Languages
Smart Bots
Defining
Sample Bots
Github
Asana
Travel Planning
Flight Search
Event Based Bot Actions
koreUtil Libraries
Bot Settings
Bot Functions
General Settings
PII Settings
Customizing Error Messages
Manage Sessions
Bot Management
Bot Versioning
Using Bot Variables
API Guide
API Overview
API List
API Collection
SDKs
SDK Overview
SDK Security
SDK App Registration
Web SDK Tutorial
Message Formatting and Templates
Mobile SDK Push Notification
Widget SDK Tutorial
Widget SDK – Message Formatting and Templates
Web Socket Connect & RTM
Using the BotKit SDK
Installing
Configuring
Events
Functions
BotKit SDK Tutorial – Agent Transfer
BotKit SDK Tutorial – Flight Search Sample Bot
Using an External NLP Engine
Bot Administration
Bots Admin Console
Dashboard
User Management
Managing Users
Managing Groups
Managing Role
Bots Management
Enrollment
Inviting Users
Bulk Invites
Importing Users
Synchronizing Users from AD
Security & Compliance
Using Single Sign-On
Security Settings
Cloud Connector
Analytics
Billing
How Tos
Creating a Simple Bot
Creating a Banking Bot
Transfer Funds Task
Update Balance Task
Context Switching
Using Traits
Schedule a Smart Alert
Configure Digital Forms
Add Form Data into Data Tables
Configuring Digital Views
Add Data to Data Tables
Update Data in Data Tables
Custom Dashboard
Custom Tags to filter Bot Metrics
Patterns for Intents & Entities
Build Knowledge Graph
Using nlMeta
Global Variables
Content Variables
Using Bot Functions
Configure Agent Transfer
  1. Home
  2. Docs
  3. Bots
  4. How Tos
  5. Intent Scoping using Group Node

Intent Scoping using Group Node

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 a more natural and human-like interaction with the bot in How to Manage Context Switching. This 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.

With the objective of simplifying the contextual NLU, the Group node functionality has been enhanced with intent scoping, training, and fulfillment configuration, refer here for details.

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.

Problem Statement

During the course of booking a flight ticket:

  1. the user might change their mind regarding the destination, and/or the travel date;
  2. the user might want to check for weather information, that is not part of the book flight task, before confirming the booking;
  3. the user might have a follow-up question regarding their booking;
  4. the user may choose to cancel the task.

Prerequisites

In this how-to, we are using a Flight Details bot with the following dialog tasks

  1. Book Flight dialog which
    1. prompts the user for source, destination, date of travel, and web check-in options;
    2. display a booking confirmation message (for simplicity we have not added the service call to do the actual booking);
    3. check if the user needs any further assistance;
    4. end the conversation.

  2. Weather Report dialog which
    1. prompts the user for the location they want the weather report;
    2. display the weather report message (for simplicity we have not added the service call to do the actual weather lookup);

Implementation

Amend Entities

Let us look at the case where the user might want to change the destination and/or travel date.
Following are the steps to achieve the same:

Step 1: Group the nodes for sub-intent scoping:

The first step would be to define the scope for the sub-intent which would trigger changes to the destination and travel date.

  1. 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.
    Using the mouse, select the entities forming a Group Node.
  2. Name the Group, say Travel Details Group

Step 2a: Define sub-intents, train and set behavior properties for destination and travel date changes

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.

Let us first consider the case of enabling changes to destination and travel date:

  1. From the Entity Group window, click the Add Intent button
    1. Create Intent for allowing a change in travel date and destination
      • Enter a name for the intent, say Change Date and Destination
      • Enter a description
    2. Using the Machine Learning option under Training, let us train with user utterance that would identify this intent
      • Add an utterance, say “Let’s try a different date and destination
      • Optionally add another utterance, say “I have changed my mind, let’s start over again
      • Train the sub-intent for this utterance

    3. Reset the destination and travel date values:
      • In the Set Context Variables option under Fulfillment reset the destination city and the travel date using the following key-value pairing:
        Key Value
        context.entities.To null
        context.entities.When null
    4. Optionally Present a Message to the user regarding the changes, say “Alright, starting all over again”
    5. Under Transition Flow, take the flow back to the From entity node using the Jump To A Node option. Since the From entity value is not changed, the flow would go to the next entity To and When

Step 2b: Define sub-intents, train and set behavior properties for destination changes along with NER training

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.

  1. Click the Add Intent button to add a new sub-intent
    1. Create Intent for allowing a change in destination
      • Enter a name for the intent, say Change Destination
      • Enter a description
    2. Using the Machine Learning option under Training, let us train with user utterance that would identify this intent
      • Add an utterance, say “Instead let’s go to Chicago
      • Using the NER approach, annotate the To entity in the utterance.
      • Train the sub-intent for this utterance

    3. Set the destination values to the captured value. This value is stored as an identifiedSubIntents array in the context object. Note that the latest identified sub-intent is always stored at the 0th index of the array.
      • In the Set Context Variables option under Fulfillment set the destination city using the following key-value pairing:
        Key Value
        context.entities.To context.identifiedSubIntents[0].entities.To
    4. Optionally Present a Message to the user, say “Changing destination to {{context.identifiedSubIntents[0].entities.To}}”
    5. Under Transition Flow, take the flow back to the From entity node using the Jump To A Node option.

Test the bot

  1. Using the Talk to Bot option test the bot
  2. Try the various amend scenarios and see the bot response

Contextual Digression

Conversations never happen in a linear fashion. Users might digress from the main intent and then come back to it.
Let us look at the steps in achieving this using Group.

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 “What is the weather like at XYZ city tomorrow” 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.
Same as the above Amend Entity case, the steps would be to set the scope for the Weather Report dialog, train, and set the behavior.

  1. 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.
  2. Add a Dialog Task node to run the Weather Report dialog from the current dialog.
    Tip: Add Weather Report Dialog task to an existing node and then remove it from the connection, making it a floating node – not connected to any other node.
  3. This task needs location as input and in our case, it can be set to the destination city entered by the user.
  4. 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.
  5. From the Entity Group settings dialog
    1. Add New intent
    2. Select Weather Report from the Choose Intent drop-down
    3. Training 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.
    4. Ensure that the Transition Flow is set to Jump to a Node and the Weather_Report node is selected
  6. Using Talk to Bot test the scenario

Contextual FAQ

Group nodes can also be used to answer contextual queries.

A user might have a query regarding the check-in process after completing the booking.
Let us see how that can be achieved, the steps are the same as amending input values, contextual digression – scoping, training and behavior definition:

  1. Since the scope now would be after booking confirmation, we will group the nodes post-booking formalities
    • Name the group, say Query Group
    • Enter a Description

  2. From the Query Group settings dialog, Add New intent
    1. Create Intent for allowing a query from user
      1. Enter a name for the intent, say Checkin Query
      2. Enter a description
    2. Using the Machine Learning option under Training, let us train with user utterance that would identify this intent
      1. Add an utterance, say “What time should I report at the airport?
      2. Optionally add another utterance, say “What is the check in time?
      3. Train the sub-intent for this utterance

    3. Use the Present a Message entry to answer the user, say “Since you have opted for web-check-in, you need to report 30mins before flight take-off
    4. Ensure that the Transition Flow is set to Resume the Dialog

  3. Using Talk to Bot option, test for the scenario.
Menu