Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accuracy of MS System.Speech.Recognizer and the SpeechRecognitionEngine

I am currently testing the SpeechRecognitionEngine by loading from an xml file a pretty simple rule. In fact it is a simple between ("decrypt the email", "remove encryption") or ("encrypt the email", "add encryption").

I have trained my Windows 7 PC and additionally added the words encrypt and decrypt as I realize they are very similar. The recognizer already has a problem with making a difference between these two.

The issue I am having is that it recognizes things too often. I have set the confidence to 0.93 because with my voice in a quiet room when saying the exact words sometimes only gets to 0.93. But then if I turn on the radio the voice of the announcer or a song can mean that this recognizer thinks it has heard with over 0.93 confidence with words "decrpyt the email".

Maybe Lady Gaga is backmasking Applause to secretly decrypt emails :-)

Can anyone help in working out how to do something to make this recognizer workable.

In fact the recognizer is also picking up keyboard noise as "decrypt the email". I don't understand how this is possible.

Further to my editing buddy there are at least two managed namespaces for MS Speech Microsoft.Speech and System.Speech - It is important for this question that it be know that it is System.Speech.

like image 799
darbid Avatar asked Sep 16 '13 06:09

darbid


People also ask

How accurate is Microsoft dictate?

If you're a subscriber, Microsoft's 365 transcription feature can help you transcribe audio, but its accuracy falls short. Users will see an average word error rate (WER) of 16.51%.

How can you improve the accuracy of speech recognition?

Eliminate echoes and noises. Another measure that may improve your computer's voice-recognition accuracy is to eliminate background noise by installing carpeting, tapestries, or soundproofing material to reduce sounds and noises that might interfere with your computer's ability to understand you.

What is a recognizer in speech recognition?

The Recognizer Class. All of the magic in SpeechRecognition happens with the Recognizer class. The primary purpose of a Recognizer instance is, of course, to recognize speech. Each instance comes with a variety of settings and functionality for recognizing speech from an audio source.

How do you use a speech recognizer?

Enter speech recognition in the search box, and then tap or click Windows Speech Recognition. Say "start listening," or tap or click the microphone button to start the listening mode. Open the app you want to use, or select the text box you want to dictate text into. Say the text you want to dictate.


1 Answers

If the only thing the System.Speech recognizer is listening for is "encrypt the email", then the recognizer will generate lots of false positives. (Particularly in a noisy environment.) If you add a DictationGrammar (particularly a pronunciation grammar) in parallel, the DictationGrammar will pick up the noise, and you can check the (e.g.) name of the grammar in the event handler to discard the bogus recognitions.

A (subset) example:

    static void Main(string[] args)
    {
        Choices gb = new Choices();
        gb.Add("encrypt the document");
        gb.Add("decrypt the document");
        Grammar commands = new Grammar(gb);
        commands.Name = "commands";
        DictationGrammar dg = new DictationGrammar("grammar:dictation#pronunciation");
        dg.Name = "Random";
        using (SpeechRecognitionEngine recoEngine = new SpeechRecognitionEngine(new CultureInfo("en-US")))
        {
        recoEngine.SetInputToDefaultAudioDevice();
        recoEngine.LoadGrammar(commands);
        recoEngine.LoadGrammar(dg);
        recoEngine.RecognizeCompleted += recoEngine_RecognizeCompleted;
        recoEngine.RecognizeAsync();

        System.Console.ReadKey(true);
        recoEngine.RecognizeAsyncStop();
        }
    }

    static void recoEngine_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e)
    {
        if (e.Result.Grammar.Name != "Random")
        {
            System.Console.WriteLine(e.Result.Text);
        }
    }
like image 129
Eric Brown Avatar answered Sep 30 '22 19:09

Eric Brown