VoiceXML 2.1 Development GuideHome  |  Frameset Home

  Multislot GSL Grammars  |  TOC  |  External GSL Subgrammars  

GSL Grammar Weighting

Chances are, if you have spent time writing a grammar with moderate amounts of utterances, you will likely want to tweak your files for maximum accuracy. The best place to start is by logging utterance/confidence scores, (or even recording the entire call), to see what utterances your callers are using the most frequently, and what utterances are getting mis-recognized. From this, we can 'second guess' future callers' responses, and adjust our grammars accordingly.

Tweaking Grammar Weight

Unmodified grammar entries each have the same probability of a match, which works fine in some cases. But any grammar that is used in a 'real-world' application needs a scientific attention to this detail for maximum efficiency. With relative ease, we can override the default confidence score, (1.0), of a particular utterance, and assign it a specific likelihood of a match. Let's take a simple test case, where we have a grammar that has a smidge of ambiguity that expects utterances that sound marginally similar. Our test application is attempting to discern the caller's preference for bad zombie movies:


ZOMBIE [
(dawn of the dead)                            {<Zombie "dawn">}
(day of the dead)                            {<Zombie "day">}
(night of the living dead)                    {<Zombie "night">}
(return of the living dead)                  {<Zombie "return">}
]





As we have but a few to choose from, and they are all somewhat similar in name, it's easy to see how we could get a few mis-recognitions. So, we add some inline grammar scores to skew the outcome in favor of statistics with the following command syntax:


RULENAME [
(utterance) ~.00                          {<slotname "interpretation">}
]


Pretty easy, eh? The only real things to keep in mind that a score of '.3', or '.30', means that there is a thirty percent chance that this will be the choice that a given user will select. A score of '.1' would probably be assigned to a less popular choice, and a score of '.9' would be the most likely choice within a particular grammar rule.

You can also add the Kleene and Positive closure operators to the grammar for an additional degree of tuning, as illustrated below:


  • Positive Closure Operator
  •   (+brains are yummy)
    The phrase following the '+' operator can be repeated numerous times and fire off the match. Thus, 'brains are yummy' and 'brains brains brains are yummy' will both be considered successful matches.

  • Kleene Closure Operator
  •   (*human brains are yummy)
    The phrase following the '*' can be repeated infinitely, or not at all. Thus, 'human brains are yummy' ,  or 'brains are yummy'  will all be considered successful matches.

    So, let's look at our sample file now that it's been modified for probability:


    ZOMBIE [
    (dawn of the dead) ~.40                    {<Zombie "dawn">}
    (day of the dead) ~.35                      {<Zombie "day">}
    (night of the ?living dead) ~.6            {<Zombie "night">}
    (return of the ?living dead) ~.15          {<Zombie "return">}
    (brains) ~.20                              {<Zombie "braaaaaaaaaains">}
    ]







      ANNOTATIONS: EXISTING POSTS
    0 posts - click the button below to add a note to this page

    login
      Multislot GSL Grammars  |  TOC  |  External GSL Subgrammars  

    © 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site