botbuilder-js icon indicating copy to clipboard operation
botbuilder-js copied to clipboard

port: [#6434] Priority broken for RegexRecognizer (#6435)

Open github-actions[bot] opened this issue 3 years ago • 0 comments

The changes in [#6434] Priority broken for RegexRecognizer (#6435) may need to be ported to maintain parity with microsoft/botbuilder-dotnet.

Fixes #6434

Description

This PR updates the AdaptiveDialog's OnRecognizeAsync method to take into consideration the priority set for the intents when there is more than one result with the same score.

Specific Changes

  • Updated the OnRecognizeAsync method to choose the topIntent considering both score and priority.
  • Removed the break from the RecognizeAsync method to return all the intents that match the pattern.
  • Added a unit test to cover the priority scenario in RegexRecognizerTests.
  • Added test script RegexRecognizerTests_Priority.test.dialog

Testing

These images show the bot not recognizing the correct intent before and the bot returning the right intent according to its priority after the changes. image

Please review and, if necessary, port the changes.

github-actions[bot] avatar Aug 09 '22 14:08 github-actions[bot]