Skip to content

Commit 87f489c

Browse files
authored
Merge pull request #79463 from diberry/0612-freshness-2
[Cogsvcs] LUIS - freshness - pattern.any tutorial
2 parents 6520cd7 + f0e5a77 commit 87f489c

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

articles/cognitive-services/LUIS/luis-tutorial-pattern-any.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: language-understanding
1111
ms.topic: tutorial
12-
ms.date: 12/21/2018
12+
ms.date: 06/12/2019
1313
ms.author: diberry
1414
#Customer intent: As a new user, I want to understand how and why to use pattern.any entity to improve predictions.
1515
---
@@ -61,24 +61,20 @@ The varying length includes words that may confuse LUIS about where the entity e
6161
|{FormName} is published in French[?]|
6262

6363
## Import example app
64-
Continue with the app created in the last tutorial, named **HumanResources**.
6564

66-
Use the following steps:
65+
1. Download and save [app JSON file](https://github.com/Azure-Samples/cognitive-services-language-understanding/blob/master/documentation-samples/tutorials/custom-domain-pattern-roles-HumanResources.json).
6766

68-
1. Download and save [app JSON file](https://github.com/Azure-Samples/cognitive-services-language-understanding/blob/master/documentation-samples/tutorials/custom-domain-pattern-roles-HumanResources.json).
67+
1. In the [LUIS portal](https://www.luis.ai), on the **My apps** page, import the JSON into a new app.
6968

70-
2. Import the JSON into a new app.
71-
72-
3. From the **Manage** section, on the **Versions** tab, clone the version, and name it `patt-any`. Cloning is a great way to play with various LUIS features without affecting the original version. Because the version name is used as part of the URL route, the name can't contain any characters that are not valid in a URL.
69+
1. From the **Manage** section, on the **Versions** tab, clone the version, and name it `patt-any`. Cloning is a great way to play with various LUIS features without affecting the original version. Because the version name is used as part of the URL route, the name can't contain any characters that are not valid in a URL.
7370

7471
## Add example utterances
75-
Remove the prebuilt keyPhrase entity if it is difficult to create and label the FormName entity.
7672

7773
1. Select **Build** from the top navigation, then select **Intents** from left navigation.
7874

79-
2. Select **FindForm** from the intents list.
75+
1. Select **FindForm** from the intents list.
8076

81-
3. Add some example utterances:
77+
1. Add some example utterances:
8278

8379
|Example utterance|
8480
|--|
@@ -90,23 +86,23 @@ Remove the prebuilt keyPhrase entity if it is difficult to create and label the
9086
Without a Pattern.any entity, it would be difficult for LUIS to understand where the form title ends because of the many variations of form names.
9187

9288
## Create a Pattern.any entity
93-
The Pattern.any entity extracts entities of varying length. It only works in a pattern because the pattern marks the beginning and end of the entity. If you find that your pattern, when it includes a Pattern.any, extracts entities incorrectly, use an [explicit list](luis-concept-patterns.md#explicit-lists) to correct this problem.
89+
The Pattern.any entity extracts entities of varying length. It only works in a pattern because the pattern marks the beginning and end of the entity.
9490

9591
1. Select **Entities** in the left navigation.
9692

97-
2. Select **Create new entity**, enter the name `FormName`, and select **Pattern.any** as the type. Select **Done**.
93+
1. Select **Create new entity**, enter the name `FormName`, and select **Pattern.any** as the type. Select **Done**.
9894

99-
You can't label the entity in the intent because a Pattern.any is only valid in a pattern.
95+
You can't label the entity in an intent's example utterances because a Pattern.any is only valid in a pattern.
10096

10197
If you want the extracted data to include other entities such as number or datetimeV2, you need to create a composite entity that includes the Pattern.any, as well as number and datetimeV2.
10298

10399
## Add a pattern that uses the Pattern.any
104100

105101
1. Select **Patterns** from the left navigation.
106102

107-
2. Select the **FindForm** intent.
103+
1. Select the **FindForm** intent.
108104

109-
3. Enter the following template utterances, which use the new entity:
105+
1. Enter the following template utterances, which use the new entity:
110106

111107
|Template utterances|
112108
|--|
@@ -117,24 +113,27 @@ The Pattern.any entity extracts entities of varying length. It only works in a p
117113

118114
If you want to account for variations of the form such as single quotes instead of double quotes or a period instead of a question mark, create a new pattern for each variation.
119115

120-
4. If you removed the keyPhrase entity, add it back to the app.
121-
122116
## Train the LUIS app
123117

124118
[!INCLUDE [LUIS How to Train steps](../../../includes/cognitive-services-luis-tutorial-how-to-train.md)]
125119

126120
## Test the new pattern for free-form data extraction
127121
1. Select **Test** from the top bar to open the test panel.
128122

129-
2. Enter the following utterance:
123+
1. Enter the following utterance:
130124

131125
`Where is the form Understand your responsibilities as a member of the community and who needs to sign it after I read it?`
132126

133-
3. Select **Inspect** under the result to see the test results for entity and intent.
127+
1. Select **Inspect** under the result to see the test results for entity and intent.
134128

135129
The entity `FormName` is found first, then the pattern is found, determining the intent. If you have a test result where the entities are not detected, and therefore the pattern is not found, you need to add more example utterances on the intent (not the pattern).
136130

137-
4. Close the test panel by selecting the **Test** button in the top navigation.
131+
1. Close the test panel by selecting the **Test** button in the top navigation.
132+
133+
## Using an explicit list
134+
135+
If you find that your pattern, when it includes a Pattern.any, extracts entities incorrectly, use an [explicit list](luis-concept-patterns.md#explicit-lists) to correct this problem.
136+
138137

139138
## Clean up resources
140139

0 commit comments

Comments
 (0)