#236·annyang

Word Probability

Author: revettCreated Nov 11, 2016Updated Jan 16, 2017

Current Behavior

javascript
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.