{"id":48016,"date":"2022-10-04T17:08:20","date_gmt":"2022-10-04T16:08:20","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=48016"},"modified":"2022-10-05T14:37:13","modified_gmt":"2022-10-05T13:37:13","slug":"travel-va-using-patterns-for-intents-entities","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/how-tos\/travel-planing-assistant\/travel-va-using-patterns-for-intents-entities\/","title":{"rendered":"Travel VA: Using Patterns for Intents &amp; Entities"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Using patterns can help to improve NLP interpreter accuracy.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In this document, we will elaborate on the various pattern syntax and how they can be used in intent detection and entity extraction.<\/span><\/p>\n<table style=\"width: 100%;border-collapse: collapse;background-color: #fffbea\">\n<tbody>\n<tr>\n<td style=\"width: 100%\">\n<p><strong>Important Notes:<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Patterns are to be used as a last resort, only for cases where the ML engine cannot be used. Examples of such cases would be to train the VA in recognising idiomatic utterances, command like utterances.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">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.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Only one wildcard (*) is allowed in a pattern.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">While most of the features are supported in all languages, there are some exceptions, <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/how-tos\/multi-lingual-bot-behavior\/\"><span style=\"font-weight: 400\">see here for more details<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Pattern_Creation_Guidelines\"><span style=\"font-weight: 400\">Pattern Creation Guidelines<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">The following are some general guideline for creating intent patterns:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Use a minimum of 3 words.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Use words in their canonical forms (i.e. infinitive verbs, singular nouns).<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Use lowercase both for words and their synonyms.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Use the US spelling of words (i.e. <\/span><em><span style=\"font-weight: 400\">normalize<\/span><\/em><span style=\"font-weight: 400\"> instead of <\/span><em><span style=\"font-weight: 400\">normalize<\/span><\/em><span style=\"font-weight: 400\">).<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Avoid using determiners and pronouns (the, a, my, that).<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Avoid using digits.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Avoid using entity values in defining a task pattern.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Don\u2019t use elision (i.e. what\u2019s ).<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Don\u2019t use special characters such as () &amp; \/ \\ $ [ ] + *.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Don\u2019t use punctuation such as \u2013 , . ! ? \u2018 \u201c.<\/span><\/li>\n<\/ul>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Patterns_for_Intent_Detection\"><span style=\"font-weight: 400\">Patterns for Intent Detection<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">Following is a list of pattern syntax, along with examples, that can be configured for intent detection.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<th>\n<p><strong>PATTERN<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>DESCRIPTION<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>PATTERN EXAMPLES<\/strong><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p><strong>word1 word2 \u2026 wordn<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">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.<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Book flight<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">can you please book a flight for me?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">I want to book a flight<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">Book flight<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">i want to book<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">Can I make a flight booking?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>word1_word2<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">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.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Note<\/span><span style=\"font-weight: 400\">: There should be no space between the word1, word2 and _. Also be aware that \u201c_word1\u201d is to ensure that the word1 in the user utterance is <\/span><span style=\"font-weight: 400\">not marked<\/span><span style=\"font-weight: 400\"> as <\/span><span style=\"font-weight: 400\">Used Up<\/span><span style=\"font-weight: 400\"> by the Platform and is to be considered for entity extraction. This is useful when entity words are used in the intent pattern.<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">check_in<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Can you help me check in?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Can you please check me in for my flight? <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>word1 * word2<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">0 to infinite number of additional words between the specified words\/phrases<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Book * flight *<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">can you please book me a flight? <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">Can you help me book tomorrow\u2019s flight to London?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">i want to book<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>word1 *n word2<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">Exactly <\/span><em><span style=\"font-weight: 400\">n<\/span><\/em><span style=\"font-weight: 400\"> number of additional words between the specified words\/phrases<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Book *2 flight *2 fund<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201cCan you help me book an economy flight?\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">i want to book <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">Can you please book me a first class flight? <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>word1 *0 word2<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">To disable wildcards between two tokens. Similar to the underscore between two words but can be used between two concepts or within [\u00a0 ], {\u00a0 } groups.<\/span><\/p>\n<p><span style=\"font-weight: 400\">(available 7.1 onwards)<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Check *0 in <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">Can you please show me how to check in?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">Can you help me check in?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Can you check me in for my flight?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>word1 &lt; word2<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">Indicates that 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.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Add a space after the angular bracket<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Change &lt; seat t<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">want to change seat<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">I want a seat change.<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">i want another seat<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>word1 &gt; word2<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">Indicates the end of the sentence and no words are allowed after it.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Add a space before closing the angular bracket<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Book * flight &gt;\u00a0 <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">book flight<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">book a flight<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Book flight for tomorrow<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>!abc<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">Indicates the word\/concept \u201cabc\u201d should not exist anywhere in the user utterance after this token<\/span><\/p>\n<p><span style=\"font-weight: 400\">No space between ! and word\/concept<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">!status check in <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">check\u00a0 !status in<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">check in !status<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">i want to check in <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">what is the status of my check in<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">i want to find my check in status<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>!!abc<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">The very next word\/concept should not be \u201cabc\u201d<\/span><\/p>\n<p><span style=\"font-weight: 400\">No space between !! and word\/concept<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Flight booking !!status<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">i want to make a flight booking<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">What is the status of my flight booking?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 <\/span><em><span style=\"font-weight: 400\">I made a flight booking yesterday and I want to know the status.<\/span><\/em><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">I want to check my flight booking status.<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>[ \u2026 ]<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">Used to define a group of words\/concepts and the match should be against exactly one of the groups declared in [ ]. Be aware that when a match is found the rest of the group is ignored, so order the words accordingly.<\/span><\/p>\n<p><strong><em>Note<\/em><\/strong><em><span style=\"font-weight: 400\">: the parentheses should not be clubbed with the word, i.e maintain a space between the parenthesis and the adjacent word.<\/span><\/em><\/p>\n<p><em><span style=\"font-weight: 400\">Due to the difficulty in maintaining and tracking, it is recommended you use concept instead of this pattern. This pattern also has a detrimental effect on the VA\u2019s performance.<\/span><\/em><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Book [flight ticket seat]\u201d\u00a0\u00a0<\/span><\/em><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">book flight<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">Can I book a ticket? <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">I want to book a seat.<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Book a trip<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>{ \u2026 }<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">Used to define an 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, the rest of the group is ignored, so order the words accordingly.<\/span><\/p>\n<p><strong><em>Note<\/em><\/strong><em><span style=\"font-weight: 400\">: the parentheses should not be clubbed with the word, i.e maintain a space between the parenthesis and the adjacent word.<\/span><\/em><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Check { the a my } flight status<\/span><\/em><span style=\"font-weight: 400\">.\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">How do I check the flight status?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">I need to check a flight status<\/span><\/em><span style=\"font-weight: 400\">.\u201d<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">Can I check my flight status? <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">I want my flight status. <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>( \u2026 )<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">Contain a pattern &#8211; i.e when a pattern or part of a pattern is enclosed in these parentheses, we treat it as a pattern unlike [ ] and { }.<\/span><\/p>\n<p><span style=\"font-weight: 400\">This is the default setting i.e. when a pattern <\/span><em><span style=\"font-weight: 400\">word1 word2<\/span><\/em><span style=\"font-weight: 400\"> it is treated as <\/span><em><span style=\"font-weight: 400\">( word1 word2 )<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">Commonly used explicitly to define sub pattern inside [ ] or { }<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">( check in )<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Check in for my flight. <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Can you check me in for my flight? <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>&lt;&lt; \u2026 &gt;&gt;<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">Used to find words in any order<\/span><\/p>\n<p><span style=\"font-weight: 400\">Due to the risk of running into false positives, you are advised <\/span><span style=\"font-weight: 400\">not<\/span><span style=\"font-weight: 400\"> to use this pattern.<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">&lt;&lt; change seat\u00a0 &gt;&gt;<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">change seat for my flight <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u2013 \u201c<\/span><em><span style=\"font-weight: 400\">I would like to make a seat change. <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">i want another seat<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u2018word1<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">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<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Like to book a flight.<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">I would like to book a flight. <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">I really liked how easy it was to book a flight in your app. <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>word1~concept2<\/strong><\/p>\n<p><strong>~concept1~concept2<\/strong><\/p>\n<p><span style=\"font-weight: 400\">(from ver8.0)<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">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.<\/span><\/p>\n<\/td>\n<td><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Sample Pattern<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">book~verb<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance Match<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Book a flight<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>Utterance not Matching<\/strong><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400\">\u201c<\/span><em><span style=\"font-weight: 400\">Can I bring a book on board?<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span class=\"ez-toc-section\" id=\"Pattern_Operators\"><span style=\"font-weight: 400\">Pattern Operators<\/span><\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400\"><strong>AND: ( X Y )<\/strong><span style=\"font-weight: 400\">: An ordered relationship of words in sequence. This is the default setting. i.e. when you specify a pattern as <\/span><em><span style=\"font-weight: 400\">cancel order<\/span><\/em><span style=\"font-weight: 400\"> it is the same as <\/span><em><span style=\"font-weight: 400\">(cancel order)<\/span><\/em><span style=\"font-weight: 400\">.<\/span><span style=\"font-weight: 400\"><br \/><\/span><span style=\"font-weight: 400\">For example, <\/span><em><span style=\"font-weight: 400\">(Cancel Booking)<\/span><\/em><span style=\"font-weight: 400\"> matches <\/span><em><span style=\"font-weight: 400\">Cancel my flight booking<\/span><\/em><span style=\"font-weight: 400\"> but doesn\u2019t match <\/span><em><span style=\"font-weight: 400\">I have a pending booking for flight can I cancel?<\/span><\/em><span style=\"font-weight: 400\">. The XO Platform uses patterns with increasing numbers of wildcards between words (up to 3 for an intent). So a pattern of <\/span><em><span style=\"font-weight: 400\">Cancel Order<\/span><\/em><span style=\"font-weight: 400\"> can match:<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">cancel order<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">cancel my order<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">cancel that last order<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">cancel last weeks big order<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400\"><strong>OR: [X Y Z]<\/strong><span style=\"font-weight: 400\">: 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:<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Get me food<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Make me a drink<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Get me a drink<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Get me a dessert<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Make me some quick food<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400\"><strong>NOT: !X<\/strong><span style=\"font-weight: 400\">: Words that should not appear in the user utterance for an intent match. For example, (!forecast) is marked as a pattern for an intent named <\/span><em><span style=\"font-weight: 400\">Get current weather<\/span><\/em><span style=\"font-weight: 400\"> and the assistant supports another intent called <\/span><em><span style=\"font-weight: 400\">Get 3-day weather forecast.<\/span><\/em>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">will not match <\/span><em><span style=\"font-weight: 400\">Get current weather<\/span><\/em><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">will match <\/span><em><span style=\"font-weight: 400\">Get 3-day weather forecast<\/span><\/em><em><span style=\"font-weight: 400\"><br \/><\/span><\/em><br \/>\n<table style=\"width: 100%;border-collapse: collapse;background-color: #fffbea\">\n<tbody>\n<tr>\n<td style=\"width: 100%\">\n<p><strong><em>Note <\/em><em><span style=\"font-weight: 400\">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.<\/span><\/em><\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">User utterance: <\/span><em><span style=\"font-weight: 400\">Planning a trip to California get me the forecast<\/span><\/em><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400\"><strong>Optional: {X}<\/strong><span style=\"font-weight: 400\">: For example, {phone} If the user utterance is <\/span><em><span style=\"font-weight: 400\">Get me a phone number<\/span><\/em><span style=\"font-weight: 400\"> or <\/span><em><span style=\"font-weight: 400\">get me a number<\/span><\/em><span style=\"font-weight: 400\"> the Platform will treat it equally.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Enforce Phrase:<\/strong><span style=\"font-weight: 400\"> X_Y: To enforce occurrence of the phrase as is in the user utterance, without any words in between. For example,check_in. The utterance <\/span><em><span style=\"font-weight: 400\">check in <\/span><\/em><span style=\"font-weight: 400\">\u00a0or <\/span><em><span style=\"font-weight: 400\">I want to check in<\/span><\/em><span style=\"font-weight: 400\"> will match but not <\/span><em><span style=\"font-weight: 400\">Can you check me in for my flight?<\/span><\/em><span style=\"font-weight: 400\">\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Concepts: ~<\/strong><span style=\"font-weight: 400\">: The 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<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">I like India<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">I love traveling to Australia<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">I would like to visit an African country<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400\"><strong>Unordered: &lt;&lt;, &gt;&gt;<\/strong><span style=\"font-weight: 400\">: Used to find words in any order. For example, &lt;&lt;Cancel Booking&gt;&gt; matches <\/span><em><span style=\"font-weight: 400\">Cancel my flight booking <\/span><\/em><span style=\"font-weight: 400\">and also <\/span><em><span style=\"font-weight: 400\">I have a pending booking for a flight, can I cancel<\/span><\/em><\/li>\n<li style=\"font-weight: 400\"><strong>Start\/End of Statement: &lt;, &gt;:<\/strong><span style=\"font-weight: 400\"> For example, ( <\/span><em><span style=\"font-weight: 400\">check in &gt;<\/span><\/em><span style=\"font-weight: 400\"> ) will match <\/span><em><span style=\"font-weight: 400\">I want to check in,<\/span><\/em><span style=\"font-weight: 400\"> but will not match <\/span><em><span style=\"font-weight: 400\">I want to check in now..<\/span><\/em><\/li>\n<li style=\"font-weight: 400\"><strong>Quote: \u2018 \u2013<\/strong><span style=\"font-weight: 400\">: 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, (<\/span><em><span style=\"font-weight: 400\">like to book a flight<\/span><\/em><span style=\"font-weight: 400\">) This matches <\/span><em><span style=\"font-weight: 400\">I would like to book a flight, <\/span><\/em><span style=\"font-weight: 400\">but not <\/span><em><span style=\"font-weight: 400\">I really liked how easy it was to book a flight on your app<\/span><\/em><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Negative_Patterns\"><span style=\"font-weight: 400\">Negative Patterns<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">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.<\/span><\/p>\n<p><strong>User Utterance<\/strong><span style=\"font-weight: 400\">: \u201c<\/span><em><span style=\"font-weight: 400\">I was booking a flight\u00a0 when I got network failure error\u201d<\/span><\/em><\/p>\n<p><strong>Intent Detected<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">Book a flight<\/span><\/em><\/p>\n<p><strong>Intended Intent<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">Issue Resolution<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">Add a <\/span><strong>Negative Pattern<\/strong><span style=\"font-weight: 400\"> (<\/span><em><span style=\"font-weight: 400\">network failure) (error) (technical issue)<\/span><\/em><span style=\"font-weight: 400\"> for the intent <\/span><em><span style=\"font-weight: 400\">Book a Flight.\u00a0<\/span><\/em><\/p>\n<p><strong>User Utterance<\/strong><span style=\"font-weight: 400\">: \u201c<\/span><em><span style=\"font-weight: 400\">I was booking a flight when I got network failure error\u201d<\/span><\/em><\/p>\n<p><em><span style=\"font-weight: 400\">or \u201cI was booking a flight when I faced a technical issue\u201d<\/span><\/em><\/p>\n<p><em><span style=\"font-weight: 400\">or \u201cI got an error while booking a flight.\u201d<\/span><\/em><\/p>\n<p><strong>Intent Rejected<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">Book a Flight<\/span><\/em><\/p>\n<p><strong>Intent Triggered:<\/strong><em><span style=\"font-weight: 400\"> Issue Resolution<\/span><\/em><\/p>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Patterns_for_Entity_Extraction\"><span style=\"font-weight: 400\">Patterns for Entity Extraction<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">Patterns can be used to identify the values for entities in user utterance based upon their position and occurrence in user utterance.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Intent patterns operators like <\/span><em><span style=\"font-weight: 400\">{\u2026}<\/span><\/em><span style=\"font-weight: 400\">, <\/span><em><span style=\"font-weight: 400\">[\u2026]<\/span><\/em><span style=\"font-weight: 400\">, <\/span><em><span style=\"font-weight: 400\">!<\/span><\/em><span style=\"font-weight: 400\">, <\/span><em><span style=\"font-weight: 400\">~concepts<\/span><\/em><span style=\"font-weight: 400\"> can be used for entity extraction. The following are some use cases where patterns can be applied.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Every entity pattern has to include a * (of some form) to represent where the Platform should look for an entity value.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Continuing with the Travel Planning Assistant example with the <\/span><em><span style=\"font-weight: 400\">Book Flight <\/span><\/em><span style=\"font-weight: 400\">intent. This intent needs two entities \u2013 <\/span><em><span style=\"font-weight: 400\">DepartureCity <\/span><\/em><span style=\"font-weight: 400\">and <\/span><em><span style=\"font-weight: 400\">ArrivalCity<\/span><\/em><span style=\"font-weight: 400\">. We will see how to achieve this.<\/span><\/p>\n<h4>\u00a0<\/h4>\n<h3><span class=\"ez-toc-section\" id=\"Pattern_1_word1_word2\"><span style=\"font-weight: 400\">Pattern 1: word1 * word2<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">This can be used as a positional wildcard that indicates the expected position of the entity.<\/span><\/p>\n<p><strong>Pattern for <\/strong><strong><em>ArrivalCity <\/em><\/strong><strong>entity<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">to * from<\/span><\/em><\/p>\n<p><strong>User Utterance<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">Book a flight to London..<\/span><\/em><\/p>\n<p><strong>Entity Extracted<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">ArrivalCity = London<\/span><\/em><\/p>\n<p><strong><em>User Utterance not resulting in entity extraction<\/em><\/strong><em><span style=\"font-weight: 400\">: \u201cBook a flight <\/span><\/em><em><span style=\"font-weight: 400\">for<\/span><\/em><em><span style=\"font-weight: 400\"> London\u201d<\/span><\/em><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Pattern_2_word1_n\"><span style=\"font-weight: 400\">Pattern 2: word1 *n<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">This can be used as a positional wildcard * that indicates the <\/span><span style=\"font-weight: 400\">expected position of the entity based upon the number of words<\/span><span style=\"font-weight: 400\"> after the specified word1. That is, <\/span><em><span style=\"font-weight: 400\">n<\/span><\/em><span style=\"font-weight: 400\"> words after the <\/span><em><span style=\"font-weight: 400\">word1<\/span><\/em><span style=\"font-weight: 400\"> are to be considered for the entity, if <\/span><em><span style=\"font-weight: 400\">n<\/span><\/em><span style=\"font-weight: 400\"> words are not present then look for the next occurence of <\/span><em><span style=\"font-weight: 400\">word1<\/span><\/em><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><strong>Pattern for <\/strong><strong><em>DepartureCity <\/em><\/strong><strong>entity<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">from *2<\/span><\/em><\/p>\n<p><strong>User Utterance<\/strong><span style=\"font-weight: 400\">: Book flight from Paris<\/span><em><span style=\"font-weight: 400\">.<\/span><\/em><\/p>\n<p><strong>Entity Extracted<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">DepartureCity = Paris<\/span><\/em><\/p>\n<p><strong><em>User Utterance not resulting in entity extraction<\/em><\/strong><em><span style=\"font-weight: 400\">: \u201cBook flight flying from Paris <\/span><\/em><em><span style=\"font-weight: 400\">towards <\/span><\/em><em><span style=\"font-weight: 400\">London\u201d<\/span><\/em><\/p>\n<h4><span style=\"font-weight: 400\">Extension to Pattern 2: word1 *~n<\/span><\/h4>\n<p><span style=\"font-weight: 400\">Similar to above (pattern 2) but extracts up to n number, if that number of words are available. <\/span><\/p>\n<table style=\"width: 100%;border-collapse: collapse;background-color: #fffbea\">\n<tbody>\n<tr>\n<td style=\"width: 100%\">\n<p><strong><em>Note <\/em><em><span style=\"font-weight: 400\">that entities need to extract something so *~1 is really the same as *1.<\/span><\/em><\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u00a0<\/h4>\n<h3><span class=\"ez-toc-section\" id=\"Pattern_3_a_combination_of_word1_word2_and_word3_n\"><span style=\"font-weight: 400\">Pattern 3: a combination of word1 * word2 and word3 *n<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">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.<\/span><\/p>\n<p><strong>Pattern for <\/strong><strong><em>ArrivalCity <\/em><\/strong><strong>entity<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">\u201cto * from\u201d<\/span><\/em><span style=\"font-weight: 400\"> and <\/span><em><span style=\"font-weight: 400\">\u201cfrom to *1\u201d<\/span><\/em><\/p>\n<p><strong>Pattern for <\/strong><strong><em>DepartureCity <\/em><\/strong><strong>entity<\/strong><em><span style=\"font-weight: 400\">: \u201cfrom * to\u201d and \u201cto from *2\u201d<\/span><\/em><\/p>\n<p><strong>User Utterance<\/strong><span style=\"font-weight: 400\">: Book flight to London from Paris<\/span><em><span style=\"font-weight: 400\">.<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0or <\/span><em><span style=\"font-weight: 400\">Book flight from Paris to London.<\/span><\/em><\/p>\n<p><strong>Entity Extracted<\/strong><span style=\"font-weight: 400\">: ArrivalCity = <\/span><em><span style=\"font-weight: 400\">London <\/span><\/em><span style=\"font-weight: 400\">and <\/span><em><span style=\"font-weight: 400\">DepartureCity <\/span><\/em><span style=\"font-weight: 400\">= Paris<\/span><\/p>\n<p><strong><em>User Utterance not resulting in entity extraction<\/em><\/strong><em><span style=\"font-weight: 400\">: \u201cbook flight <\/span><\/em><em><span style=\"font-weight: 400\">for<\/span><\/em><em><span style=\"font-weight: 400\"> London from Paris.<\/span><\/em><\/p>\n<p>\u00a0<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Pattern_4_word1_word2\"><span style=\"font-weight: 400\">Pattern 4: [ word1 word2 ] *<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">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 <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/how-tos\/how-to-use-patterns-for-intents-entities\/#Patterns_for_Intent_Detection\"><span style=\"font-weight: 400\">intent detection<\/span><\/a><span style=\"font-weight: 400\"> for details).<\/span><\/p>\n<p><strong>Pattern for <\/strong><strong><em>ArrivalCity <\/em><\/strong><strong>entity<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">\u201cto * [ from ]\u201d<\/span><\/em><span style=\"font-weight: 400\"> and <\/span><em><span style=\"font-weight: 400\">\u201c[ from ] to *1\u201d<\/span><\/em><\/p>\n<p><strong>Pattern for <\/strong><strong><em>DepartureCity <\/em><\/strong><strong>entity<\/strong><em><span style=\"font-weight: 400\">: \u201c[ from ] * to\u201d and \u201cto [ from ] *\u201d<\/span><\/em><\/p>\n<p><strong>User Utterance<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">Book flight to London from Paris<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0or <\/span><em><span style=\"font-weight: 400\">Book flight from London to Paris.<\/span><\/em><\/p>\n<p><strong>Entity Extracted<\/strong><span style=\"font-weight: 400\">: ArrivalCity = <\/span><em><span style=\"font-weight: 400\">London<\/span><\/em><span style=\"font-weight: 400\">, DepartureCity = <\/span><em><span style=\"font-weight: 400\">Paris<\/span><\/em><\/p>\n<p><strong><em>User Utterance not resulting in entity extraction<\/em><\/strong><em><span style=\"font-weight: 400\">: \u201cBook flight <\/span><\/em><em><span style=\"font-weight: 400\">for <\/span><\/em><em><span style=\"font-weight: 400\">London from Paris.<\/span><\/em><\/p>\n<p>\u00a0<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Pattern_5_CustomConcept\"><span style=\"font-weight: 400\">Pattern 5: ~CustomConcept *<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">This can be for using concepts. You can create your own custom concepts and use them to define patterns.<\/span><\/p>\n<p><strong>Pattern for <\/strong><strong><em>ArrivalCity<\/em><\/strong><strong>entity<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">\u201cto * from\u201d<\/span><\/em><span style=\"font-weight: 400\"> and <\/span><em><span style=\"font-weight: 400\">\u201cfrom to *\u201d<\/span><\/em><\/p>\n<p><strong>Pattern for <\/strong><strong><em>DepartureCity <\/em><\/strong><strong>entity<\/strong><em><span style=\"font-weight: 400\">: \u201c~in * to\u201d and \u201cto ~in *\u201d<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">Custom Concept<\/span><em><span style=\"font-weight: 400\">: ~in<\/span><\/em><span style=\"font-weight: 400\"> \u2013 <\/span><em><span style=\"font-weight: 400\">(from)<\/span><\/em><\/p>\n<p><strong>User Utterance<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">Book flight landing in London and taking off from Paris .<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0or <\/span><em><span style=\"font-weight: 400\">Book flight with takeoff from Paris and landing in London<\/span><\/em><\/p>\n<p><strong>Entity Extracted<\/strong><span style=\"font-weight: 400\">: ArrivalCity = <\/span><em><span style=\"font-weight: 400\">London<\/span><\/em><span style=\"font-weight: 400\">, DepartureCity = <\/span><em><span style=\"font-weight: 400\">Paris<\/span><\/em><\/p>\n<p><strong>User Utterance not resulting in entity extraction<\/strong><span style=\"font-weight: 400\">: \u201c<\/span><em><span style=\"font-weight: 400\">book flight landing in London taking off in Paris.<\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p>\u00a0<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Pattern_6_intent\"><span style=\"font-weight: 400\">Pattern 6: ~intent<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">Useful in entity patterns and custom entities<\/span><\/p>\n<p><span style=\"font-weight: 400\">Words that are used in the intent identification are dynamically marked with the <\/span><em><span style=\"font-weight: 400\">~intent<\/span><\/em><span style=\"font-weight: 400\"> concept. This can then be used as an anchor or reference point for some entity patterns.<\/span><\/p>\n<p><strong>Sample Pattern<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">\u201c~intent~trip~plural\u201c<\/span><\/em><\/p>\n<p><strong>User Utterance not resulting in entity extraction<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">show my trips.<\/span><\/em><\/p>\n<p><strong>User Utterance might mark the entity<\/strong><span style=\"font-weight: 400\">: \u201c<\/span><em><span style=\"font-weight: 400\">Show me the Trip of a Lifetime in-flight magazine. <\/span><\/em><span style=\"font-weight: 400\">\u201c<\/span><\/p>\n<p>\u00a0<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Pattern_7_currentEntity\"><span style=\"font-weight: 400\">Pattern 7: $currentEntity<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400\">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 be desirable, especially for strings.<\/span><\/p>\n<p><strong>Pattern<\/strong><span style=\"font-weight: 400\">: <\/span><em><span style=\"font-weight: 400\">\u201c$currentEntity=TaskTitle \u2018called *\u201c<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">The above rule will result in evaluating the pattern when the dialog flow has reached the TaskTitle node.<\/span><\/p>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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. Important Notes: Patterns are to be used as a last resort, only for cases where the ML engine cannot be used. Examples of&#8230;<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197],"tags":[],"class_list":["post-48016","post","type-post","status-publish","format-standard","hentry","category-travel-planing-assistant"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/48016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=48016"}],"version-history":[{"count":4,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/48016\/revisions"}],"predecessor-version":[{"id":48404,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/48016\/revisions\/48404"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=48016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=48016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=48016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}