While prompting user a list of choices it allow user to either select an option from the list or enter a text value. I know most convenient is to select from the given choices by tab or click on it but if user want to select same option by typing it manually then bot framework return wrong selected values.
See below example:
Screenshot from attached sample nodeJS application->

It is weird but what I observed is that if there is any number in the text entered and it doesn't completely matches the provided choices it selects the option at that position. For example I entered cockpit 4 expecting it will match with 3rd option in the list but it actually returns 4th option.
I consider it as bug as its behavior is not documented and is not working as expected.
I have also created a sample/demo app to show case this issue and since above screenshot is from same app you can try out the example I have mentioned.
Download project from below link:
Demo app at github
Demo app at onedrive
Demo app uploaded at above location
Expected bot return with the choice option matching string "cockpit 4"
Bot return the wrong choice and in fact it return the option at 4th position instead of matching the complete text entered i.e. "cockpit 4"
I already answered on StackOverflow (here), it is the normal behaviour and you can:
PromptRecognizers.findTopEntity(PromptRecognizers.recognizeChoices(utterance, choices, options));Thanks for you reply. Can you please help how can I disable the recognition of ordinals? FYI I am using Prompts.choice to display Choices to the user.
I will let a node.js specialist answer. @nwhitmont maybe?
Here is how I sorted it.
const builder = require('botbuilder');
builder.Prompts.customize(builder.PromptType.choice, new builder.PromptChoice({minScore: 0.5}));
builder.Prompts.choice(...);
In my case I wanted to avoid getting answers with low score of certainty, so the prompt choice would ask me again. But you can use the same method to change any PromptChoiceFeature like "recognizeOrdinals"
@nsantini I've tried yours and it worked for me. Thanks so much!!! 馃憤
Hi,
Can u help me in how to disable the recognition ordinal bcz the solution provided by @nsantini is not working for me.
The issue i am asking is , the prompt choice button (Yes|No) , sometimes when Yes is clicked its giving the correct response and sometimes its giving the other response
@vishmonne
Hi there,
If you want the answer to match exactly "yes" or "no", you should adjust minScore is 1, just like this:
const builder = require('botbuilder');
builder.Prompts.customize(builder.PromptType.choice, new builder.PromptChoice({ minScore: 1 }));
builder.Prompts.choice(session, "your question...", "yes|no");
Hope this helps :)
hi @levotragiang i am giving the same thing above , still its like random , sometimes the bot goes to the function(session,results) and sometimes it goes to recognize the intent
@nrobert hi how to disable the recongnition of ordinal ?
@vishmonne
builder.Prompts.customize(builder.PromptType.choice, new builder.PromptChoice({ recognizeOrdinals: false }));
hi @EricDahlvang , i have given this is my code still the same problem exists, the prompt choice button is sometimes working and the other times its going to the default intent classifying ie its ending the dialog .
Can u help me with this ?
@vishmonne Please ask a question on StackOverflow using the BotFramework tag: https://stackoverflow.com/questions/tagged/botframework Be sure to provide the code you are using in the question.
hi all ,
can u help me out with this issue
Most helpful comment
Here is how I sorted it.
In my case I wanted to avoid getting answers with low score of certainty, so the prompt choice would ask me again. But you can use the same method to change any PromptChoiceFeature like "recognizeOrdinals"