Skip to content

Commit feec5d3

Browse files
authored
Merge pull request #109564 from diberry/diberry/0330-luis-fresh-1
[Cogsvcs] LUIS - fresh - ml tutorial
2 parents 50ff65e + f4c7fd0 commit feec5d3

File tree

2 files changed

+19
-27
lines changed

2 files changed

+19
-27
lines changed

articles/cognitive-services/LUIS/includes/import-app-steps.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ author: diberry
55
manager: nitinme
66
ms.service: cognitive-services
77
ms.topic: include
8-
ms.date: 12/03/2019
8+
ms.date: 03/30/2020
99
ms.author: diberry
1010
---
1111

12-
1. In the [preview LUIS portal](https://preview.luis.ai), on the **My apps** page, select **Import**, then **Import as JSON**. Find the saved JSON file from the previous step. You don't need to change the name of the app. Select **Done**
12+
1. In the [preview LUIS portal](https://preview.luis.ai), on the **My apps** page, select **+ New app for conversation**, then **Import as JSON**. Find the saved JSON file from the previous step. You don't need to change the name of the app. Select **Done**
1313

14-
1. From the **Manage** section, on the **Versions** tab, select the version, then select **Clone** to clone the version, and give it a new 10-character name, then select **Done** to finish the clone process. 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.
14+
1. From the **Manage** section, on the **Versions** tab, select the `0.1` version, then select **Clone** to clone the version, and give it a new 10-character name of `ml-entity`, then select **Done** to finish the clone process. 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.
1515

1616
> [!TIP]
17-
> Cloning into a new version is a best practice before you modify your app. When you finish a version, export the version (as a .json or .lu file), and check the file into your source control system.
17+
> Cloning into a new version is a best practice before you modify your app. When you finish with a change to a version, export the version (as a .json or .lu file), and check the file into your source control system.
1818
1919
1. Select **Build** then **Intents** to see the intents, the main building blocks of a LUIS app.
2020

articles/cognitive-services/LUIS/tutorial-machine-learned-entity.md

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
---
22
title: "Tutorial: extract structured data with machine-learned entity - LUIS"
3-
titleSuffix: Azure Cognitive Services
43
description: Extract structured data from an utterance using the machine-learned entity. To increase the extraction accuracy, add subcomponents with descriptors and constraints.
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: tutorial
12-
ms.date: 12/17/2019
13-
ms.author: diberry
5+
ms.date: 03/30/2020
146
#Customer intent: As a new user, I want to understand how to extract complex data contained in a user utterance.
157
---
168

@@ -40,19 +32,19 @@ The machine-learned entity supports the [model decomposition concept](luis-conce
4032

4133
This tutorial adds a machine-learned entity to extract data from an utterance.
4234

43-
The purpose of an entity is to define the data to extract. This includes giving the data a name, a type (if possible), any resolution of the data if there is ambiguity, and the exact text that makes up the data.
35+
The entity defines the data to extract from within the utterance. This includes giving the data a name, a type (if possible), any resolution of the data if there is ambiguity, and the exact text that makes up the data.
4436

45-
In order to define the entity, you need to create the entity then label the text representing the entity in the example utterance. These labeled examples teach LUIS what the entity is and where it can be found in an utterance.
37+
In order to define the entity, you need to create the entity then label the text representing the entity in the example utterances within all intents. These labeled examples teach LUIS what the entity is and where it can be found in an utterance.
4638

4739
## Entity decomposability is important
4840

49-
Entity decomposability is important for both intent prediction and for data extraction.
41+
Entity decomposability is important for both intent prediction and for data extraction with the entity.
5042

5143
Start with a machine-learned entity, which is the beginning and top-level entity for data extraction. Then decompose the entity into the parts needed by the client application.
5244

5345
While you may not know how detailed you want your entity when you begin your app, a best practice is to start with a machine-learned entity, then decompose with subcomponents as your app matures.
5446

55-
In practical terms, you will create a machine-learned entity to represent an order for a pizza app. The order should have all the parts that are necessary to fullfil the order. To begin, the entity will extract order-related text, pulling out size, and quantity.
47+
In this, you create a machine-learned entity to represent an order for a pizza app. The order should have all the parts that are necessary to fullfil the order. To begin, the entity will extract order-related text, pulling out size, and quantity.
5648

5749
An utterance for `Please deliver one large cheese pizza to me` should extract `one large cheese pizza` as the order, then also extract `1` and `large`.
5850

@@ -88,7 +80,7 @@ To extract details about a pizza order, create a top level, machine-learned `Ord
8880
![Add structure to entity](media/tutorial-machine-learned-entity/add-structure-to-entity.png)
8981

9082
1. In the **Create a machine learned entity** box, in the **Structure** box, add `Size` then select Enter.
91-
1. To add a **descriptor**, select the `+` in the **Descriptors for Size** area, then select **Create new phrase list**.
83+
1. To add a **descriptor**, select the `+` in the **Descriptors** area, then select **Create new phrase list**.
9284

9385
1. In the **Create new phrase list descriptor** box, enter the name `SizeDescriptor` then enter values of: `small`, `medium`, and `large`. When the **Suggestions** box fills in, select `extra large`, and `xl`. Select **Done** to create the new phrase list.
9486

@@ -104,7 +96,7 @@ To extract details about a pizza order, create a top level, machine-learned `Ord
10496

10597
![Label the size entity for text in the utterance.](media/tutorial-machine-learned-entity/mark-and-create-size-entity.png)
10698

107-
The line is solid under the text because both the labeling and prediction match because you explicitly labeled the text.
99+
The line is solid under the text because both the labeling and prediction match because you _explicitly_ labeled the text.
108100

109101
1. Label the `Order` entity in the remaining utterances along with the size entity. The square brackets in the text indicate the labeled `Order` entity and the `Size` entity within.
110102

@@ -128,7 +120,7 @@ To extract details about a pizza order, create a top level, machine-learned `Ord
128120
|--|
129121
|`pickup XL meat lovers pizza`|
130122

131-
The overall top entity, `Order` is labeled and the `Size` subcomponent is also labeled with dotted lines. This is a successful prediction.
123+
The overall top entity, `Order` is labeled and the `Size` subcomponent is also labeled with dotted lines.
132124

133125
![New example utterance predicted with entity](media/tutorial-machine-learned-entity/new-example-utterance-predicted-with-entity.png)
134126

@@ -156,20 +148,20 @@ Begin by adding the prebuilt number entity to the app.
156148

157149
## Create subcomponent entity with constraint to help extract data
158150

159-
The `Order` entity should have a `Quantity` subcomponent to determine how many of an item are in the order. The quantity should be constrained to a number so that the extracted data is immediately usable by the client application.
151+
The `Order` entity should have a `Quantity` subcomponent to determine how many of an item are in the order. The quantity should be constrained to a number so that the extracted data is immediately available to the client application by name.
160152

161153
A constraint is applied as a text match, either with exact matching (such as a list entity) or through regular expressions (such as a regular expression entity or a prebuilt entity).
162154

163155
By using a constraint, only text that matches that constraint is extracted.
164156

165157
1. Select **Entities** then select the `Order` entity.
166-
1. Select **+ Add Component** then enter the name `Quantity` then select Enter to add the new entity to the app.
167-
1. After the success notification, select the `Quantity` subcomponent then select the Constraint pencil.
158+
1. Select **+ Add Component** then enter the name `Quantity` then select Enter to add the new subcomponent to the `Order` entity.
159+
1. After the success notification, in the **Advanced Options**, select the Constraint pencil.
168160
1. In the drop-down list, select the prebuilt number.
169161

170162
![Create quantity entity with prebuilt number as constraint.](media/tutorial-machine-learned-entity/create-constraint-from-prebuilt-number.png)
171163

172-
The `Quantity` entity is applied if and only if text matching the prebuilt number entity is found.
164+
The `Quantity` entity is applied when text matches the prebuilt number entity.
173165

174166
The entity with the constraint is created but not yet applied to the example utterances.
175167

@@ -178,7 +170,7 @@ By using a constraint, only text that matches that constraint is extracted.
178170
179171
## Label example utterance to teach LUIS about the entity
180172

181-
1. Select **Intents** from the left-hand navigation then select the **OrderPizza** intent. The three numbers in the following utterances are labeled but are visually below the `Order` entity line. This lower level means the entities are found but are not considered apart of the `Order` entity.
173+
1. Select **Intents** from the left-hand navigation then select the **OrderPizza** intent. The three numbers in the following utterances are labeled but are visually below the `Order` entity line. This lower level means the entities are found but are not considered a part of the `Order` entity.
182174

183175
![Prebuilt number is found but not considered apart of the Order entity yet.](media/tutorial-machine-learned-entity/prebuilt-number-not-part-of-order-entity.png)
184176

@@ -188,7 +180,7 @@ By using a constraint, only text that matches that constraint is extracted.
188180

189181
## Train the app to apply the entity changes to the app
190182

191-
Select **Train** to train the app with these new utterances.
183+
Select **Train** to train the app with these new utterances. After training, the `Quantity` subcomponent is correctly predicted in the `Order` component. This correct prediction is indicated with a solid line.
192184

193185
![Train the app then review the example utterances.](media/tutorial-machine-learned-entity/trained-example-utterances.png)
194186

@@ -209,7 +201,7 @@ Test the app using the interactive **Test** panel. This process lets you enter a
209201

210202
The size was correctly identified. Remember that the example utterances in the `OrderPizza` intent don't have an example of `medium` as a size but do use a descriptor of a `SizeDescriptor` phrase list that includes medium.
211203

212-
The quantity is not correctly predicted. To fix this, you can add more example utterances using that word to indicate quantity and label that word as a `Quantity` entity.
204+
The quantity is not correctly predicted. You can fix this in your client application by defaulting size to one (1) if no size is returned in the LUIS prediction.
213205

214206
## Publish the app to access it from the HTTP endpoint
215207

0 commit comments

Comments
 (0)