none
Speech Recognition: Refuse words/phrases which doesn't fit RRS feed

  • Question

  •  

    hello guys,

    i've got the problem that, i doesn't know how to write my application that it only recognizes word of a specific list.

    For example - in the list are the words "show picture" or "show sky". If i talked infront of the kinect and we don't say any words of the list - always happens that some words of the list will recognized, although we didn't say any words of the list. In fact we need a "filter" that refused ALL words besides the words on the list. So you must say exactly the word from the list.

    Here is a part of the code how i write it - of course i build a grammar and so on - how it is described in the user guide. I thought if i take the Reject Handler - he reject all words he doesn't know and all it's fine.

     

                // Handler für SpeechRecognized events registrieren
                sre.SpeechRecognized += sre_SpeechRecognized;
                sre.SpeechRecognitionRejected += sre_SpeechRecognitionRejected;
                sre.SetInputToDefaultAudioDevice();
                sre.RecognizeAsync(RecognizeMode.Multiple);
    
           }
    
            #region SpeechRecognizer Eventhandler
            // Simple handler for the SpeechRecognized event.
            void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
            {
                Console.WriteLine("Recognized text: " + e.Result.Text);
    
            }
    
            // Simple handler for the sre_SpeechRecognitionRejected event.
            static void sre_SpeechRecognitionRejected(object sender, SpeechRecognitionRejectedEventArgs e)
            {
                Console.WriteLine(Types.getValueOfList(Types.notifies, "falseCmd"));
            }
    

    EDIT: damned! A forgot to add "if (source.SoundSourcePositionConfidence > 0.9)" - I will proof it with this :)

    EDIT2: this is only for the sound position - right? i need something like that for the speech
    • Edited by vershizzle Monday, January 9, 2012 4:12 PM
    Monday, January 9, 2012 3:42 PM

Answers

  • In the sre_SpeechRecognized event, you want to add:

    if (e.Result.Confidence >= SomeConfidenceTreshold)
     
       Console.WriteLine("Recognized text: " + e.Result.Text);
    

    The RTM version will have some improvements in the Confidence classifier which will work better than the Beta 2 one.

    Hopefully, with that, you don't need to add random words to make it all work.

    Hope this helps.

    Mauro.


    Mauro. - hope this helps -
    Thursday, January 12, 2012 3:52 AM

All replies

  • Confidence is (I think) e.Result.Confidence

    The only way I've found to get the voice stuff working right is to add a bunch of phrase to the grammar that are ignored in code. The Kinect will grab the closest phrase to what it heard, so give it enough choices that it can pick something that doesn't do anything.

    Monday, January 9, 2012 6:13 PM
  • hmm - i don't understand how you mean that - can you make an example?
    Monday, January 9, 2012 7:11 PM
  • after you add the phrases you care about, add completely random phrases, and phrases that are like phrases you care about. In the Speech Recognized function, add a line like "if(e.Result != "show picture" && e.Result != "show picture") { return; }

    (I packaged all this inside a class to make things easier. Also allows for different confidence levels for different phrases. It's work code, so I can't post it.)

    Monday, January 9, 2012 9:26 PM
  • Okay no i understand!

    Thank You!

    I'll give it a try later :)

    Tuesday, January 10, 2012 7:23 AM
  • In the sre_SpeechRecognized event, you want to add:

    if (e.Result.Confidence >= SomeConfidenceTreshold)
     
       Console.WriteLine("Recognized text: " + e.Result.Text);
    

    The RTM version will have some improvements in the Confidence classifier which will work better than the Beta 2 one.

    Hopefully, with that, you don't need to add random words to make it all work.

    Hope this helps.

    Mauro.


    Mauro. - hope this helps -
    Thursday, January 12, 2012 3:52 AM