Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 340cbe3

Browse files
Vishwac Sena KannanVishwac Sena Kannan
authored andcommitted
updates and re-organizing content
1 parent fe1849f commit 340cbe3

File tree

1 file changed

+38
-37
lines changed

1 file changed

+38
-37
lines changed

packages/luis/docs/lu-file-format.md

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ See [here](./qna-file-format.md) to learn more about the .qna file format.
1313
- [Composite entity](#Composite-entity)
1414
- [Regex entity](#Regex-entity)
1515
- [Roles](#Roles)
16+
- [Patterns](#Patterns)
1617
- [Phrase lists features](#Phrase-list-definition)
1718
- [Model as a feature](#Model-as-feature)
1819
- [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)
2021
- [Model description](#Model-description)
2122
- [References](#External-references)
2223

@@ -102,7 +103,7 @@ Here's an example:
102103
@ ml 'this is a simple entity' hasRoles role1, role2
103104
```
104105

105-
## Machine learned entity
106+
### Machine learned entity
106107

107108
```markdown
108109
@ ml name firstName, lastName
@@ -117,7 +118,7 @@ Here's an example:
117118
> Without an explicit entity definition, 'userName' defaults to 'ml' entity type.
118119
```
119120

120-
## Prebuilt entity
121+
### Prebuilt entity
121122

122123
The following LUIS prebuilt entity types are supported -
123124
- age
@@ -145,7 +146,7 @@ The following LUIS prebuilt entity types are supported -
145146

146147
**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.
147148

148-
## List entity
149+
### List entity
149150

150151
```markdown
151152
@ list color favColor, screenColor
@@ -165,7 +166,7 @@ The following LUIS prebuilt entity types are supported -
165166

166167
**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.
167168

168-
## Composite entity
169+
### Composite entity
169170

170171
```markdown
171172
@ composite deviceTemperature from, to
@@ -204,7 +205,7 @@ Example definition:
204205
@ prebuilt temperature
205206
```
206207

207-
## Regex entity
208+
### Regex entity
208209

209210
```markdown
210211
@ regex hrf-number from, to
@@ -214,24 +215,8 @@ Example definition:
214215
@ regex hrf-number from, to = /hrf-[0-9]{6}/
215216
```
216217

217-
## Machine learned entity with n-depth support
218218

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
235220

236221
Roles](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-concept-roles) are named, contextual subtypes of an entity.
237222

@@ -305,6 +290,23 @@ $city:Portland=
305290
- Portland
306291
- PDX
307292
```
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.
308310

309311
## Phrase list definition
310312

@@ -414,25 +416,24 @@ Here's how you define phrase list as a feature to another model
414416
- @ ml city usesFeture PLCity
415417
- @ regexZipcode zipcode
416418
```
419+
## Machine learned entity with children
417420

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.
420422

421-
As an example, this would be treated as a pattern with alarmTime set as a Pattern.Any entity type:
422423
```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
430435
```
431436

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-
436437
## Model description
437438
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 -
438439

0 commit comments

Comments
 (0)