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. Natural Language
  5. NLP Settings and Guidelines

NLP Settings and Guidelines

Intent Naming Guidelines

Follow the below guidelines when naming your task (intent identifier):

  • Use an action verb, an object, and possibly a modifier (placed before or after the object). Typically, an intent name consists of 2 to 4 words.
  • Use less than 5 words to convey the purpose of the task.
  • Use the same verb in different tasks if the action is similar (For example, Show Issue/Show Report instead of Show Issue/Get Report).
  • Avoid single-word actions.
  • Avoid determiners (the, a, my, that, etc.)
  • Avoid digits but if you cannot, always use the numerical form.
  • Avoid Kore.ai platform terms such as task, alert, action, cancel, discard, amend, and webhook.
  • Avoid using a potential entity in an intent name (For example, Get Weather Today, where today is a potential entity).
  • Don’t use special characters such as () & / \ $ [ ] + *.
  • Don’t use punctuation such as – , . ! ? ‘ “.
  • Don’t use pronouns (i.e. Show Me All Issues)
  • Don’t use terms related to the bot name (For example, Create Asana Task).
  • Don’t use a word both as a verb and as a noun (For example, Update Issue/Get Updates).
  • For List of Items entity type, do not have the combination of following characters while defining synonyms – (), %, ° (degree symbol for degrees i.e. 30°C).

On-demand tasks (Actions, Dialog, Information tasks) must always contain an action verb, an object, and possibly a modifier (placed before or after the object). You must map almost all actions to the form how + what and complete the sentence the goal is to:

  • Do Something
  • Get Status
  • Send Detailed Report
  • Email Report Critical
  • Get 3 Day Forecast

Alerts must contain an object and possibly a modifier (placed before or after the object). Avoid using verbs in alert altogether. Avoid using the word alert in an alert name. Alerts must be mapped to the form what and complete the sentence alert me on:

  • Something
  • Status Updates
  • Critical Status Update
  • Changes

Patterns

While using synonyms is great for words used in the name, users may sometimes refer to a task using slang, metaphors, or other idiomatic expressions.

For example, a task name might be Get Current Weather, but the user inputs, What’s happening with today’s rain situation. In such cases, none of the words used in the task name are used, yet the input has the same meaning. To optimize the accuracy and recognition of the NLP interpreter for your bots, you can create patterns.

When the NLP interpreter matches a synonym to one task or field, and a pattern to a different task or field, the pattern match is prioritized and used for recognition over the synonym match.

Note: Patterns are evaluated in the order of their listing. So ensure when adding patterns, add in the order of most restrictive to least restrictive.
The following are some general guideline for creating intent patterns:
  • Use a minimum of 3 words.
  • Use words in their canonical forms (i.e. infinitive verbs, singular nouns).
  • Use lowercase both for words and their synonyms.
  • Use the US spelling of words (i.e. normalize instead of normalise).
  • Avoid using determiners and pronouns (the, a, my, that).
  • Avoid using digits.
  • Avoid using entity values in defining a task pattern.
  • Don’t use elision (i.e. what’s ).
  • Don’t use special characters such as () & / \ $ [ ] + *.
  • Don’t use punctuation such as – , . ! ? ‘ “.

For a quick guide towards the usage of patterns, refer to How to use Patterns.

Pattern Operators

  • AND: ( X Y ): An ordered relationship of words in sequence. This is the default setting. i.e. when you specify a pattern as cancel order it is the same as (cancel order).
    For example, (Cancel Order) matches Cancel my phone order but doesn’t match I have a pending order for an iPhone X, can I cancel. Bot Builder tool uses patterns with increasing numbers of wildcards between words (up to 3 for an intent). So a pattern of Cancel Order can match:
    • cancel order
    • cancel my order
    • cancel that last order
    • cancel last weeks big order
  • OR: [X Y Z]: Any of these can be interchangeably used in the user utterance. For example, ([get make] me [food drink dessert]) will match any of the below utterances:
    • Get me food
    • Make me a drink
    • Get me a drink
    • Get me a dessert
    • Make me some quick food
  • NOT: !X: Words that should not appear in the user utterance for an intent match. For example, (!forecast) is marked as a pattern for intent named Get current weather and the bot supports another intent called Get 3-day weather forecast.
    • User utterance: Planning a trip to California get me the forecast
      • will not match Get current weather
      • will match Get 3-day weather forecast
        Note that the !word means not after this point. So (!forecast the weather) and (get the weather !forecast) are different. The utterance get the forecast for the weather matches the second but not the first.
  • Optional: {X}: For example, {phone} If the user utterance is Get me a phone number or get me a number the platform will treat it equally.
  • Enforce Phrase: X_Y: To enforce occurrence of the phrase as is in the user utterance, without any words in between. For example, transfer_funds. The utterance transfer funds or I want to transfer funds will match but not Can I transfer some funds.
  • Concepts: ~: Platform has a large set of inbuilt concepts that developers can use to define a pattern. For example, (I [like love] ~world_country) will match
    • I like India
    • I love traveling to Australia
    • I would like to visit an African country
  • Unordered: <<, >>: Used to find words in any order. For example, <<Cancel Order>> matches Cancel my phone order and also I have a pending order for an iPhone X, can I cancel
  • Start/End of Statement: <, >: For example, ( transfer fund > ) will match I want to transfer funds but will not match transfer funds today.
  • Quote: ‘ –: If you quote words or use words that are not in canonical form, the system will restrict itself to what you used in the pattern. For example, (like to transfer funds) This matches I would like to transfer funds from my account but not I really liked transfer funds process.

Entity Patterns

As above, to detect entities, developers can use a combination of entity patterns and NER training. Entity patterns guide Kore as to where to look for a valid value for the entity. It is possible for an entity pattern to be found in several places in a sentence and Kore will extract the value from the first instance that has a valid value. Apart from the task pattern guidelines above, follow the below guideline for entity patterns:

  • Include the positional wildcard * that indicates the expected position of the entity ( i.e. (from * to), (in * >)); without it the pattern is invalid.
  • Use words that should be present in the pattern before and after the position of the entity. Words after the positional wildcard help to delimit the search range for a valid entity value.
  • Use start and end of sentence symbols (< and >) to separate the positional wildcard, but these are not strictly necessary because the Bot Builder tool does not cross a sentence boundary to extract an entity value (except for a Description).
  • Don’t use other positional wildcards in your field pattern. All field patterns are processed in the same way and all other positional wildcards except one are ignored.
  • Don’t use field names or their synonyms in patterns entity patterns. Only consider up to two wildcard words between the specified words.

Examples

Following are some examples of entity patterns to recognize from and to account number for the intent transfer funds.
Pattern operators defined above can be applied to entity patterns also.

  • Pattern: word1 *n – up to n words after the occurrence of word1
    pattern for entity ToAccount –  to *1
    ToAccount captured from user utterance transfer funds to ABC123 but not from transfer funds for ABC123.
  • Pattern: word1 * word2 or word1 word2 *n – multiple entities from a user utterance.
    patterns for entity ToAccount –  to * from, and from to *1.
    patterns for entity FromAccount –  from * to and to from *1.
    ToAccount & FromAccount captured from user utterance transfer funds from XYZ321 to ABC123 and transfer funds to ABC123 from XYZ321 but not from transfer funds for ABC123 using XYZ321.
    Note: when multiple patterns are entered for an entity, a match of either one will be taken.
  • Pattern: [ word1 word2 ] *n – match against any one word or phrase as defined within […].
    pattern for entity ToAccount –  to *1.
    pattern for entity FromAccount –  [ using from ] *1.
    ToAccount & FromAccount captured from user utterance transfer funds from XYZ321 to ABC123 and transfer funds to ABC123 using XYZ321 but not from transfer funds for ABC123 using XYZ321.
  • Pattern: ~concept *n – pattern built using concepts.
    pattern for entity ToAccount –  to *1.
    the pattern for entity FromAccount –  ~from *1 wherefrom is a concept as (using) (from)
    ToAccount & FromAccount captured from user utterance transfer funds from XYZ321 to ABC123 and transfer funds to ABC123 using XYZ321 but not from transfer funds for ABC123 using XYZ321.

For more information on how to add patterns, refer to Managing Patterns.

Negative Patterns

Negative patterns are used to eliminate intents detected by the Fundamental Meaning or Machine Learning models.

For example, a user says I was trying to Book a Flight when I faced an issue. Though the machine identifies the intent as Book a Flight, that is not what the user wants to do. In such a case, defining was trying to * as a negative pattern, would ensure that the matched intent is ignored.

Synonyms

Synonyms must be used when the words used to identify an intent/entity are used interchangeably. Synonyms are defined for both intents and entities.

Each intent has a name. For example, if your intent name is Guided Search. There are many synonyms that a user might enter to start this task, such as browse products, “Show me makeup, or show me products.

As a developer, you must limit the name of a task to only two or three words. And then consider synonyms for each of those words.

Example

  • Browse – Find, Search
  • Product – Makeup, Goods, Kit

Also consider misspellings, such as:

  • makeup – make up

Synonyms must be ideally defined only for words defined as part of the task name. The synonyms added at the bot level are applicable for all the tasks, i.e. when a developer adds a synonym for a word in Task A, those synonyms are also used for any other tasks with the same words in the task name. For example, synonyms defined for the word browse in the Guided Search are also used for the Keyword Search. Synonyms can (and should) be used to increase the number of variations that we expect from a user requesting an intent. They supplement existing intent name with alternative wording, while not being so generic as to match everything. Remember that synonyms are unidirectional so foo=bar does not mean bar=foo.

The general guideline for Synonyms:

  • Use words in their canonical forms (i.e. infinitive verbs, singular nouns).
  • Use lowercase both for words and their synonyms.
  • Keep synonym phrases to less than 5 words.
  • Use the US spelling of words (i .e. normalize instead of normalize).
  • Use intent over meaning (i .e. get is a good synonym for show if the context of the action means find and display).
  • Don’t add synonyms to determiners or pronouns (the, a, my, that, etc.).
  • Don’t use a synonym that could match in two conflicting tasks.
  • Don’t use special characters such as () & / \ $ [ ] + *.
  • Don’t use punctuation such as – , . ! ? ‘ “.
  • Don’t assign synonyms to multiple words (For example, this is wrong: wrong, bad).
  • Don’t add synonyms to digits.
  • Don’t use the phrasal form (i.e. don’t use lookup as a synonym; simply use look).
  • Don’t abbreviate to less than 2 letters.

Synonym Operations

A match between the user input and synonym for entity (only for List of Values and Lookup types) identification can occur in one of the following ways:

  • Partial Match – This is the default behavior whereby one or more words in the input must match one or more words for a given synonym. For example, the user utterance debit card will match the synonym credit card.
  • Exact Match – Here the input must contain all the words for a given synonym. For example, an add-on credit card will match a credit card. But debit cards will not match credit cards. To trigger an exact match, the synonym must be enclosed within double-quotes.
  • Full Match – The entire input must exactly match a given synonym word. For example, a credit card should match <credit card> but my credit card should NOT match <credit card>. Similarly, a credit card should not match <my credit card>. To trigger an exact match, the synonym must be enclosed within angular brackets.
  • Canonical Form Match – This is the default behavior wherein the user input is matched with the synonym or its canonical form. For example, check my balance will match with the synonym checking account since the check is the canonical form of checking. To disable this behavior, prefix the synonym with a single apostrophe as checking. (post v7.1)
Note: Synonyms can be added to identify intents as well as entities. Entity identification is triggered only after an Intent is identified.
For more information on how to add synonyms, refer to Managing Synonyms.

Concepts

Concepts are clusters of related and synonymous terms that you want to be considered as a group identified by a single term.

Allowed concept naming conventions:

  • Must have ~ as a prefix
  • Allowed characters in concept name are:
    • a to z and A-Z
    • 1 to 9
    • _ (underscore)
  • At least one alphabet must follow the ~.
  • Must not start or end with a _ (underscore).
  • These are case insensitive. i.e ~myConcept is the same as ~myconcept

Examples for allowed concept names:

  • ~my_concept
  • ~Sample
  • ~test123
  • ~my_new_concept

Examples of invalid concepts names:

  • ~_concept
  • ~concept_
  • ~a-concept
  • ~123test

You can also define custom concepts using emojis.

For more information, refer to Custom Concepts.

Standard Responses

Standard Responses are template messages that the platform uses to respond to specific situations during a conversation. Examples of these situations include resolution of ambiguous user inputs, requisition for authorization, obtaining confirmations, informing about interruptions and resumptions, and more. Standard Responses are categorized into the following:

  • Statements
  • Greetings
  • Queries
  • Errors & Warning
  • Questions and Choices

While the platform does come with canned responses, developers are encouraged to customize these messages as well as additional variations.

To provide a seamless end-user experience across the conversational journey, developers may have to review each of the Standard Responses to ensure that they fit the overall persona/theme of the bot.

Standard Responses can be plain text messages or can be generated through JavaScript to compose dynamic messages and templates for supported channels. Where applicable, Standard Responses support contextual tags that help the developer to customize the messages.

For example, when a user requests what a bot can do, the bot responds with a message Here are the tasks I can perform for you. <list-of-tasks>. In this example, the developer may choose to modify this message and reuse the tag <list-of-tasks>where appropriate. These tags are replaced with the actual text context during the conversation with run-time values.

Knowledge Graph

For executable tasks, the intent is identified based on either the task name (used in the Fundamental Meaning model) or machine learning utterances defined for a task. This approach is appropriate when a task can be distinctively identified from other tasks, using language semantics, and statistical probabilities derived from the machine learning model.

In the case of FAQs, this approach may not fare well as most of the FAQs are similar to each other in terms of semantic variation, and will require additional intelligence about the domain to find a more appropriate answer.

Kore.ai’s Knowledge Graph-based model provides that additional intelligence required to represent the importance of key domain terms and their relationships in identifying the user’s intent (in this case the most appropriate question).

We will use the following two examples to explain the different configurations required to build a Knowledge graph.

Example A Example B

Consider a bot trained with the following questions:

  • A1: How to apply for a loan?
  • A2: What is the process to apply for insurance?

Consider a bot trained with the following questions:

  • B1: Can I open a joint account?
  • B2: How do I add a joint account holder?
  • B3: How can I apply for a checkbook?
  • B4: How do I apply for a debit card?

The following are a few challenges with intent recognition using a typical model based on pure machine learning and semantic rules:

  1. Results obtained from machine learning-based models have a tendency to produce a false positive result if the user utterance has more matching terms with the irrelevant question.
  2. The model fails when the bot needs to comprehend based on domain terms and relationships. For example, the user utterance What is the process to apply for a loan? will incorrectly fetch A2 as a preferred match instead of A1. As A2 has more terms matching with user utterance than A1.
  3. This model fails to fetch the correct response if part of a question is stated in a connection with another question. Example, A: the user utterance I have applied for a loan, can I get insurance results in the ambiguity between A1 & A2. Example B: User utterance I have opened a joint account, can I have a debit card will incorrectly match B1 over B4.

In the Kore knowledge graph model, having all the questions at the root level is equivalent to using a model based on term frequency and semantic rules.

Key Domain Terms and their Relationship

Identifying key terms and their relationships is an important aspect of building ontology. Let us understand this using our sample Example A. Both A1 and A2 are about an application procedure, one talks about applying for a loan while the other talks about applying for insurance. So while creating an ontology, we can create a parent node apply with two child nodes as loan and insurance. Then A1 and A2 can be assigned as child nodes of loan and insurance node respectively.

Representation of Knowledge Graph
Example A


Similarly, in the case of Example B, the graph will be as below

Capabilities of a Graph Engine

  • Ease of Training using Synonyms: Kore.ai’s Knowledge Graph has a provision to associate synonyms against a graph node. This helps capture the variation in a question. For example, In Example A above, a user can put get as a synonym to apply.
  • Better Coverage with Alternate Questions: Knowledge Graph has a provision to add alternate questions. This helps us to capture the various ways a user might ask the same question. In Example B above, for the question How do I add a joint account holder we can add an alternate question as Can I add my wife as a joint account holder.
  • Improved Accuracy: Ontology-driven question-answers reduce the possibility of false positives. For example, for the user utterance What is the process to apply for SSN? a term frequency-based model will incorrectly suggest A2 as a match. An ontology-driven model has the capability to prevent such false positives.
  • Weighing Phrases using Classes: Kore.ai’s graph engine has introduced a concept of classes for filtering out irrelevant suggestions. See the below section on classes for a detailed explanation
  • Ability to Mark Term Importance: Kore.ai’s graph engine has a provision to mark an ontology term is important. For example, in the question, How to apply for a loan, loan is an important term. If a loan keyword is not present in the user utterance, then it makes little sense to fetch A1. Whereas in term frequency-based model a user utterance How to apply for a will incorrectly fetch A1.
  • Ability to Group Relevant Nodes: As the graph grows in size, managing graph nodes can become a challenging task. Using the organizer node construct of the ontology engine, the bot developer can group relevant nodes under a node.

Knowledge Graph Traits

Note: Traits replace Classes from v6.4 and before.

When using trait ensure you use it judicially as over usage may result in false negatives. When using classes ensure:

  • Good coverage of classes.
  • Classes should not get generalized improperly.
  • All the FAQs get tagged to mutually exclusive classes.

Following is the example of how classes work: Let’s say we create a class called Request and add request related phrases to it. If the user says I would like to get WebEx and I would like to get is trained for the Request class, this FAQ is only considered across the Knowledge Graph paths where the word request is tagged with. This is a positive scenario. But if the user says Can you help with getting WebEx?, and we did not have similar utterances trained for the Request class, it gets tagged with None class, and this FAQ is only used with the paths where the word request isn’t present. This results in a failure.

Another possibility is that if the user says I want to request help fixing WebEx and we have trained the Request class with some utterances having I want to request, and based on the training provided across all classes, the engine may generalize and tag this feature (phrase containingIwant to request ) to the Request class. In this case, if the Request class is not present in the help path for WebEx, this results in failure of identifying the input against help > WebEx.

The cases where classes are useful is when we have a mutually exclusive set of FAQs. For example, if we have a set of FAQs for Product issues and also a set of FAQs for the Process of buying a product.
FAQs for Process for buying a product:

  1. How do I buy Microsoft Office online?
  2. What is the process for buying anti-virus software?

FAQs for Product Issues:

  1. I am having issues installing software
  2. How to resolve an issue with antivirus

When a user says What is the process for fixing antivirus when it doesn’t work?, the engine may find that this input is similar to both A2 and B2, and may present both of them as suggestions. We know that Issue is mutually exclusive to buy, and it does not make sense present buy related FAQs at all, in this case. The opposite (matching Issue FAQs for buy related question) may be a much bigger problem. To solve this, we will create two classes, one for type issues and another for buy. Every input is classified into either buy or issue and only the relevant questions will be used in finding an appropriate answer.

Previous
Fundamental Meaning

 

 

Menu