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

Commit 66863e2

Browse files
author
Eyal
authored
Merge branch 'master' into esbfclimain
2 parents 9997b21 + 5746c9e commit 66863e2

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

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

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ The following LUIS prebuilt entity types are supported -
159159
- \<synonym1>, \<synonym2>, ...
160160

161161
> Alternate definition
162+
162163
@ list color favColor, screenColor =
163164
- \<normalized-value>
164165
- \<synonym1>; \<synonym2>; ...
@@ -188,6 +189,7 @@ Example definition:
188189
- Set {deviceTemperature = {customDevice = owen} to 72}
189190

190191
> Define a composite entity ‘deviceTemperature’ that has device (list entity), customDevice (ml entity), temperature (pre-built entity) as children
192+
191193
@ composite deviceTemperature = [device, customDevice, temperature]
192194

193195
@ list device =
@@ -212,6 +214,7 @@ Example definition:
212214
@ hrf-number = /hrf-[0-9]{6}/
213215

214216
> Alternate definition
217+
215218
@ regex hrf-number from, to = /hrf-[0-9]{6}/
216219
```
217220

@@ -234,16 +237,20 @@ Roles in .lu file format can be explicitly or implicity defined.
234237
Explicit definition follow the following notation - @ \<entityType> \<entityName> [hasRole[s]] role1, role2, ...
235238
```markdown
236239
> # ml entity definition with roles
240+
237241
@ ml name role1, role2
238242

239243
> this is the same as
244+
240245
@ ml name hasRoles role1, role2
241246

242247
> this is also the same as
248+
243249
@ ml name
244250
@ name hasRoles role1, role2
245251

246252
> Also same as
253+
247254
@ ml name
248255
@ name hasRole role1
249256
@ name hasRole role2
@@ -258,6 +265,7 @@ Implicit definition: You can refer to roles directly in patterns as well as in l
258265
- {userName=vishwac} is my name
259266

260267
> This definition is same as including an explicit defintion for userName with 'lastName', 'firstName' as roles
268+
261269
> @ ml userName hasRoles lastName, firstName
262270
```
263271

@@ -273,8 +281,9 @@ In patterns, you can use roles using the {\<entityName\>:\<roleName\>} notation.
273281
You can define multiple roles for an entity in patterns and the parser will do rest!
274282

275283
```markdown
276-
# BookFlight
277284
> roles can be specified for list entity types as well - in this case fromCity and toCity are added as roles to the 'city' list entity defined further below
285+
286+
# BookFlight
278287
- book flight from {city:fromCity} to {city:toCity}
279288
- [can you] get me a flight from {city:fromCity} to {city:toCity}
280289
- get me a flight to {city:toCity}
@@ -331,7 +340,7 @@ Here's an example of a phrase list definition:
331340
@ phraseList Want
332341
@ phraseList Want =
333342
- require, need, desire, know
334-
```
343+
335344

336345
> You can also break up the phrase list values into an actual list
337346

@@ -341,6 +350,7 @@ Here's an example of a phrase list definition:
341350
- desire
342351
- know
343352
```
353+
344354
By default synonyms are set to be **not interchangeable** (matches with the portal experience). You can optionally set the synonyms to be **interchangeable** as part of the definition. Here's an example:
345355

346356
```markdown
@@ -355,26 +365,33 @@ Here's how you add a feature to a ml entity or an intent - with `usesFeature`.
355365

356366
```markdown
357367
> entity definition - <> \<entityType> \<entityName> [<roles>]
368+
358369
@ prebuilt personName
359370
@ prebuilt age
360371

361372
> entity definition with roles
373+
362374
@ ml userName hasRoles fistName, lastName
363375

364376
> add entity as feature to another entity
377+
365378
@ userName usesFeature personName
366379

367380
> add entity as feature to intent
381+
368382
@ intent getUserNameIntent usesFeature personName
369383

370384
> Intent definition
385+
371386
# getUserNameIntent
372387
- utterances
373388

374389
> multiple entities as feature to a model
390+
375391
@ intent getUserNameIntent usesFeature age, personName
376392

377393
> intent as feature to another intent
394+
378395
@ intent getUserProfileIntent usesFeature getUserNameIntent
379396

380397
# getUserProfileIntent
@@ -393,21 +410,25 @@ Here's how you define phrase list as a feature to another model
393410

394411
```markdown
395412
> phrase list definition
413+
396414
@ phraseList PLCity(interchangeable) =
397415
- seattle
398416
- space needle
399417
- SEATAC
400418
- SEA
401419

402420
> phrase list as feature to intent (also applicable to entities)
421+
403422
@ intent getUserProfileIntent usesFeature PLCity
404423

405424
> phrase list as a feature to an ml entity.
425+
406426
@ ml myCity usesFeature PLCity
407427

408428
@ regex regexZipcode = /[0-9]{5}/
409429

410430
> phrase list as feature to n-depth entity with phrase list as a feature
431+
411432
@ ml address fromAddress, toAddress
412433
@ address =
413434
- @ number 'door number'
@@ -474,16 +495,20 @@ Here's an example of those references:
474495

475496
```markdown
476497
> You can include references to other .lu files
498+
477499
[All LU files](./all.lu)
478500

479501
> References to other files can have wildcards in them
502+
480503
[en-us](./en-us/*)
481504

482505
> References to other lu files can include sub-folders as well.
483506
> /** indicates to the parser to recursively look for .lu files in all subfolders as well.
507+
484508
[all LU files](../**)
485509

486510
> You can include deep references to intents defined in a .lu file in utterances
511+
487512
# None
488513
- [None uttearnces](./all.lu#Help)
489514

@@ -500,12 +525,14 @@ Here's an example of those references:
500525
> - [all.lu](./all.lu#*utterancesAndPatterns*)
501526

502527
> You can include wild cards with deep references to QnA maker questions defined in a .qna file in utterances
528+
503529
# None
504530
- [QnA questions](./*#?)
505531

506532
> With the above statement, the parser will parse **all** .lu files under ./, extract out all questions from QnA pairs in those files and add them under 'None' intent as defined in this file.
507533

508534
> You can include deep references to QnA maker questions defined in a .qna file in utterances
535+
509536
# None
510537
- [QnA questions](./qna1.qna#?)
511538

0 commit comments

Comments
 (0)