How do I detect incorrect responses from a grammar?

Last reviewed: 1/25/2011

HOW Article ID: H011101

The information in this article applies to:

  • GrammarKit 3
  • SpeechKit 6

Summary

Wildcard or garbage words can be used in grammars to detect incorrect responses in addition to false recognition events.

More Information

Grammar-based recognition is about matching speech to a list of choices.

Most recognizers support throwing false recognition (CCSRFalseRecognition) events indicating that the recognizer confidence level was not high enough to return a result.

However, if your grammar rules are comprised of short phrases or single word choices, it is likely that a misrecognition can occur and an incorrect match is returned. To avoid these, wildcards or garbage words can be added to your choices to catch exact matches.

Consider the following L&H BNF grammar:


#BNF+EM V1.0;
!grammar colors;
!start <colors>;
// list of color choices
<colors>: red | blue | green | <...>;

and the following Microsoft SAPI 5 XML grammar:


<grammar langid="409">
<rule toplevel="active" name="colors">
<!--  list of color choices --> 
<l>
<p>red</p> 
<p>blue</p> 
<p>green</p> 
<p><wildcard /></p> 
</l>
</rule>
</grammar>

If there is not enough confidence for a match to red, blue, or green, but the recognizer does recognize speech, then wildcard or garbage word is returned.

Microsoft SAPI 5 Recognizer returns ... (ellipses) for wildcard matches. VoCon 3200 returns the garbage word <...>.