-
Notifications
You must be signed in to change notification settings - Fork 123
bf luis:cross-training not working as expected when referencing external file which is in a folder above folder specified in the -i parameter #1171
Description
Versions
What CLI version are you using - 4.12.0
What Nodejs version are you using - 12.13.0
What command-line interpreters are you using - Windows Command Prompt
What OS are you using - Windows 10
Describe the bug
The issue is that if you have a .lu or .qna file which references an external file which is in a folder above the folder specified in the -i parameter or above the current folder when -i is the current folder (.) then the intent / utterances / qna question answer pair are not included in the cross trained .lu & .qna files.
This functionality works as expected when the external files are in or below the folder specified in -i parameter or the current folder when -i is the current folder (.)
To Reproduce
A repo to demonstrate the issue was created here: bf-luis-cross-train-issue
Starting in the directory root directory
Run the command: bf luis:cross-train -i Application -o application/cross-trained-sub-folder --config application/cross-train.config.json --force
This will output the files to ../Application/cross-trained-sub-folder
Notice that the utterances / QnA pairs from the external files which are referenced are not included.
Also the ExternalFile.lu & ExternalFile.qna files are not included in the application/cross-trained-sub-folder folder
To show what is the expected output:
Starting in the directory the root directory
Run the command: bf luis:cross-train -i . -o Application/cross-trained-root-folder --config Application/cross-train.config.json --force
This will output the files to ../Application/cross-trained-root-folder
Notice that the utterances / QnA pairs from the external files which are referenced are included
Also the ExternalFile.lu & ExternalFile.qna files are included in the application/cross-trained-sub-folder folder
Expected behavior
The output .lu & .qna files should include the intents / utterances / qna pairs when the external file referenced is not under the folder specified in -i
Screenshots
Output without External File intents / utterances / qna pairs


Expected Output with External File intents / utterances / qna pairs


Additional context
I am working on a project which will involve the creation of a series of bots. These bots will all use LUIS & some will use QnA Maker. These bots may share some intents / QnA Maker pairs.
We are working on creating a process which will allow our business team the ability to manage the utterances & QnA Maker pairs separate from the development team.
We would like to be able to have 1 main LUIS application & 1 main QnA Maker application. This will be managed through the LUIS / QnaMaker portals by the business team. From there the development team will create .lu & .qna files which filter the intents / QnA Maker pairs (using filters). Then our DevOps pipeline will manage the deployment of the application specific LUIS & QnA Maker applications which will only contain the filter items. During the DevOps process we need to cross-train the LUIS & QnA Maker applications.
An example folder structure for our LUIS / QnA Maker files would be:
- Main
- LUIS
- main.lu
- QnAMaker
- main.qna
- Application1
- application1.lu (will reference the file main.lu)
- application1.qna (will reference the file main.qna)
- Application2
- application2.lu (will reference the file main.lu)
- application2.qna (will reference the file main.qna)
- LUIS
We would like to be able to run bf luis:cross-train with -i Application1 or -i Application2 so that only the .lu & .qna files specific to that application will be written to the -o folder. This doesn't work though.
There is a workaround to run at the "Main" folder level & put the output in the correct location, though this results in all of the .lu & .qna files from all the Application# folders getting into the -o folder. Though this isn't a problem it results in clutter.
[bug]