OVERVIEW
Virtual Assistants
Kore.ai Platform
Key Concepts
Natural Language Processing (NLP)
Accessing Platform
VIRTUAL ASSISTANTS
Virtual Assistant Builder
Virtual Assistant Types
Getting Started
Create a Simple Bot
SKILLS
Storyboard
Dialog Tasks
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
Train
Build
Alert Tasks
Introduction
Ignore Words and Field Memory
How to Schedule a Smart Alert
Small Talk
Digital Views
Introduction
How to Configure 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
Record Conversations
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
Bot Versioning
Collaborative Development
Plan Management
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
Create a Simple Bot
Create a Banking Bot
Transfer Funds Task
Update Balance Task
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
RELEASE NOTES

インテントとエンティティについてのパターンの使用方法

パターンを使用することで、NLPインタープリターの正確性を向上させることができます。このドキュメントでは、さまざまなパターン構文についてと、それらをインテント検出およびエンティティ抽出で使用する方法について詳しく説明します。

注意事項:

  • パターンは、リストアップされている順に評価されます。一致するパターンが見つかると、残りのパターンは評価されません。したがって、パターンを追加する際、最も制限の多いものから最も制限の少ないものの順に追加するようにしてください。
  • ワイルドカード(*)は1つのパターンで1つだけ許可されます。
  • ほとんどの機能はすべての言語でサポートされていますが、いくつか例外があります。詳細はこちらをご覧ください

インテント検出のパターン

以下に、インテント検出のために設定できるパターン構文の一覧とその例を示します。

パターン 説明 パターン例
word1 word2 … wordn これにより、ユーザーの発話で同じ連続した順序で使用できるように定義されたすべての単語と、最大3つの(言語固有の)追加の単語を強制できます。これらの追加の単語は、パターン内で言及された任意の2つの連続する単語と、パターンで指定された単語のセットの前後の無数の単語の間で許可されています。
サンプルパターン "transfer fund"
発話の一致 – "can you please transfer funds from my account" – "can you please transfer some funds from my account" – "transfer funds"
発話の不一致 – "i want to transfer" – "can i transfer some significant amount of monetary funds" – "i want to do fund transfer"
word1_word2 フレーズを強制し、word1とword2の間に追加の単語を含めることはできません。これは、一連のトークンがフレーズとして読み取られるようにするためです。使用は単語に制限され、概念は使用できません。注意:「word1」、「word2」、「_」の間にスペースを入れないようにしてください。また、「_word1」は、ユーザーの発話の「word1」がプラットフォームによって使用済みとしてマークされていないことを確認するためのものであり、エンティティ抽出の対象とみなされることに注意してください。これは、エンティティのワードがインテントパターンで使用されている場合に役立ちます。
サンプルパターン "transfer_fund"
発話の一致 "can you help me transfer funds"
発話の不一致 "can you please transfer some funds from my account"
word1 * word2 指定された単語/フレーズ間に0から無限に追加される単語数
サンプルパターン "transfer * fund"
発話の一致 – "can you please transfer some funds from my account" – "can you help me transfer funds"
発話の不一致 "i want to transfer"
word1 *n word2 指定された単語/フレーズ間にn個から無限に追加される単語数
サンプルパターン "transfer *2 fund"
発話の一致 – "can you help me transfer some significant funds from my account"
発話の不一致 – "i want to transfer" – "can you please transfer some funds from my account" – "can you help me transfer some significant amount of funds"
word1 *0 word2 2つのトークン間のワイルドカードを無効にします。2つの単語間のアンダースコアに類似性がありますが、2つの概念間、または[ ]、{ }のグループ内で使用できます。(7.1以降で使用可能)
サンプルパターン "transfer *0 fund"
発話の一致 – "can you please transfer funds from my account" – "can you help me transfer funds"
発話の不一致 "i want to transfer some funds"
word1 < word2 word2の一致は文頭から開始する必要があることを示します。特にword2が発話の途中にあらわれる場合に便利です。角のあるかっこの後にスペースを追加します。
サンプルパターン "transfer < fund"
発話の一致 – "want to transfer funds" – "i want to initiate fund transfer"
発話の不一致 "i want to transfer"
word1 > word2 文末を示し、それ以降に単語を使用することはできません。角のあるかっこを閉じる前にスペースを追加します。
サンプルパターン "transfer * fund >"
発話の一致 – "transfer funds" – "transfer few funds"
発話の不一致 "transfer funds today"
!abc 単語/概念「abc」は、このトークンの後のユーザー発話のどこにも存在してはならないことを示します。「!」と単語/概念間にスペースを入れないようにしてください。
サンプルパターン – "!status transfer fund" – "transfer !status fund" – "transfer fund !status"
発話の一致 "i want to transfer funds"
発話の不一致 – "what is the status of my fund transfer" – "i want to find my fund transfer status"
!!abc 単語/概念のすぐ次に「abc」が来ることはできません。「!!」と単語/概念間にスペースを入れないようにしてください。
サンプルパターン "transfer fund !!status"
発話の一致 – "i want to transfer funds" – "what is the status of my fund transfer" – "i want to find my fund transfer from yesterday's status"
発話の不一致 "i want to find my fund transfer status"
[ … ] 単語/概念のグループを定義するために使用され、[ ]で宣言されたグループのうちの1つと正確に一致する必要があります。一致するものが見つかった場合、グループの残り部分は無視されることに注意してください。これを考慮して単語を並べ替えてください。注意:かっこは単語と隣接して使用しないでください。つまり、かっこと隣接する単語の間にはスペースを空けてください。
サンプルパターン "transfer [ funds amount cash ]"
発話の一致 – "transfer money" – "can i transfer some cash" – "i want to transfer funds"
発話の不一致 "transfer dollars"
{ … } オプションのグループまたは単語/概念を定義するために使用され、一致するものはゼロまたは{ }で宣言された単語/パターンのうちの1つです。一致するものが見つかった場合、グループの残り部分は無視されることに注意してください。これを考慮して単語を並べ替えてください。注意:かっこは単語と隣接して使用しないでください。つまり、かっこと隣接する単語の間にはスペースを空けてください。
サンプルパターン "transfer { some few my } fund"
発話の一致 – "how do i transfer funds" – "can i transfer some funds"
発話の不一致 "i want to transfer"
( … ) パターンを含みます。つまり、パターンまたはパターンの一部がこのかっこで囲まれている場合、[ ]や{ }とは異なり、パターンとして扱います。これはデフォルト設定となります。つまり、word1 word2のパターンがある場合、(word1 word2)として扱われます。[ ]または{ }内のサブパターンを定義するために明示的に使用されるのが一般的です。
サンプルパターン "( transfer fund )"
発話の一致 "transfer funds from my account"
発話の不一致 "i would like to initiate fund transfer"
<< … >> 任意のオーダーで単語を探し出すために使用されます。
サンプルパターン "<< transfer fund >>"
発話の一致 – "transfer funds from my account" – "i would like to initiate fund transfer"
発話の不一致 "i want to transfer"
'word1 単語を引用したり、正規の形式ではない単語を使用したりした場合、パターンで使用したものに制限されます。
サンプルパターン "'like to transfer fund"
発話の一致 "I would like to ransfer funds from my account"
発話の不一致 "I really liked transfer funds process"
word1~concept2 ~concept1~concept2 (バージョン8.0より) 単語(word1)または概念(concept1)は、それが別の概念(concept2)のメンバーでもある場合にのみ一致します。最も一般的な使用法は、POSタグごとに動的に追加されるシステムの概念を介しての使用です。
サンプルパターン "schedule~verb"
発話の一致 "schedule a meeting"
発話の不一致 "show my schedule"

ネガティブパターン

ネガティブパターンは、フレーズが存在する状況下で、検出インテントを削除するために使用されます。これは、一致したインテントに偽陽性がないかどうかをフィルタリングするのに役立ちます。ユーザーの発話:"I was transferring funds when I got network failure error" 検出されたインデントTransfer Funds 意図したインテントRegister Complaint インテントのネガティブパターンネットワーク障害)(エラー)(技術的な問題)を追加します。Transfer Funds ユーザーの発話: "I was transferring funds when I got network failure error" or "I was transferring funds when I faced a technical issue" or "I got an error during transfer funds process." 拒否されたインテントTransfer Funds トリガーしたインテント: Register Complaint

エンティティ抽出のパターン

パターンを使用して、ユーザーの発話におけるエンティティの位置と出現に基づいて、ユーザーの発話におけるエンティティの値を特定することができます。エンティティの抽出には、{…}[….]!~conceptsのようなインテントパターンの演算子を使用できます。以下に、これらのパターンがどのように適用されるかについていくつかのユースケースを示します。すべてのエンティティパターンには、プラットフォームがエンティティ値を探す場所を表す「*」を何らかの形式で含める必要があります。バンキングBotの例に続き、資金の移動インテントを使用します。このインテントには、ToAccountおよびFromAccountの2つのエンティティが必要です。これを実現する方法を見ていきましょう。

パターン1:word1 * word2

これは、エンティティの予想される位置を示す位置ワイルドカードとして使用することができます。ToAccountエンティティのパターンto * from ユーザーの発話: Transfer funds to ABC123 from my account. 抽出したエンティティToAccount = ABC123 エンティティの抽出に結びつかないユーザーの発話: "transfer funds for ABC123 from my account"

パターン2:word1 * n

これは、指定されたword1の後に、単語数に基づいたエンティティの予想される位置を示す位置ワイルドカード*として使用することができます。つまり、word1の後にn個の単語が存在する場合はエンティティとして考慮され、n個の単語が存在しない場合は、次に出現するword1を探します。ToAccountエンティティのパターンfrom *2 ユーザーの発話Transfer funds to ABC123 from my account.抽出したエンティティFromAccount = my account ユーザーの発話: Transfer funds to ABC123 from XYZ321 that is from my account. 抽出したエンティティ:FromAccount = my account エンティティの抽出に結びつかないユーザーの発話: "transfer funds to  ABC123 using my account"

パターン2の拡張:word1 *~n

上記(パターン2)と類似性がありますが、最大n個の単語が使用可能な場合、n個まで抽出します。エンティティは抽出するものが必要であるため、*~1は実際には*1と同じであることに注意してください。

パターン3:word1 * word2、word3 *nの組み合わせ

これは、ユーザーの発話内でエンティティの値が見つかる可能性がある場所と、エンティティに寄与する単語数のパターンの組み合わせとして使用することができます。ToAccountエンティティのパターン: "to * from" and "from to *1" Pattern for FromAccount entity: "from * to" and "to from *2"ユーザーの発話Transfer funds to ABC123 from my account. or Transfer funds from my account to ABC123.抽出したエンティティToAccount = ABC123 and FromAccount = my account エンティティの抽出に結びつかないユーザーの発話: "transfer funds for ABC123 using my account"

パターン4: [ word1 word2 ] *

これは、単語または概念のグループを使用するパターンの場合で、少なくとも1つが発話内に含まれている必要があります。グループ内のオーダーが重要となります(詳細については上記のインテントの検出を参照してください)。ToAccountエンティティのパターン"to * [ using from ]" and "[ using from ] to *1" FromAccountエンティティのパターン:"[ using from ] * to" and "to [ using from ] *"ユーザーの発話Transfer funds to ABC123 from my account. or Transfer funds using my account to ABC123.抽出したエンティティToAccount = ABC123 and FromAccount = my account エンティティの抽出に結びつかないユーザーの発話:"transfer funds for ABC123 using my account"

パターン5: ~CustomConcept *

これは概念を使用するためのものです。独自のカスタムコンセプトを作成し、それを使用してパターンを定義できます。ToAccountエンティティのパターン"to * from" and "from to *" Pattern for FromAccount エンティティのパターン:"~in * to" and "to ~in *" カスタムコンセプト:~in(using) (from) ユーザーの発話Transfer funds to ABC123 using my account. or Transfer funds from my account to ABC123.抽出したエンティティToAccount = ABC123 and FromAccount = my account エンティティの抽出に結びつかないユーザーの発話: "transfer funds to ABC123 of my account"

パターン6: ~intent

エンティティパターンやカスタムエンティティで有用です。インテント特定で使用される単語は、~intent概念で動的にマークされます。これは、一部のエンティティパターンのアンカーや参照ポイントとして使用できます。サンプルパターン"~intent~meeting~plural" エンティティの抽出に結びつかないユーザーの発話show my meetings. エンティティをマークする可能性があるユーザーの発話: "schedule a presentation called Meeting the Sales Goals"

パターン7: $currentEntity

エンティティが実際に処理されるまでパターンの評価を遅らせるのに役立ちます。通常、エンティティパターンはダイアログの開始時や新規入力時に評価され、そのエンティティが処理されるまで単語を保護する必要があるかどうかを確認します。これは、特に文字列の場合には必ずしも望ましいとは限りません。パターン"$currentEntity=TaskTitle 'called *" 上記のルールにより、ダイアログフローがTaskTitleノードに到達したときにパターンが評価されます。

OVERVIEW
Virtual Assistants
Kore.ai Platform
Key Concepts
Natural Language Processing (NLP)
Accessing Platform
VIRTUAL ASSISTANTS
Virtual Assistant Builder
Virtual Assistant Types
Getting Started
Create a Simple Bot
SKILLS
Storyboard
Dialog Tasks
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
Train
Build
Alert Tasks
Introduction
Ignore Words and Field Memory
How to Schedule a Smart Alert
Small Talk
Digital Views
Introduction
How to Configure 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
Record Conversations
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
Bot Versioning
Collaborative Development
Plan Management
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
Create a Simple Bot
Create a Banking Bot
Transfer Funds Task
Update Balance Task
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
RELEASE NOTES

How to use Patterns for Intents & Entities

Using patterns can help to improve NLP interpreter accuracy.

In this document, we will elaborate on the various pattern syntax and how they can be used in intent detection and entity extraction.

Things to Remember:

  • Patterns are to be used as a last resort, only for cases where ML engine cannot be used. Examples of such cases would be to train bot in recognising idiomatic utterances, command like utterances.
  • Patterns are evaluated in the order of their listing. Once a match is found the rest of the patterns are not evaluated. So ensure when adding patterns to add in the order of most restrictive to least restrictive.
  • Only one wildcard (*) is allowed in a pattern.
  • While most of the features are supported in all languages, there are some exceptions, see here for more details.
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 – , . ! ? ‘ “.

Patterns for Intent Detection

Following is a list of pattern syntax, along with examples, that can be configured for intent detection.

Pattern Description Pattern Examples
word1 word2 … wordn This mandates all the words defined to be available in the user utterance in the same consecutive order with upto 3 (language specific) additional words allowed between any two consecutive words mentioned in the pattern and infinite number of words before and after those specified set of words.
Sample Pattern transfer fund
Utterance Match – “can you please transfer funds from my account
– “can you please transfer some funds from my account
– “transfer funds
Utterance not Matching – “i want to transfer
– “can i transfer some significant amount of monetary funds
– “i want to do fund transfer
word1_word2 Enforce phrase, no additional words allowed in between word1 and word2. This is to ensure a sequence of tokens are read as a phrase. Usage restricted to words, concepts not allowed.
Note: There should be no space between the word1, word2 and _. Also be aware that “_word1” is to ensure that the word1 in the user utterance is not marked as Used Up by the platform and is to be considered for entity extraction. This is useful when entity words are used in the intent pattern.
Sample Pattern transfer_fund
Utterance Match can you help me transfer funds
Utterance not Matching can you please transfer some funds from my account
word1 * word2 0 to infinite number of additional words between the specified words/phrases
Sample Pattern transfer * fund
Utterance Match – “can you please transfer some funds from my account
– “can you help me transfer funds
Utterance not Matching i want to transfer
word1 *n word2 Exactly n number of additional words between the specified words/phrases
Sample Pattern transfer *2 fund
Utterance Match – “can you help me transfer some significant funds from my account
Utterance not Matching – “i want to transfer
– “can you please transfer some funds from my account
– “can you help me transfer some significant amount of funds
word1 *0 word2 To disable wildcards between two tokens. Similar to the underscore between two words but can be used between two concepts or within [  ], {  } groups.
(available 7.1 onwards)
Sample Pattern transfer *0 fund
Utterance Match – “can you please transfer funds from my account
– “can you help me transfer funds
Utterance not Matching i want to transfer some funds
word1 < word2 Indicates the match for word2 should start from the beginning of a sentence. It is useful especially when the word2 appears in the middle of the utterance.
Add a space after the angular bracket
Sample Pattern transfer < fund
Utterance Match – “want to transfer funds
– “i want to initiate fund transfer
Utterance not Matching i want to transfer
word1 > word2 Indicates the end of the sentence and no words are allowed after it.
Add a space before closing the angular bracket
Sample Pattern transfer * fund >
Utterance Match – “transfer funds
– “transfer few funds
Utterance not Matching transfer funds today
!abc Indicates the word/concept “abc” should not exist anywhere in the user utterance after this token
No space between ! and word/concept
Sample Pattern – “!status transfer fund
– “transfer !status fund
– “transfer fund !status
Utterance Match i want to transfer funds
Utterance not Matching – “what is the status of my fund transfer
– “i want to find my fund transfer status
!!abc The very next word/concept should not be “abc”
No space between !! and word/concept
Sample Pattern transfer fund !!status
Utterance Match – “i want to transfer funds
– “what is the status of my fund transfer
– “i want to find my fund transfer from yesterday’s status
Utterance not Matching i want to find my fund transfer status
[ … ] Used to define a group of words/concepts and the match should be against exactly one of the group declared in [ ]. Be aware that when a match is found the rest of the group is ignored, so order the words accordingly.
Note: the parentheses should not be clubbed with the word, i.e maintain a space between the parenthesis and the adjacent word.
Due to the difficulty in maintaining and tracking, it is recommended you use concept instead of this pattern. This pattern also has detrimental effect on the bot performance.
Sample Pattern transfer [ funds amount cash ]
Utterance Match – “transfer money
– “can i transfer some cash
– “i want to transfer funds
Utterance not Matching transfer dollars
{ … } Used to define a optional group or words/concepts and the match would be against zero or one of the words/patterns declared in { }. Be aware that when a match is found rest of the group is ignored, so order the words accordingly.
Note: the parentheses should not be clubbed with the word, i.e maintain a space between the parenthesis and the adjacent word.
Sample Pattern transfer { some few my } fund
Utterance Match – “how do i transfer funds
– “can i transfer some funds
Utterance not Matching i want to transfer
( … ) contain a pattern i.e when a pattern or part of a pattern is enclosed in these parentheses, we treat it as a pattern unlike [ ] and { }.
This is the default setting i.e. when a pattern word1 word2 it is treated as ( word1 word2 )
Commonly used explicitly to define sub pattern inside [ ] or { }
Sample Pattern ( transfer fund )
Utterance Match transfer funds from my account
Utterance not Matching i would like to initiate fund transfer
<< … >> Used to find words in any order
Due to the risk of running into false positives, you are advised not to use this pattern.
Sample Pattern << transfer fund >>
Utterance Match – “transfer funds from my account
– “i would like to initiate fund transfer
Utterance not Matching i want to transfer
‘word1 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
Sample Pattern ‘like to transfer fund
Utterance Match I would like to ransfer funds from my account
Utterance not Matching I really liked transfer funds process
word1~concept2
~concept1~concept2
(from ver8.0)
A word (word1) or concept (concept1) can be matched only if it is also a member of another concept (concept2). The most common usage of this is through the system concepts that are dynamically added for each POS tag.
Sample Pattern schedule~verb
Utterance Match schedule a meeting
Utterance not Matching show my schedule

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.

Negative Patterns

Negative Patterns can be used to eliminate intents detected in the presence of a phrase. This will help filter the matched intents for false positives.

User Utterance: “I was transferring funds when I got network failure error”
Intent DetectedTransfer Funds
Intended IntentRegister Complaint

Add a Negative Pattern (network failure) (error) (technical issue) for the intent Transfer Funds
User Utterance: “I was transferring funds when I got network failure error”
or “I was transferring funds when I faced a technical issue”
or “I got an error during transfer funds process.”
Intent RejectedTransfer Funds
Intent Triggered: Register Complaint

Patterns for Entity Extraction

Patterns can be used to identify the values for entities in user utterance based upon their position and occurrence in user utterance.

Intent patterns operators like {…}, […], !, ~concepts can be used for entity extraction. The following are some use cases how the patterns can be applied.

Every entity pattern has to include a * (of some form) to represent where the platform should look for an entity value.

Continuing with the Banking Bot example with Transfer Funds intent. This intent needs two entities – ToAccount and FromAccount. We will see how to achieve this.

Pattern 1: word1 * word2

This can be used as a positional wildcard that indicates the expected position of the entity.
Pattern for ToAccount entityto * from
User UtteranceTransfer funds to ABC123 from my account.
Entity ExtractedToAccount = ABC123
User Utterance not resulting in entity extraction: “transfer funds for ABC123 from my account”

Pattern 2: word1 *n

This can be used as a positional wildcard * that indicates the expected position of the entity based upon the number of words after the specified word1. That is, n words after the word1 are to be considered for the entity, if n words are not present then look for the next occurence of word1.
Pattern for ToAccount entity: from *2
User UtteranceTransfer funds to ABC123 from my account.
Entity Extracted: FromAccount = my account
User Utterance: Transfer funds to ABC123 from XYZ321 that is from my account.
Entity Extracted
: FromAccount = my account
User Utterance not resulting in entity extraction
: “transfer funds to  ABC123 using my account”

Extension to Pattern 2: word1 *~n

Similar to above (pattern 2) but extracts up to n number, if that number of words are available. Note that entities need to extract something so *~1 is really the same as *1.

Pattern 3: a combination of word1 * word2 and word3 *n

This can be used as a combination of patterns for the likely location in the user utterance that the entity value could be found and the number of words contributing to the entity.
Pattern for ToAccount entity“to * from” and “from to *1”
Pattern for FromAccount entity: “from * to” and “to from *2”
User UtteranceTransfer funds to ABC123 from my account.
                       or Transfer funds from my account to ABC123.
Entity ExtractedToAccount = ABC123 and FromAccount = my account
User Utterance not resulting in entity extraction: “transfer funds for ABC123 using my account”

Pattern 4: [ word1 word2 ] *

This can be for patterns using a group of words or concepts of which at least one should be present in the utterance. The order within the group is important (see above in intent detection for details).
Pattern for ToAccount entity“to * [ using from ]” and “[ using from ] to *1”
Pattern for FromAccount entity: “[ using from ] * to” and “to [ using from ] *”
User UtteranceTransfer funds to ABC123 from my account.
                       or Transfer funds using my account to ABC123.
Entity ExtractedToAccount = ABC123 and FromAccount = my account
User Utterance not resulting in entity extraction: “transfer funds for ABC123 using my account”

Pattern 5: ~CustomConcept *

This can be for using concepts. You can create your own custom concepts and use them to define patterns.
Pattern for ToAccount entity“to * from” and “from to *”
Pattern for FromAccount entity: “~in * to” and “to ~in *”
Custom Concept: ~in(using) (from)
User UtteranceTransfer funds to ABC123 using my account.
                       or Transfer funds from my account to ABC123.
Entity ExtractedToAccount = ABC123 and FromAccount = my account
User Utterance not resulting in entity extraction: “transfer funds to ABC123 of my account

Pattern 6: ~intent

Useful in entity patterns and custom entities
Words that are used in the intent identification are dynamically marked with the ~intent concept. This can then be used as an anchor or reference point for some entity patterns.
Sample Pattern“~intent~meeting~plural
User Utterance not resulting in entity extraction: show my meetings.
User Utterance might mark the entity: “schedule a presentation called Meeting the Sales Goals

Pattern 7: $currentEntity

Useful in delaying the evaluation of a pattern until the entity is actually processed. Normally entity patterns are evaluated when a dialog starts and on new input to see if any words need to be protected until that entity is processed. This might not always desirable, especially for strings.
Pattern“$currentEntity=TaskTitle ‘called *
The above rule will result in evaluating the pattern when the dialog flow has reached the TaskTitle node.