Word Probability
Current Behavior
const didDetectSpeech = (possiblePhrases) => {
console.log(possiblePhrases);
};
annyang.addCallback('result', didDetectSpeech);
annyang.start({
continuous: false,
});
// Output: ['cat', 'mat', 'hat']
Possible Solution
Output changed to:
[
{
value: 'cat',
probability: '0.9'
},
{
value: 'mat',
probability: '0.8'
},
{
value: 'hat',
probability: '0.7'
},
]
Questions
- Does the speech recognition engine return a probability for a given word?
- Is there a way to limit the number of possible words handed back? E.g; top 5.
Is anyone working on this? I think it's a good idea and would like to pick this up
-
What is the use case? Why do you need this in your code? (it helps to plan a feature better, if we keep some use cases in mind).
-
I would prefer an API that does not break existing behavior like the one suggested above. There are a lot of people using this right now, and this might break their existing code.
Does the speech recognition engine return a probability for a given word?
Yes, it does.
Is there a way to limit the number of possible words handed back? E.g; top 5.
It is currently limited to 5. Do you see a need to allow the developer to change this?
Thanks 👍
Great 🎉
My use-case is around filtering out words which have a low probability, to make my application more reliable.
@TalAter I agree that the schema should be consistent. I can imagine two possible implementations:
- Release as a major version (v3.0.0) which follows the rules of semantic versioning.
- Add optional configuration to output verbose values. So the default output is still the same schema (an array of strings), but the verbose output will be an array of objects.
Thoughts?
Any update on this? Still want to implement this whether through an API or just through a new major version
You could return "possiblePhrases" array just as usual, but add index zero [0] with the dictionary with probabilities. There would be no conflicts with the words in the array, because they are always strings, even "0" is the string.
And in the major 3.0.0 you could break the current behavior, just as everyone else's library does.
On Mon, 16 Jan 2017 at 23:48, Daniel Epstein [email protected] wrote:
Any update on this? Still want to implement this whether through an API or just through a new major version
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/TalAter/annyang/issues/236#issuecomment-272958949, or mute the thread https://github.com/notifications/unsubscribe-auth/AB0iiNAB8vdmOA7lSJ-d0UJL5q_gJKNRks5rS9e6gaJpZM4Kv0kK .