You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/LUIS/luis-tutorial-pattern-any.md
+19-20Lines changed: 19 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ manager: nitinme
9
9
ms.service: cognitive-services
10
10
ms.subservice: language-understanding
11
11
ms.topic: tutorial
12
-
ms.date: 12/21/2018
12
+
ms.date: 06/12/2019
13
13
ms.author: diberry
14
14
#Customer intent: As a new user, I want to understand how and why to use pattern.any entity to improve predictions.
15
15
---
@@ -61,24 +61,20 @@ The varying length includes words that may confuse LUIS about where the entity e
61
61
|{FormName} is published in French[?]|
62
62
63
63
## Import example app
64
-
Continue with the app created in the last tutorial, named **HumanResources**.
65
64
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).
67
66
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.
69
68
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.
73
70
74
71
## Add example utterances
75
-
Remove the prebuilt keyPhrase entity if it is difficult to create and label the FormName entity.
76
72
77
73
1. Select **Build** from the top navigation, then select **Intents** from left navigation.
78
74
79
-
2. Select **FindForm** from the intents list.
75
+
1. Select **FindForm** from the intents list.
80
76
81
-
3. Add some example utterances:
77
+
1. Add some example utterances:
82
78
83
79
|Example utterance|
84
80
|--|
@@ -90,23 +86,23 @@ Remove the prebuilt keyPhrase entity if it is difficult to create and label the
90
86
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.
91
87
92
88
## 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.
94
90
95
91
1. Select **Entities** in the left navigation.
96
92
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**.
98
94
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.
100
96
101
97
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.
102
98
103
99
## Add a pattern that uses the Pattern.any
104
100
105
101
1. Select **Patterns** from the left navigation.
106
102
107
-
2. Select the **FindForm** intent.
103
+
1. Select the **FindForm** intent.
108
104
109
-
3. Enter the following template utterances, which use the new entity:
105
+
1. Enter the following template utterances, which use the new entity:
110
106
111
107
|Template utterances|
112
108
|--|
@@ -117,24 +113,27 @@ The Pattern.any entity extracts entities of varying length. It only works in a p
117
113
118
114
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.
119
115
120
-
4. If you removed the keyPhrase entity, add it back to the app.
121
-
122
116
## Train the LUIS app
123
117
124
118
[!INCLUDE [LUIS How to Train steps](../../../includes/cognitive-services-luis-tutorial-how-to-train.md)]
125
119
126
120
## Test the new pattern for free-form data extraction
127
121
1. Select **Test** from the top bar to open the test panel.
128
122
129
-
2. Enter the following utterance:
123
+
1. Enter the following utterance:
130
124
131
125
`Where is the form Understand your responsibilities as a member of the community and who needs to sign it after I read it?`
132
126
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.
134
128
135
129
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).
136
130
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.
0 commit comments