OVERVIEW
Virtual Assistants
Kore.ai Platform
Key Concepts
Natural Language Processing (NLP)
Accessing Platform
VIRTUAL ASSISTANTS
Virtual Assistant Builder
Virtual Assistant Types
Getting Started
Creating a Simple Bot
SKILLS
Storyboard
Dialog Task
Introduction
Dialog Builder (New)
Dialog Builder (Legacy)
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
Bot Action Node
Service Node
Custom Authentication
2-way SSL for Service nodes
Script Node
Agent Transfer Node
WebHook Node
Grouping Nodes
Connections & Transitions
Manage Dialogs
User Prompts
Knowledge Graph
Terminology
Building
Generation
Importing and Exporting
Analysis
Knowledge Extraction
Build
Alert Tasks
Introduction
Ignore Words and Field Memory
How to Schedule a Smart Alert
Small Talk
Digital Views
Overview
Configuring Digital Views
Digital Forms
Overview
How to Configure Digital Forms
NATURAL LANGUAGE
Overview
Machine Learning
Introduction
Model Validation
Fundamental Meaning
Introduction
NLP Guidelines
Knowledge Graph
Traits
Introduction
How to Use Traits
Ranking and Resolver
Advanced NLP Configurations
INTELLIGENCE
Overview
Context Management
Overview
Session and Context Variables
Context Object
How to Manage Context Switching
Manage Interruptions
Dialog Management
Sub-Intents & Follow-up Intents
Amend Entity
Multi-Intent Detection
Sentiment Management
Tone Analysis
Sentiment Management
Event Based Bot Actions
Default Conversations
Default Standard Responses
TEST & DEBUG
Talk to Bot
Utterance Testing
Batch Testing
Conversation Testing
CHANNELS
PUBLISH
ANALYZE
Overview
Dashboard
Custom Dashboard
Overview
How to Create Custom Dashboard
Conversation Flows
NLP Metrics
ADVANCED TOPICS
Universal Bots
Overview
Defining
Creating
Training
Customizing
Enabling Languages
Store
Smart Bots
Defining
koreUtil Libraries
SETTINGS
Authorization
Language Management
PII Settings
Variables
Functions
IVR Integration
General Settings
Management
Import & Export
Delete
Versioning
Collaborative Development
PLAN & USAGE
Overview
Usage Plans
Support Plans
Invoices
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
ADMINISTRATION
HOW TOs
Creating a Simple Bot
Creating a Banking Bot
Context Switching
Using Traits
Schedule a Smart Alert
Configure UI 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
Update Balance Task
Transfer Funds Task
RELEASE NOTES
  1. Docs
  2. Virtual Assistants
  3. How Tos
  4. How to build Knowledge Graph

How to build Knowledge Graph

This article 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 without an ontology.

To add a static FAQ, follow the below steps:

  1. Open the bot.
  2. Select the Build tab from the top menu
  3. On the left pane, click Conversational Skills > Knowledge Graph.
  4. Click Create to create a Knowledge Graph.
  5. A Knowledge Graph with the name set to the Bot Name is created.
  6. Click Add Intent to start entering your FAQs.
  7. Select Intent type as FAQ
  8. Add Question and Bot Response; then click Save.
  9. Click Add Intent on the top-right to add more Q&As.
  10. After you enter all the Q&As, click Train to train the Knowledge Graph.
  11. Click Talk to Bot at the bottom-right 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 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 can 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 can pick the debit card tag as suggested by the platform and Save the changes.
  5. Similarly, add a 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

For a better bot response, you must add tags for every question. 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 are 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.

To create an ontology, follow the below steps:

  1. Hover over the Knowledge Graph name on the left pane 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 is added as a tag.
  8. This ensures that this question is 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 qualifying 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 helpline number?
  • Complaints
    • Where can I register my query/complaints?
  • Issues
    • How do I report a stolen card?

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

To address this case, we mark the term Joint Account as Mandatory. This helps improve the bot’s performance.

Steps:

  1. Hover over the node, in this case, Joint Account, and click on the settings icon.
  2. From the Settings section, select the Mandatory option from the dropdown next to the term name.
  3. Save and Train the Knowledge Collection.
  4. Now the questions under this node are 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 helpline 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 the Organizer option.
  5. Save and Train the Knowledge Collection.
  6. Now the questions under this node are 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 a suggestive match not definitive. The reason being the bot does not understand get as being the same as apply.

Solution: Synonyms

To add synonyms, follow the below steps:

  1. Hover over the Apply node and click the 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 do 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.

To add alternate questions, follow the below steps:

  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 that 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.

To trigger a task, follow the below steps:

  1. Before proceeding, ensure that you have a task defined for Check Balance. Let us consider a dummy dialog that displays a message.
  2. Add the Add Intent How do I check my account balance?
  3. Set Intent to Task.
  4. From the drop-down list select the Dialog Task name 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 a 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

To add tags, follow the below steps:

  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 the tag internet-banking.
    2. Click the tag to open the Tag Settings dialog and set Tag Usage to Mandatory.
    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. Save and 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 must direct the user to report a stolen card.

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

To add traits, follow the below steps:

  1. First, 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 the Manage Traits option.
    2. Click New Trait to create a New Trait.
    3. Give a Trait Type and add Traits to it. Here, let us consider Issues as Trait Type and lostcard as Trait.
    4. Add lost my card as the utterance that triggers 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.

메뉴
Kore.ai Named a Leader in 2022 Gartner® Magic Quadrant™ for Enterprise Conversational AI PlatformsGet the Report