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

Comments

add id for generated recognizer and multiLang recognizer#858

Merged
feich-ms merged 2 commits intomasterfrom
feich/addIdInGeneratedDialogs
Jun 18, 2020
Merged

add id for generated recognizer and multiLang recognizer#858
feich-ms merged 2 commits intomasterfrom
feich/addIdInGeneratedDialogs

Conversation

@feich-ms
Copy link
Contributor

fix #853 to add id for generated recognizer and multiLang recognizer dialog files which are required in SDK when including luis and qnamaker cross-train.

Copy link
Contributor

@vishwacsena vishwacsena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we tried this E2E with a set of declarative files? I have the luis + qna bot sample that is code based. We should probably do a manual validation with a similar bot declaratively defined before we take this in.

@feich-ms
Copy link
Contributor Author

@vishwacsena, sure, I will work with zongyang @coldplaying42 to do manual tests in declarative bot.

@feich-ms
Copy link
Contributor Author

feich-ms commented Jun 16, 2020

@vishwacsena, I have tried to generate the dialog assets with id property and compare them with the hand-edited dialog files @coldplaying42 was using when he demo lu and qna cross-training of sandwich form bot. They are exactly same and can work with the runtime well.

@feich-ms feich-ms requested a review from chrimc62 June 16, 2020 10:22
@chrimc62
Copy link

chrimc62 commented Jun 16, 2020

I'm confused why this is necessary. By design the id of a top-level instance is the filename which is required to be globally unique. In fact, I believe dialog:verify will complain if a top-level id is present since that sets up a conflict between the filename and the id. The reason id exists is to name a $kind that is inside another one--and that is not what we have here since you are generating a top-level file.

Copy link

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@feich-ms
Copy link
Contributor Author

Hi @chrimc62, the id added by this PR is for CrossTrainedRecognizer to find the right recognizer when DefersToRecognizer_{Id} is the top intent for a user input. I went through the code here https://github.com/microsoft/botbuilder-dotnet/blob/master/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Recognizers/CrossTrainedRecognizerSet.cs#L99. It is using the LUIS_{fileName} and QnA_{fileName} to map the luis/qna recognizers into a dictionary. When DefersToRecognizer_{Id} is the top intent, it will get the {id} value and find the recognizer in the dictionary. If we only have luis recognizer, we can have filename as the id, but if we have both luis and qna recognizer, filename may not be globally unique.

If we don't use LUIS_{fileName} or QnA_{fileName} as recognizer id, we may need to make changes in both above runtime logic and luis/qnamaker:build cli. For example, we don't write out id in luis/qnamaker:build recognizers but instead we can add LUIS_ or 'QnA' prefix in runtime when loading recognizer files of luis and qna since we have $kind property and filename(a.lu.dialog vs a.qna.dialog) which can tell us this is luis or qna recognizers. @chrimc62 @vishwacsena, do you have any suggestions?

@chrimc62
Copy link

OK, we removed the old id so this is the right one.


In reply to: 645227009 [](ancestors = 645227009)

Copy link

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@feich-ms feich-ms merged commit 87e42ae into master Jun 18, 2020
@feich-ms feich-ms deleted the feich/addIdInGeneratedDialogs branch June 18, 2020 05:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For Cross-Train, require id property in both lu.dialog and qna.dialog files

3 participants