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
{{ message }}
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: packages/luis/docs/lu-file-format.md
+38-37Lines changed: 38 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,11 @@ See [here](./qna-file-format.md) to learn more about the .qna file format.
13
13
- [Composite entity](#Composite-entity)
14
14
- [Regex entity](#Regex-entity)
15
15
-[Roles](#Roles)
16
+
-[Patterns](#Patterns)
16
17
-[Phrase lists features](#Phrase-list-definition)
17
18
-[Model as a feature](#Model-as-feature)
18
19
-[Tie features to a specific model](#Tie-features-to-a-specific-model)
19
-
-[Patterns](#Patterns)
20
+
-[Machine learned with children](#Machine-learned-entity-with-children)
20
21
-[Model description](#Model-description)
21
22
-[References](#External-references)
22
23
@@ -102,7 +103,7 @@ Here's an example:
102
103
@ ml 'this is a simple entity' hasRoles role1, role2
103
104
```
104
105
105
-
## Machine learned entity
106
+
###Machine learned entity
106
107
107
108
```markdown
108
109
@ ml name firstName, lastName
@@ -117,7 +118,7 @@ Here's an example:
117
118
> Without an explicit entity definition, 'userName' defaults to 'ml' entity type.
118
119
```
119
120
120
-
## Prebuilt entity
121
+
###Prebuilt entity
121
122
122
123
The following LUIS prebuilt entity types are supported -
123
124
- age
@@ -145,7 +146,7 @@ The following LUIS prebuilt entity types are supported -
145
146
146
147
**Note:** Not all prebuilt entity types are available across all locales. See [here](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-entities) for prebuilt entity support by locale.
147
148
148
-
## List entity
149
+
###List entity
149
150
150
151
```markdown
151
152
@ list color favColor, screenColor
@@ -165,7 +166,7 @@ The following LUIS prebuilt entity types are supported -
165
166
166
167
**Note::** When using list entity, you should include a value from the list directly in the utterance, not an entity label or any other value.
167
168
168
-
## Composite entity
169
+
###Composite entity
169
170
170
171
```markdown
171
172
@ composite deviceTemperature from, to
@@ -204,7 +205,7 @@ Example definition:
204
205
@ prebuilt temperature
205
206
```
206
207
207
-
## Regex entity
208
+
###Regex entity
208
209
209
210
```markdown
210
211
@ regex hrf-number from, to
@@ -214,24 +215,8 @@ Example definition:
214
215
@ regex hrf-number from, to = /hrf-[0-9]{6}/
215
216
```
216
217
217
-
## Machine learned entity with n-depth support
218
218
219
-
Here's a definition of an `address` n-depth entity with `fromAddress` and `toAddress` as two roles.
220
-
221
-
```markdown
222
-
@ list listCity
223
-
@ prebuilt number
224
-
@ prebuilt geographyV2
225
-
@ regex regexZipcode = /[0-9]{5}/
226
-
@ ml address hasRoles fromAddress, toAddress
227
-
@ address =
228
-
- @ number 'door number'
229
-
- @ ml streetName
230
-
- @ ml location usesFeature geographyV2
231
-
- @ listCity city
232
-
- @ regexZipcode zipcode
233
-
```
234
-
### Roles
219
+
## Roles
235
220
236
221
Roles](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-concept-roles) are named, contextual subtypes of an entity.
237
222
@@ -305,6 +290,23 @@ $city:Portland=
305
290
- Portland
306
291
- PDX
307
292
```
293
+
## Patterns
294
+
Patterns allow you to define a set of rules that augment the machine learned model. You can define patterns in the .lu file simply by defining an entity in an utterance without a labelled value.
295
+
296
+
As an example, this would be treated as a pattern with alarmTime set as a Pattern.Any entity type:
297
+
```markdown
298
+
# DeleteAlarm
299
+
- delete the {alarmTime} alarm
300
+
```
301
+
This example would be treated as an utterance since it has a labelled value with 7AM being the labelled value for entity alarmTime:
302
+
```markdown
303
+
# DeleteAlarm
304
+
- delete the {alarmTime=7AM} alarm
305
+
```
306
+
307
+
**Notes:**
308
+
1. Any utterance without at least one labelled value will be treated as a pattern
309
+
2. Any entity without an explicit labelled value will default to a Pattern.Any entity type.
308
310
309
311
## Phrase list definition
310
312
@@ -414,25 +416,24 @@ Here's how you define phrase list as a feature to another model
414
416
- @ ml city usesFeture PLCity
415
417
- @ regexZipcode zipcode
416
418
```
419
+
## Machine learned entity with children
417
420
418
-
## Patterns
419
-
Patterns allow you to define a set of rules that augment the machine learned model. You can define patterns in the .lu file simply by defining an entity in an utterance without a labelled value.
421
+
Here's a definition of an `address` ml entity with `fromAddress` and `toAddress` as two roles as well as children.
420
422
421
-
As an example, this would be treated as a pattern with alarmTime set as a Pattern.Any entity type:
422
423
```markdown
423
-
# DeleteAlarm
424
-
- delete the {alarmTime} alarm
425
-
```
426
-
This example would be treated as an utterance since it has a labelled value with 7AM being the labelled value for entity alarmTime:
427
-
```markdown
428
-
# DeleteAlarm
429
-
- delete the {alarmTime=7AM} alarm
424
+
@ list listCity
425
+
@ prebuilt number
426
+
@ prebuilt geographyV2
427
+
@ regex regexZipcode = /[0-9]{5}/
428
+
@ ml address hasRoles fromAddress, toAddress
429
+
@ address =
430
+
- @ number 'door number'
431
+
- @ ml streetName
432
+
- @ ml location usesFeature geographyV2
433
+
- @ listCity city
434
+
- @ regexZipcode zipcode
430
435
```
431
436
432
-
**Notes:**
433
-
1. Any utterance without at least one labelled value will be treated as a pattern
434
-
2. Any entity without an explicit labelled value will default to a Pattern.Any entity type.
435
-
436
437
## Model description
437
438
You can include configuration information for your LUIS application or QnA Maker KB in the .lu file using this notation. This will help direct the parser to handle the LU content correctly -
0 commit comments