|
| 1 | +# `qnamaker:cross-train` |
| 2 | +Cross-train writes out updated .qna files that contain cross-trained `DeferToRecognizer` QnA pair. |
| 3 | + |
| 4 | +Cross-train is required to use the [CrossTrainedRecognizerSet][1] available as part of [adaptive dialogs][2] as well as if you are looking or CI/CD support for [Composer][3] generated bots. |
| 5 | + |
| 6 | +## What is cross-train? |
| 7 | +With [adaptive dialog][2], you now have the ability to author one or more [.qna file][5] file per dialog. Cross train command supports this by analyzing your cross-train configuration and does the following: |
| 8 | +- Automatically adds a `dialogName = <dialogName>` meta data filter to each QnA pair |
| 9 | +- Adds one or QnA pairs that pull utterances from .lu content (if any) with answer `intent=DeferToRecognizer_LUIS_DialogName`. |
| 10 | + |
| 11 | +Both these are necessary for cross-trained recognizer to work. |
| 12 | + |
| 13 | +<img src="./cross-train.png" /> |
| 14 | + |
| 15 | +In cases where you are taking advantage of [CrossTrainedRecognizerSet][1], cross train command also sets up a `_interruption` intent with cross trained uttrances for your interruptions. See [here][10] to learn more. |
| 16 | + |
| 17 | +## Usage |
| 18 | + |
| 19 | +```bash |
| 20 | +> bf qnamaker:cross-train --in <source .lu files> --out <output folder> --config <cross-train configuration> |
| 21 | +``` |
| 22 | + |
| 23 | +A cross-train configuration is necessary for the command to work. Here is an example cross-train configuration |
| 24 | + |
| 25 | +```jsonc |
| 26 | +{ |
| 27 | + // list each .lu file including variations per lang x locale. |
| 28 | + // Lang x locale is denoted using 4 letter code. e.g. it-it, fr-fr |
| 29 | + // Paths can either be absolute (full) paths or paths relative to this config file. |
| 30 | + "./RootDialog/RootDialog.lu": { |
| 31 | + // indicate if this is an .lu file for a root dialog. |
| 32 | + "rootDialog": true, |
| 33 | + // list of trigers within that dialog |
| 34 | + "triggers": { |
| 35 | + // Key is name of intent within the .lu file (in this case RootDialog.lu) |
| 36 | + // Value is the path to the child dialog's .lu file. |
| 37 | + "AddItem": "./AddToDoDialog/AddToDoDialog.lu", |
| 38 | + "DeleteItem": "./DeleteToDoDialog/DeleteToDoDialog.lu", |
| 39 | + "ViewItem": "./ViewToDoDialog/ViewToDoDialog.lu", |
| 40 | + "GetUserProfile": "./GetUserProfileDialog/GetUserProfileDialog.lu" |
| 41 | + } |
| 42 | + } |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +## Related commands |
| 47 | +You might find these additional commands relevant/ helpful - |
| 48 | + |
| 49 | +- [bf qnamaker:build][6] |
| 50 | +- [bf luis:cross-train][7] |
| 51 | +- [bf luis:build][8] |
| 52 | + |
| 53 | +[1]:https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-concept-adaptive-dialog-recognizers?view=azure-bot-service-4.0#cross-trained-recognizer-set |
| 54 | +[2]:https://aka.ms/adaptive-dialogs |
| 55 | +[3]:https://aka.ms/composer |
| 56 | +[4]:https://luis.ai |
| 57 | +[5]:https://aka.ms/qna-file-format |
| 58 | +[6]:./using-qnamaker-build.md |
| 59 | +[7]:../../luis/docs/using-cross-train-command.md |
| 60 | +[8]:../../luis/using-luis-build.md |
| 61 | +[10]:../../luis/docs/using-cross-train-command.md |
0 commit comments