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 Time Zones
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
Prompt Editor
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
ML Model
Fundamental Meaning
NLP Settings and Guidelines
Knowledge Graph Training
Traits
Ranking and Resolver
NLP Detection
Bot Intelligence
Overview
Context Management
Session and Context Variables
Context Object
Dialog Management
Sub-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
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
Global Variables
Content Variables
Using Bot Functions
Configure Agent Transfer
  1. Home
  2. Docs
  3. Bots
  4. How Tos
  5. How to build Knowledge Graph

How to build Knowledge Graph

This How To helps to quickly build and understand the working of a Knowledge Graph for your bot. It shows how to convert an FAQ into ontology, add tags, use terms, add alternate questions, synonyms, tags, and traits.

For the implementation details, refer here.

Throughout this example we will be dealing with the following FAQs related to a banking bot:

  • How do I apply for a debit card?
  • How do I apply for a checkbook?
  • How do I open a Joint account?
  • Can I add a joint account holder?

Static FAQ

Let us start by creating a static FAQ one without an ontology.

Steps in adding a static FAQ:

  1. Open the Bot and go the Bot Tasks -> Knowledge Graph section.
  2. Click Create to create a Knowledge Graph.
  3. A Knowledge Graph with the name set to the Bot Name will be created.
  4. Use the Add Q&A button to start entering your FAQs
  5. Add Question and Bot Response and Save
  6. Use the Add Intent button to add more Q&As.
  7. Once you have entered all the Q&As, Train the Knowledge Graph.
  8. Use the Talk to Bot to check the Bot response for the added Q&As.

Tags

  • Issue: Try the utterance “how do i apply for a credit card?”
    We will get did you mean dialog with reference to a question pertaining to Debit Card, which is not appropriate in this scenario. Ideally, we should see an “I don’t know” response as you get for a totally unrelated query regarding weather.

Solution:

To overcome the above situation, we can add tags to each question. Tags will help filter the FAQs based upon the presence of some key phrases in the user utterance.

Steps in adding Tags:

  1. Hover over the Question to find the edit icon.
  2. Click the edit icon to add a tag to the question.
  3. In the add tag text box, you will find some suggestions by the platform based on the phrases present in the question. You can pick one from the list or type your own custom tag.
  4. For this use case, we will pick the “debit card” tag as suggested by the platform and Save the changes.
  5. Similarly, add “checkbook” for the “How to apply for checkbook” question.
  6. Train the bot.
  7. Talk to the Bot, use the same utterance “how do i apply for a credit card?”

Ontology

We can need to add tags for each and every question for a better Bot response. But this solution is not feasible in case we have a big list of FAQs. Also, more than one question can have a tag(s) in common.

Solution: Ontology. Based on crucial words and frequently occurring words/phrases, FAQs can be organized into groups and subgroups.

Example of Ontology: Continuing with the Banking bot FAQ example, we can organize the questions thus:

  • Apply
    • Debit Card
      • How do I apply for a debit card?
    • Checkbook
      • How do I apply for a credit card?
  • Joint account
    • How do I open a Joint account?
    • Can I add a joint account holder?

Each group can be a node in the ontology. You can have multiple levels of the nodes forming a hierarchical structure. Moving the relevant FAQs (intents) to the nodes will associate that FAQ with the corresponding node name set as a tag.

Steps in creating ontology

  1. Hover over the Knowledge Graph name on the left panel and click + icon to Add Child Node.
  2. Add the Nodes as “Apply” and “Joint Account”.
  3. To add subgroups, hover over the node and use the corresponding + icon to add child nodes.
  4. Select the questions pertaining to Joint Account and drag and drop them to the Joint Account node.
  5. Repeat the process for questions related to Apply, Debit Card and Checkbook nodes.
  6. You will notice the path gets updated accordingly.
  7. Edit a question and see that the node name has been added as a tag.
  8. This will ensure that this question will be qualified for a user utterance containing the term/node name. Note that the tags you added earlier are retained and you can delete them, whereas the node names cannot be deleted.
  9. Train the Knowledge Graph and Talk to Bot.
  10. There should not be any changes in the Bot responses.

Term Usage

By default, the node names or terms are used in evaluating the path and coming up with a set of qualified questions. You can tighten or relax this rule by either making the term mandatory in the utterance or marking the term/node as organizer respectively.

Before proceeding, let us add a few more nodes questions to our Knowledge Collection:

  • Account
    • How do I open an account?
    • How do I access my account?
    • How do I check my account balance?
    • How do I access my account online?
  • Contact
    • Who do I contact in case of an issue?
    • What is your help line number?
  • Complaints
    • Where can I register my query/complaints?
  • Issues
    • How do I report a stolen card?

Use Case 1: We want to ensure that the intents regarding “Joint Account” should be considered only when the user asked a direct question regarding the same. Any ambiguous cases should consider the Account node and not the Joint Account node.

To address this case, we would mark the term Joint Account as Mandatory. This would help improve the bot performance, too.

Steps:

  1. Hover over the node, in this case Joint Account, and click on the settings icon.
  2. From the Settings page, under Term Usage section select the Mandatory radio button.
  3. Save and Train the Knowledge Collection.
  4. Now the questions under this node will be considered only if the user utterance has the node name, Joint Account in this case.

Use Case 2: Consider the following FAQs.

  • Contact
    • Who do I contact in case of an issue?
    • What is your help line number?
  • Complaints
    • Where can I register my query/complaints?
  • Issues
    • How do I report a stolen card?

Though they do not have any phrases or terms in common, they are related to “Customer Care”. For ease of understanding, we can put them under a node by the same name and mark it as Organizer node, ensuring that the intents get qualified without the need to have the term phrase in the user utterance.

Steps:

  1. Create a node “Customer Care”
  2. Drag and drop the above three nodes to this new node.
  3. Hover over the node, in this case Customer Care, and click on the settings icon.
  4. From the Settings page, select Organizer radio button.
  5. Saveand Train the Knowledge Collection.
  6. Now the questions under this node will be considered even if the user utterance does not include the node name.

Synonyms

Use Case: Try “How do I get a debit card?” you will get suggestive match not definitive. The reason being the Bot does not understand “get” as being the same as “apply”.

Solution: Synonyms

Steps in adding synonyms:

  1. Hover over the “Apply” node and click settings icon.
  2. In the Path Level Synonyms, add “get”.
  3. Save and Train the Bot.
  4. Talk to Bot and use the same query “How to I get a debit card?
  5. Try “How do I get a checkbook” and you will see that the synonym works here also. This is because we added the synonym at path level and it is applicable to all nodes and questions under that path/node.
  6. Similarly, we can define Knowledge Graph Synonym if it is applicable to the entire knowledge graph.

Alternate Questions

Some questions have multiple ways the user can approach them.

  • Is there a way to see my account details from my laptop?
  • Is there a mobile app that I can use to access my account?
  • Does your bank support internet banking to view account details?

All these questions pertain to one intent – “How do I access my account online?”. But instead of adding all these Q&As as intents and repeat the response and the settings, if any, you can add these questions as alternate questions.

Steps in adding alternate questions:

  1. Hover over the question, in this case “How do I access my account online?”, and click the edit icon.
  2. In the Add alternate question enter the question.
  3. Add all the three queries mentioned above.
  4. Save, Train, and Talk to the Bot.
  5. Entering any of the above three questions will yield the same response as the question “How do I access my account online?”.

Tasks Execution

Consider the query “How do I check my account balance?”. If the Bot has a task which can give the balance, we can direct the user to the same, instead of asking the user to use the utterance to trigger the task.

Steps in triggering a task:

  1. Before proceeding, ensure that you have a Task defined for “Check Balance”. We have a dummy dialog which displays a message.
  2. Add the Add IntentHow do I check my account balance?
  3. Set Intent to “Task
  4. From the drop-down pick the Dialog Task name – here, Check Balance
  5. Save and Train the Knowledge Graph.
  6. Talk to bot with the utterance “How do I check my account balance?” will trigger the “Check Balance” task.

Tags in Ontology

Use Case: “Does your bank give passbook to view account details?” You will get Did you mean “How do I access my account online?”.

The reason being the alternate question for online account access – “Does your bank support internet banking to view account details?” is a very close match to the above query. You can avoid such situations by adding a tag “internet banking” and marking it as mandatory to the alternate question “Does your bank support internet banking to view account details?”

Solution: Custom Tags

Steps in adding tags:

  1. Edit the question “How do I access my account online?”
  2. For the alternate question “Does your bank support internet banking to view account details?”
    1. Add tag “internet-banking
    2. Click the tag to open Tag Settings dialog and set the Mandatory flag.
    3. Click Done
  3. Repeat for the alternate question “Is there a mobile app that I can use to access my account?” with the tag “mobile app”
  4. Saveand Train the bot
  5. Now Talk to the Bot and see the response.

Traits

Use Case: “I lost my card, how do I apply for another debit card?”
You will get the response with “How do I apply for a debit card?”.

While this is a valid response it is not the right one. Ideally, since the user said “I lost my card” bot should be directing the user to report a stolen card.

Solution: Traits. Traits can be used to get additional information from user utterance and direct the user to a better solution.

Steps in adding traits:

  1. First we will add this question as an alternate question to “How do I report a stolen card?”.
  2. Save and Train the bot.
  3. Talk to bot and ask the same question. You will get the same response.
  4. Now let us see how to add Trait.
  5. Define Trait:
    1. From the more option next to the Train button, select Manage Traits option.
    2. Use the New Trait button to Create a New Trait.
    3. Give a Trait Type and add Traits to it. Here we are using “Issues” as Trait Type and “lostcard” as Trait.
    4. Add “lost my card” as the utterance that will trigger this trait. (Do not forget to hit enter after you add the utterance).
    5. Save and Train the trait.
  6. Apply Trait
    1. From the ontology, go to the Issues node Settings page.
    2. Add “lostcard” as Trait (pick from the drop down list).
    3. Save and Train the Knowledge Graph.
    4. Talk to the Bot and try the same question. Now you will get the expected response.

In this document you have seen various settings for building and managing Knowledge Graph. For details regarding the implementation and working of Knowledge Graph, refer to this document.

Menu