Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 720
Kaan Avatar asked Mar 30 '11 16:03

Kaan


2 Answers

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 i.e. the wrong word between two similar sounding words.

This simplified example i.e. 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);
like image 90
BrokenGlass Avatar answered Oct 13 '22 12:10

BrokenGlass


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.

like image 21
cloudraven Avatar answered Oct 13 '22 12:10

cloudraven