question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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>
/// <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>
/// <param name="recognizeOrdinals">(Optional) if true, the prompt will attempt to recognize the selected value using the choices themselves. The default value is "true".</param>

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, @EricDahlvang suggested to set recognizeOrdinals to false.

[enhancement]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
EricDahlvangcommented, Jan 8, 2020

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

0reactions
EdwinOttencommented, Jan 10, 2020

@EricDahlvang that’s great news! Thanks for making this happen 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with Prompts.choice: irrelevant string match if user ...
While prompting user a list of choices it allow user to either select ... ChoicePrompt handles irrelevant utterance as a choice because of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found