2020-12-27 23:39

ChoicePrompt handles irrelevant utterance as a choice because of ordinals/numbers

Is your feature request related to a problem? Please describe. If the user ignores the buttons of a ChoicePrompt and asks another (totally different) question, the bot may recognizes ordinals/numbers in the utterance and handles that as if the user made a choice. This causes problems for me in multiple cases: 1. When the utterance contains a number (which is irrelevant if the user changes subject) 2. When the utterance contains the Dutch word een, which translates to one or a depending on the context. Imagine a user saying i want to talk to a human, and the bot handles a as option 1.

Describe the solution you'd like I'd like to disable part of the logic in ChoiceRecognizers so it won't recognize choices based on ordinals/numbers. This option could be added to FindChoicesOptions.

The V3 .NET SDK offered ChoiceOptions, which allowed us to disable these features (source).

/// <param name="recognizeChoices">(Optional) if true, the prompt will attempt to recognize numbers in the users utterance as the index of the choice to return. The default value is "true".
/// <param name="recognizeNumbers">(Optional) if true, the prompt will attempt to recognize ordinals like "the first one" or "the second one" as the index of the choice to return. The default value is "true".
/// <param name="recognizeOrdinals">(Optional) if true, the prompt will attempt to recognize the selected value using the choices themselves. The default value is "true".

Otherwise, I'd like to supply my own implementation of ChoiceRecognizers to the ChoicePrompt.

Describe alternatives you've considered I have considered implementing my own ChoicePrompt and use some custom logic instead of ChoiceRecognizers to recognize choices.

Additional context In V3 someone had a similar issue because the titles of his Choice buttons contained numbers. Back then, suggested to set recognizeOrdinals to false.



  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • weixin_39537397 weixin_39537397 4月前

    can you take a peek at this? Is there anything we can do?

    点赞 评论 复制链接分享
  • weixin_39907850 weixin_39907850 4月前

    Good suggestion. It seems reasonable to provide options to disable ordinal recognition in https://github.com/microsoft/botbuilder-dotnet/blob/040cd5499fdadcc8a3a7088a7ee106bfbdde4339/libraries/Microsoft.Bot.Builder.Dialogs/Choices/FindChoicesOptions.cs

    点赞 评论 复制链接分享
  • weixin_39697660 weixin_39697660 4月前

    Thanks for the suggestion, I am tagging this issue so we can reconsider it in our next iteration.

    点赞 评论 复制链接分享
  • weixin_39778106 weixin_39778106 4月前

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

    点赞 评论 复制链接分享
  • weixin_39907850 weixin_39907850 4月前

    FindChoicesOptions now has RecognizeOrdinals and RecognizeNumbers options. This will be released with 4.8

    点赞 评论 复制链接分享
  • weixin_39538693 weixin_39538693 4月前

    that's great news! Thanks for making this happen 😃

    点赞 评论 复制链接分享