Skip to content

Commit a6b3852

Browse files
authored
Merge pull request #111308 from diberry/diberry/0414-luis-grammar
[Cogsvcs] LUIS - app settings
2 parents e00e271 + b53c0c0 commit a6b3852

11 files changed

+121
-192
lines changed

articles/cognitive-services/LUIS/get-started-portal-build-app.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Quickstart: Create a new app in the LUIS portal"
33
description: In this quickstart, you create the basic parts of an app, intents, and entities as well as test with sample utterance in the LUIS portal.
44
ms.topic: quickstart
5-
ms.date: 03/24/2020
5+
ms.date: 04/14/2020
66
#Customer intent: As a new user, I want to quickly get a LUIS app created in the LUIS portal so I can understand the different models of intent, entity, and example utterances.
77
---
88

@@ -84,13 +84,12 @@ Add the following 15 example utterances to the `FindForm` intent.
8484
By design, these example utterances vary in the following ways:
8585

8686
* utterance length
87-
* punctuation
87+
* [punctuation](luis-reference-application-settings.md#punctuation-normalization)
8888
* word choice
8989
* verb tense (is, was, will be)
9090
* word order
9191

9292

93-
9493
## Create a regular expression entity
9594

9695
To return the form number in the runtime prediction response, the form must be marked as an entity. Because the form number text is highly structured, you can mark it using a regular expression entity. Create the entity with the following steps:

articles/cognitive-services/LUIS/includes/do-not-use-too-few-utterances.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ author: diberry
66
manager: nitinme
77
ms.custom: seodec18
88
ms.service: cognitive-services
9-
ms.date: 02/14/2020
9+
ms.date: 04/14/2020
1010
ms.subservice: language-understanding
1111
ms.topic: include
1212
ms.custom: include file
1313
ms.author: diberry
1414
---
1515

16-
These few utterances are for demonstration purposes only. A real-world app should have at least 15 utterances of varying length, word order, tense, grammatical correctness, punctuation, and word count.
16+
These few utterances are for demonstration purposes only. A real-world app should have at least 15 utterances of varying length, word order, tense, grammatical correctness, [punctuation](../luis-reference-application-settings.md#punctuation-normalization), and word count.

articles/cognitive-services/LUIS/label-entity-example-utterance.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
---
22
title: Label entity example utterance
3-
titleSuffix: Azure Cognitive Services
43
description: Learn how to label a machine-learned entity with subcomponents in an example utterance in an intent detail page of the LUIS portal.
5-
services: cognitive-services
6-
author: diberry
7-
manager: nitinme
8-
ms.service: cognitive-services
9-
ms.subservice: language-understanding
104
ms.topic: conceptual
11-
ms.date: 12/16/2019
12-
ms.author: diberry
5+
ms.date: 04/14/2020
136
#Customer intent: As a new user, I want to label a machine-learned entity in an example utterance.
147
---
158

@@ -84,6 +77,10 @@ Entity roles are labeled using the entity palette.
8477
1. Move to the **Entity inspector**, and either select an existing role or create a new role.
8578
1. In the example utterance text, label the text with the entity role.
8679

80+
## Labeling for punctuation
81+
82+
You do not need to label for punctuation. Use [application settings](luis-reference-application-settings.md) to control if punctuation impacts utterance predictions.
83+
8784
## Unlabel entities
8885

8986
To unlabel an entity, select the entity name underneath the text and select **Unlabel**. If the entity you are trying to unlabel has labeled subcomponents, then the subcomponents must be unlabeled first.

articles/cognitive-services/LUIS/luis-concept-best-practices.md

Lines changed: 32 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
---
22
title: Best practices for building your LUIS app
3-
titleSuffix: Azure Cognitive Services
43
description: Learn the best practices to get the best results from your LUIS app's model.
5-
services: cognitive-services
6-
author: diberry
7-
manager: nitinme
8-
ms.custom: seodec18
9-
ms.service: cognitive-services
10-
ms.subservice: language-understanding
114
ms.topic: conceptual
12-
ms.date: 10/25/2019
5+
ms.date: 04/14/2020
136
ms.author: diberry
147
---
158
# Best practices for building a language understanding (LUIS) app
16-
Use the app authoring process to build your LUIS app:
9+
Use the app authoring process to build your LUIS app:
1710

1811
* Build language models (intents and entities)
1912
* Add a few training example utterances (15-30 per intent)
2013
* Publish to endpoint
21-
* Test from endpoint
14+
* Test from endpoint
2215

23-
Once your app is [published](luis-how-to-publish-app.md), use the development lifecycle to add features, publish, and test from endpoint. Do not begin the next authoring cycle by adding more example utterances because that does not let LUIS learn your model with real-world user utterances.
16+
Once your app is [published](luis-how-to-publish-app.md), use the development lifecycle to add features, publish, and test from endpoint. Do not begin the next authoring cycle by adding more example utterances because that does not let LUIS learn your model with real-world user utterances.
2417

25-
Do not expand the utterances until the current set of both example and endpoint utterances are returning confident, high prediction scores. Improve scores using [active learning](luis-concept-review-endpoint-utterances.md).
18+
Do not expand the utterances until the current set of both example and endpoint utterances are returning confident, high prediction scores. Improve scores using [active learning](luis-concept-review-endpoint-utterances.md).
2619

2720

2821

@@ -43,7 +36,7 @@ The following list includes best practices for LUIS apps:
4336
## Do define distinct intents
4437
Make sure the vocabulary for each intent is just for that intent and not overlapping with a different intent. For example, if you want to have an app that handles travel arrangements such as airline flights and hotels, you can choose to have these subject areas as separate intents or the same intent with entities for specific data inside the utterance.
4538

46-
If the vocabulary between two intents is the same, combine the intent, and use entities.
39+
If the vocabulary between two intents is the same, combine the intent, and use entities.
4740

4841
Consider the following example utterances:
4942

@@ -52,20 +45,20 @@ Consider the following example utterances:
5245
|Book a flight|
5346
|Book a hotel|
5447

55-
`Book a flight` and `Book a hotel` use the same vocabulary of `book a `. This format is the same so it should be the same intent with the different words of `flight` and `hotel` as extracted entities.
48+
`Book a flight` and `Book a hotel` use the same vocabulary of `book a `. This format is the same so it should be the same intent with the different words of `flight` and `hotel` as extracted entities.
5649

5750
## Do add descriptors to intents
5851

59-
Descriptors help describe features for an intent. A descriptor can be a phrase list of words that are significant to that intent or an entity that is significant to that intent.
52+
Descriptors help describe features for an intent. A descriptor can be a phrase list of words that are significant to that intent or an entity that is significant to that intent.
6053

6154
## Do find sweet spot for intents
62-
Use prediction data from LUIS to determine if your intents are overlapping. Overlapping intents confuse LUIS. The result is that the top scoring intent is too close to another intent. Because LUIS does not use the exact same path through the data for training each time, an overlapping intent has a chance of being first or second in training. You want the utterance's score for each intention to be farther apart so this flip/flop doesn't happen. Good distinction for intents should result in the expected top intent every time.
63-
55+
Use prediction data from LUIS to determine if your intents are overlapping. Overlapping intents confuse LUIS. The result is that the top scoring intent is too close to another intent. Because LUIS does not use the exact same path through the data for training each time, an overlapping intent has a chance of being first or second in training. You want the utterance's score for each intention to be farther apart so this flip/flop doesn't happen. Good distinction for intents should result in the expected top intent every time.
56+
6457
<a name="#do-build-the-app-iteratively"></a>
6558

6659
## Do build your app iteratively with versions
6760

68-
Each authoring cycle should be within a new [version](luis-concept-version.md), cloned from an existing version.
61+
Each authoring cycle should be within a new [version](luis-concept-version.md), cloned from an existing version.
6962

7063
## Do build for model decomposition
7164

@@ -76,58 +69,33 @@ Model decomposition has a typical process of:
7669
* label top-level data concept in example utterance
7770
* break data concept into subcomponents
7871
* add descriptors (features) to subcomponents
79-
* add descriptors (features) to intent
72+
* add descriptors (features) to intent
8073

81-
Once you have created the intent and added example utterances, the following example describes entity decomposition.
74+
Once you have created the intent and added example utterances, the following example describes entity decomposition.
8275

83-
Start by identifying complete data concepts you want to extract in an utterance. This is your machine-learned entity. Then decompose the phrase into its parts. This includes identifying subcomponents (as entities), along with descriptors and constraints.
76+
Start by identifying complete data concepts you want to extract in an utterance. This is your machine-learned entity. Then decompose the phrase into its parts. This includes identifying subcomponents (as entities), along with descriptors and constraints.
8477

85-
For example if you want to extract an address, the top machine-learned entity could be called `Address`. While creating the address, identify some of its subcomponents such as street address, city, state, and postal code.
78+
For example if you want to extract an address, the top machine-learned entity could be called `Address`. While creating the address, identify some of its subcomponents such as street address, city, state, and postal code.
8679

8780
Continue decomposing those elements by **constraining** the postal code to a regular expression. Decompose the street address into parts of a street number (using a prebuilt number), a street name, and a street type. The street type can be described with a **descriptor** list such as avenue, circle, road, and lane.
8881

89-
The V3 authoring API allows for model decomposition.
82+
The V3 authoring API allows for model decomposition.
9083

9184
## Do add patterns in later iterations
9285

93-
You should understand how the app behaves before adding [patterns](luis-concept-patterns.md) because patterns are weighted more heavily than example utterances and will skew confidence.
94-
95-
Once you understand how your app behaves, add patterns as they apply to your app. You do not need to add them with each [iteration](luis-concept-app-iteration.md).
96-
97-
There is no harm adding them in the beginning of your model design but it is easier to see how each pattern changes the model after the model is tested with utterances.
98-
99-
<!--
100-
101-
### Phrase lists
102-
103-
[Phrase lists](luis-concept-feature.md) allow you to define dictionaries of words related to your app domain. Seed your phrase list with a few words then use the suggest feature so LUIS knows about more words in the vocabulary specific to your app. A Phrase List improves intent detection and entity classification by boosting the signal associated with words or phrases that are significant to your app.
104-
105-
Don't add every word to the vocabulary since the phrase list isn't an exact match.
106-
107-
For more information:
108-
* Concept: [Phrase list features in your LUIS app](luis-concept-feature.md)
109-
* How-to: [Use phrase lists to boost signal of word list](luis-how-to-add-features.md)
110-
111-
112-
113-
### Patterns
114-
115-
Real user utterances from the endpoint, very similar to each other, may reveal patterns of word choice and placement. The [pattern](luis-concept-patterns.md) feature takes this word choice and placement along with regular expressions to improve your prediction accuracy. A regular expression in the pattern allows for words and punctuation you intend to ignore while still matching the pattern.
86+
You should understand how the app behaves before adding [patterns](luis-concept-patterns.md) because patterns are weighted more heavily than example utterances and will skew confidence.
11687

117-
Use pattern's [optional syntax](luis-concept-patterns.md) for punctuation so punctuation can be ignored. Use the [explicit list](luis-concept-patterns.md#explicit-lists) to compensate for pattern.any syntax issues.
88+
Once you understand how your app behaves, add patterns as they apply to your app. You do not need to add them with each [iteration](luis-concept-app-iteration.md).
11889

119-
For more information:
120-
* Concept: [Patterns improve prediction accuracy](luis-concept-patterns.md)
121-
* How-to: [How to add Patterns to improve prediction accuracy](luis-how-to-model-intent-pattern.md)
122-
-->
90+
There is no harm adding them in the beginning of your model design but it is easier to see how each pattern changes the model after the model is tested with utterances.
12391

12492
<a name="balance-your-utterances-across-all-intents"></a>
12593

12694
## Do balance your utterances across all intents
12795

128-
In order for LUIS predictions to be accurate, the quantity of example utterances in each intent (except for the None intent), must be relatively equal.
96+
In order for LUIS predictions to be accurate, the quantity of example utterances in each intent (except for the None intent), must be relatively equal.
12997

130-
If you have an intent with 100 example utterances and an intent with 20 example utterances, the 100-utterance intent will have a higher rate of prediction.
98+
If you have an intent with 100 example utterances and an intent with 20 example utterances, the 100-utterance intent will have a higher rate of prediction.
13199

132100
## Do add example utterances to None intent
133101

@@ -139,49 +107,49 @@ Use [active learning](luis-how-to-review-endpoint-utterances.md)'s **Review endp
139107

140108
## Do monitor the performance of your app
141109

142-
Monitor the prediction accuracy using a [batch test](luis-concept-batch-test.md) set.
110+
Monitor the prediction accuracy using a [batch test](luis-concept-batch-test.md) set.
143111

144-
Keep a separate set of utterances that aren't used as [example utterances](luis-concept-utterance.md) or endpoint utterances. Keep improving the app for your test set. Adapt the test set to reflect real user utterances. Use this test set to evaluate each iteration or version of the app.
112+
Keep a separate set of utterances that aren't used as [example utterances](luis-concept-utterance.md) or endpoint utterances. Keep improving the app for your test set. Adapt the test set to reflect real user utterances. Use this test set to evaluate each iteration or version of the app.
145113

146114
## Don't add many example utterances to intents
147115

148-
After the app is published, only add utterances from active learning in the development lifecycle process. If utterances are too similar, add a pattern.
116+
After the app is published, only add utterances from active learning in the development lifecycle process. If utterances are too similar, add a pattern.
149117

150118
## Don't use few or simple entities
151119

152-
Entities are built for data extraction and prediction. It is important that each intent have machine-learned entities that describe the data in the intent. This helps LUIS predict the intent, even if your client application doesn't need to use the extracted entity.
120+
Entities are built for data extraction and prediction. It is important that each intent have machine-learned entities that describe the data in the intent. This helps LUIS predict the intent, even if your client application doesn't need to use the extracted entity.
153121

154122
## Don't use LUIS as a training platform
155123

156-
LUIS is specific to a language model's domain. It isn't meant to work as a general natural language training platform.
124+
LUIS is specific to a language model's domain. It isn't meant to work as a general natural language training platform.
157125

158126
## Don't add many example utterances of the same format, ignoring other formats
159127

160-
LUIS expects variations in an intent's utterances. The utterances can vary while having the same overall meaning. Variations can include utterance length, word choice, and word placement.
128+
LUIS expects variations in an intent's utterances. The utterances can vary while having the same overall meaning. Variations can include utterance length, word choice, and word placement.
161129

162130
|Don't use same format|Do use varying format|
163131
|--|--|
164132
|Buy a ticket to Seattle<br>Buy a ticket to Paris<br>Buy a ticket to Orlando|Buy 1 ticket to Seattle<br>Reserve two seats on the red eye to Paris next Monday<br>I would like to book 3 tickets to Orlando for spring break|
165133

166-
The second column uses different verbs (buy, reserve, book), different quantities (1, two, 3), and different arrangements of words but all have the same intention of purchasing airline tickets for travel.
134+
The second column uses different verbs (buy, reserve, book), different quantities (1, two, 3), and different arrangements of words but all have the same intention of purchasing airline tickets for travel.
167135

168136
## Don't mix the definition of intents and entities
169137

170-
Create an intent for any action your bot will take. Use entities as parameters that make that action possible.
138+
Create an intent for any action your bot will take. Use entities as parameters that make that action possible.
171139

172-
For a bot that will book airline flights, create a **BookFlight** intent. Do not create an intent for every airline or every destination. Use those pieces of data as [entities](luis-concept-entity-types.md) and mark them in the example utterances.
140+
For a bot that will book airline flights, create a **BookFlight** intent. Do not create an intent for every airline or every destination. Use those pieces of data as [entities](luis-concept-entity-types.md) and mark them in the example utterances.
173141

174142
## Don't create descriptors with all the possible values
175143

176-
Provide a few examples in the descriptor [phrase lists](luis-concept-feature.md) but not every word. LUIS generalizes and takes context into account.
144+
Provide a few examples in the descriptor [phrase lists](luis-concept-feature.md) but not every word. LUIS generalizes and takes context into account.
177145

178146
## Don't add many patterns
179147

180148
Don't add too many [patterns](luis-concept-patterns.md). LUIS is meant to learn quickly with fewer examples. Don't overload the system unnecessarily.
181149

182150
## Don't train and publish with every single example utterance
183151

184-
Add 10 or 15 utterances before training and publishing. That allows you to see the impact on prediction accuracy. Adding a single utterance may not have a visible impact on the score.
152+
Add 10 or 15 utterances before training and publishing. That allows you to see the impact on prediction accuracy. Adding a single utterance may not have a visible impact on the score.
185153

186154
## Next steps
187155

0 commit comments

Comments
 (0)