Add empty recognizer support for CrosstrainedRecognizer (composer scenario)#4144
Add empty recognizer support for CrosstrainedRecognizer (composer scenario)#4144
Conversation
|
@vishwacsena , I've synced with @feich-ms , here are two things need to confirm with you.
|
It might also be helpful to expose and use a |
| throw new ArgumentNullException(nameof(activity)); | ||
| } | ||
|
|
||
| if (Recognizers.Count() == 0) |
There was a problem hiding this comment.
.Count() == 0 [](start = 27, length = 13)
.Any() == false is more efficient.
@vishwacsena yes, qnamaker:build already did like this. I think the requirement from @luhan2017 is that, for empty lu and qna file, bf-cli should generate empty CrossTrainedRecognizerSet file like below: Currently, for empty lu or qna file, bf-cli will throw exceptions when pasing empty content here https://github.com/microsoft/botframework-cli/blob/master/packages/lu/src/parser/lu/luMerger.js#L514. So maybe we can adjust the logic to not throw exceptions and generate emtpy cross-trained recognizer but of course need validation from runtime. |
|
@luhan2017 @vishwacsena BF-CLI related changes are here microsoft/botframework-cli#870. Now for empty lu and qna files, luis:build and qnamaker:build will write out empty crosstrained recognizer instead of throwing exceptions. Please note that only empty crosstrained recognizer will be generated, single recognizer and multiLanguage recogizer will not write out. |
Fixes #
Description
We plan to set default recognizer in composer as Luis+QnA CrosstrainedRecognizer.
And it will fit into different recognizer types by the .lu/.qna content.
Recognizer: "dialogname.lu.qna"
dialogname.lu.qna,dialog will be generated as the following rule:
.lu and .qna both not empty =>
.lu and .qna both empty =>
.lu empty =>
.qna empty =>
This change is to support the empty recognizer scenario in CrossTrainedRecognizer.
Specific Changes
Testing