简体   繁体   中英

Improve Speech Recognition, C#

I use System.Speech library to able to recognize speech but it usually recognizes very different.

SpeechRecognizer_rec = new SpeechRecognizer();
DictationGrammar grammar = new DictationGrammar();

grammar.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(grammar_SpeechRecognized);
_rec.LoadGrammar(grammar);

How can I improve the recgonition? Does it have a relation with Grammer class?

You have to limit the model (basically the mapping from speech input to allowed English text output) used by the speech recognition engine to get high confidence output. The smaller your model is, the better your results will be in general, since there is less chance for the recognizer picking ie the wrong word between two similar sounding words.

This simplified example ie would only be able to recognize the numbers from one to three:

SpeechRecognizer rec = new SpeechRecognizer();
Choices c = new Choices();

c.Add("one");
c.Add("two");
c.Add("three");

var gb = new GrammarBuilder(c);
var g = new Grammar(gb);
rec.LoadGrammar(g);

If you can afford to ask users go to the training process that will certainly yield you much better results. I have used for myself (and I have an accent) and it improved significantly the accuracy of the recognition in my applications. At the very least you can try it yourself (Control Panel, Speech Recognition, Train your computer to better understand you). Really, training or reducing the model (or of course using your app in a quiet place with a better microphone) are the only ways to improve the accuracy of your results.

The DictationGrammar yields somehow weird results, I tried out different properties of the SpeechRecognitionEngine, barely successful. Try out: SpeechRecognitionEngine.BabbleTimeOut But read about usage first to prevent Errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM