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

Commit eee32f8

Browse files
vishwacsenamunozemilio
authored andcommitted
Doc updates (#268)
1 parent d21ffc9 commit eee32f8

File tree

9 files changed

+92
-80
lines changed

9 files changed

+92
-80
lines changed

packages/lu/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
* [`lu file format`](./docs/lu-file-format.md)
1212
* [`QnA file format`](./docs/qna-file-format.md)
1313

14+
# Additional documentation
15+
* [Working with LUIS](./working-with-luis.md)
16+
* [Working with QnA Maker](./working-with-qna.md)
17+
* [Machine translating .lu/ .qna files](./translate-command.md)
18+
* [@microsoft/bf-lu as a library](./use-as-library.md)
19+
1420
# Commands
1521
<!-- commands -->
1622
* [`bf luis`](#bf-luis)

packages/lu/docs/create-luis-json.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You can add comments to your .lu document by prefixing the comment with >. Here'
3535
```
3636
```
3737

38-
Here's an example of question and answer definitions. The LUDown tool will automatically separate question and answers into a qnamaker JSON file that you can then use to create your new [QnaMaker.ai](http://qnamaker.ai) knowledge base article.
38+
Here's an example of question and answer definitions. The bf qnamaker:convert command will automatically separate question and answers into a qnamaker JSON file that you can then use to create your new [QnaMaker.ai](http://qnamaker.ai) knowledge base article.
3939

4040
```markdown
4141
> # QnA Definitions
@@ -113,7 +113,7 @@ $botframework : qna-alterations=
113113
```
114114

115115
## QnA Maker pdf file ingestion
116-
QnA Maker also supports ingesting pdf files during KB creation. You can add files for QnA maker to ingest using the URL reference scheme. If the URI's content-type is not text/html, then the ludown parser will add it to files collection for QnA Maker to ingest.
116+
QnA Maker also supports ingesting pdf files during KB creation. You can add files for QnA maker to ingest using the URL reference scheme. If the URI's content-type is not text/html, then the parser will add it to files collection for QnA Maker to ingest.
117117

118118
```markdown
119119
[SurfaceManual.pdf](https://download.microsoft.com/download/2/9/B/29B20383-302C-4517-A006-B0186F04BE28/surface-pro-4-user-guide-EN.pdf)
@@ -131,7 +131,7 @@ You can include configuration information for your LUIS application or QnA Maker
131131
**Note** Any information explicitly passed in via CLI arguments will override information in the .qna file.
132132

133133
```markdown
134-
> Parser instruction - this is optional; unless specified, ludown will default to the latest version.
134+
> Parser instruction - this is optional; unless specified, parser will default to the latest version.
135135
> !# @version = 1.0
136136

137137
> QnA Maker KB description

packages/lu/docs/refresh-command.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/lu/docs/translate-command.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ Often times you might want to target a multi-lingual bot. You can of course use
33

44
In other cases, you might want to manage the translation and localization for the language understanding content for your bot independently.
55

6-
Translate command in the ludown CLI takes advantage of the [Microsoft text translation API](https://docs.microsoft.com/en-us/azure/cognitive-services/translator/) to automatically machine translate .lu files to one or more than [60+ languages](https://aka.ms/translate-langs) supported by the Microsoft text translation cognitive service.
6+
Translate command in the @microsoft/bf-lu library takes advantage of the [Microsoft text translation API](https://docs.microsoft.com/en-us/azure/cognitive-services/translator/) to automatically machine translate .lu files to one or more than [60+ languages](https://aka.ms/translate-langs) supported by the Microsoft text translation cognitive service.
77

88
You can learn more about language x locale support for [LUIS.ai](https://www.luis.ai/) [here](https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/luis-supported-languages) and [qnamaker.ai](https://www.qnamaker.ai/) [here](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/overview/languages-supported)
99

1010
## What is translated?
11-
With the ludown translate command you can translate:
12-
- An .lu file and optionally translate
11+
- An .lu (or .qna) file and optionally translate
1312
- Comments in the lu file
1413
- LU and QnA reference link texts
15-
- List of .lu files under a specific path.
14+
- List of .lu/ .qna files under a specific path.
1615

17-
When translating .lu file,
16+
When translating .lu/ .qna file,
1817
- [Intents](docs/lu-file-format.md#intent) are not translated
1918
- [Entity](docs/lu-file-format.md#entity) names are not translated
2019

@@ -33,10 +32,10 @@ OPTIONS
3332
```
3433

3534
## Getting keys
36-
Ludown translate expects a Machine translation subscription key. You can obtain one [here](https://aka.ms/translate-key)
35+
luis:translate command expects a Machine translation subscription key. You can obtain one [here](https://aka.ms/translate-key)
3736

3837
## Generating LUIS models from translated lu files
39-
You can follow instructions [here](https://aka.ms/translate-langs) to create LUIS models from lu files using ludown translate command.
38+
You can follow instructions [here](./working-with-luis.md) to create LUIS models from lu files generated via luis:translate command.
4039

4140
**Note**: You need to explicitly provide the correct [LUIS lang code](https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/luis-supported-languages) to the bf luis:translate command.
4241

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Ludown as a library
2-
Ludown can be used within a Node.js application as an imported library. Install locally:
1+
# Consuming @microsoft/bf-lu as a library
2+
@microsoft/bf-lu can be used within a Node.js application as an imported library. Install locally:
33

44
```bash
5-
npm install @microsoft/bf-luis --save
5+
npm install @microsoft/bf-lu --save
66
```
77

88
## Parsing lu files
99
To parse LU files, you can use the parseFile() method.
1010

1111
```js
12-
const ludown = require('ludown');
12+
const ludown = require('@microsoft/bf-lu');
1313
const luContent1 = `# Greeting
1414
- hi`;
1515
const log = false;
@@ -19,7 +19,7 @@ ludown.parser.parseFile(luContent1, log, locale)
1919
// Parsed LUIS object
2020
console.log(JSON.stringify(parsedContent.LUISJsonStructure, 2, null));
2121
// Parsed QnA content
22-
console.log(JSON.stringify(parsedContent.additionalFilesToParse, 2, null));
22+
console.log(JSON.stringify(parsedContent.qnaJsonStructure, 2, null));
2323
// Additional files to parse
2424
console.log(JSON.stringify(parsedContent.additionalFilesToParse, 2, null));
2525
})
@@ -40,7 +40,7 @@ ludown.parser.parseFile(luContent1, log, locale)
4040
You can use the available validateLUISBlob() function to verify if the parsed LUIS blob is valid. This helps catch name conflicts, invalid labelled utterances etc.
4141

4242
```js
43-
const ludown = require('ludown');
43+
const ludown = require('@microsoft/bf-lu');
4444
const luContent = `# Greeting
4545
- hi {userName=bob}
4646
$userName:first=
@@ -79,8 +79,7 @@ parseContent();
7979
You can generate lu content from LUIS and QnA maker JSON using constructMdFromLUIS() and constructMdFromQnA() methods. Here's an example code snippet.
8080

8181
```js
82-
#!/usr/bin/env node
83-
const ludown = require('ludown');
82+
const ludown = require('@microsoft/bf-lu')
8483
const luContent = `# Greeting
8584
- hi
8685
$userName:first=
@@ -128,7 +127,7 @@ You can take advantage of the [Microsoft text translation API](https://docs.micr
128127
To translate lu file content, you can simply use the parseAndTranslate() method. Here's a code snippet.
129128

130129
```js
131-
const ludown = require('ludown');
130+
const ludown = require('@microsoft/bf-lu');
132131
const luContent = `# Greeting
133132
- hi
134133
$userName:first=
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Creating LUIS JSON model file
2+
3+
Once you have created individual .lu files you can parse them all to a LUIS JSON model using this command:
4+
```bash
5+
> bf luis:convert --in <folder with .lu files> --out <outputfolder> --name <luisAppName> --culture <luisAppCulture>]
6+
```
7+
8+
This will parse all .lu files found and will create **ONE** LUIS JSON model.
9+
10+
If you would like to create multiple luis apps, then you can add a [root.lu file](./lu-file-format.md#External-references) that holds reference to other relevant .lu files and parse it like this:
11+
12+
```bash
13+
> bf luis:convert --in <root_file.lu> [--out <outputFolder> --name <luisAppName> --culture <luisAppCulture>]
14+
```
15+
16+
This will parse all .lu files referenced in the root_file.lu and output **ONE** LUIS JSON model.
17+
18+
# Creating a New LUIS App
19+
## Pre-requisite
20+
- Install the luis-apis CLI via the following command
21+
22+
```bash
23+
> npm i -g luis-apis
24+
```
25+
26+
## using command line
27+
You can use the new LUIS JSON file to create a new LUIS application using this command.
28+
```bash
29+
luis import application --in _LUISApp.json --authoringKey "" --endpoint ""
30+
```
31+
Note: If you are using LUIS CLI, you might see the option to provide a versionId, application name directly in the LUIS CLI. You can also provide this information directly in the [.lu file format](./lu-file-format.md#Model-description). Information explicitly specified in the LUIS CLI will override any information captured by bf luis:convert command.
32+
33+
## using [LUIS](http://luis.ai) portal
34+
- Navigate to [LUIS](http://luis.ai)
35+
- Sign in
36+
- Click on My apps
37+
- "Import new App"
38+
- Choose file -> select the _LUISApp.json generated by bf luis:convert command
39+
40+
# Refresh command
41+
After you have bootstrapped and created your LUIS model and / or QnAMaker knowledge base, you might make subsequent refinements to your models directly from [luis.ai](https://luis.ai/) or [qnamaker.ai](https://qnamaker.ai). You can use the refresh command to re-generate .lu files from your LUIS JSON and / or QnAMaker JSON files.
42+
43+
```
44+
>bf luis:convert or bf qnamaker:convert
45+
46+
Usage: bf luis:convert --in <LUISJsonFile> or bf qnamaker:convert --in <QnAJSONFile>
47+
48+
```
49+
50+
# Exporting LUIS model (for bf luis:convert)
51+
## Using CLI
52+
```bash
53+
luis export version --appId <string> --versionId <string> --authoringKey <key>
54+
```
55+
## using [LUIS](http://luis.ai) portal
56+
- Navigate to [LUIS](http://luis.ai)
57+
- Sign in
58+
- Click on My apps
59+
- Find the app you wish to download, click "..." -> Export app
60+
61+
# Exporting QnA Maker
62+
## using CLI
63+
```bash
64+
bf qnamaker:export:kb --kbId <kbId> --environment <string>
65+
```
66+
67+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ If you would like to create multiple QnA Maker KB's, then you can add a [root.lu
1616
This will parse all .lu files referenced in the root_file.lu and output **ONE** QnA Maker JSON model.
1717

1818
# Creating word alterations/ synonyms list
19-
You can use ludown to parse and compile all word alterations/ synonyms list that can then be used to replace your existing [QnA Maker alterations](https://westus.dev.cognitive.microsoft.com/docs/services/5a93fcf85b4ccd136866eb37/operations/5ac266295b4ccd1554da75fd) list.
19+
You can use bf qnamaker:convert to parse and compile all word alterations/ synonyms list that can then be used to replace your existing [QnA Maker alterations](https://westus.dev.cognitive.microsoft.com/docs/services/5a93fcf85b4ccd136866eb37/operations/5ac266295b4ccd1554da75fd) list.
2020

2121
See [here](lu-file-format.md#QnA-Maker-alterations) for defining word alterations/ synonyms list in .lu files.
2222

packages/lu/test/fixtures/examples/all.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> ludown can also parse .md files as well!
1+
> parser can handle .md files as well!
22
33
# Greeting
44
- Hi

0 commit comments

Comments
 (0)