VoiceXML 2.1 Development Guide Home  |  Frameset Home


<item>  element


The item element defines a valid utterance match within an XML grammar. This element also allows repeats and probability weighting to be added to the utterance in question.


usage

<item repeat="NMTOKEN" repeat-prob="NMTOKEN" weight="NMTOKEN">


attributes

repeat Data Type: NMTOKEN Default: Optional
The repeat attribute is an SRGS addition to VWS2.0 that allows the developer to specify the number of times, if any, that the utterance is allowed to be repeated by the caller. The allowed formats for this attribute are as follows:

item repeat="3"                The utterance must be repeated 3 times
item repeat="2-4"              The utterance must be repeated 2 to 4 times
item repeat="2-"                The utterance must be repeated 2 or more times
item repeat="0-3"              The utterance is not required to be repeated, but can be repeated for up to 3 times
repeat-prob Data Type: NMTOKEN Default: Optional
The repeat-prob attribute allows the developer to specify a probability that an utterance will be repeated by the caller. The value should be a number ranging from '0.0', (least likely to be repeated), to '1.0', (most likely to be repeated).
weight Data Type: NMTOKEN Default: Optional
The weight attribute specifies the increased or decreased likelihood for a particular grammar match. For instance, specifying the value as '0.8' would increase the chances that an approximate utterance would be considered a valid grammar match, while a value of '0.2' would make it highly unlikely that a match would ever be considered valid. Note that the parent Item element must be enclosed by the One-Of element, else the grammar weighting is ignored.



shadow variables

none


parents

<item>   <one-of>   <rule>


children

<item>   <one-of>   <ruleref>   <tag>   <token>


code samples

<ItemWeightCode.vxml>
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>


<form id="F1">

  <field name="F_1">
    <prompt>
      What in gods name is that thing on James Trafficants head?
      Is it a marmot, a stabilizing fin or pile of goat vomit?
    </prompt>

    <grammar src="MyItemWeightGrammar.xml" type="application/grammar-xml"/>

    <filled>
      <prompt>
        Say, that guess is as good as any, I suppose.
    </prompt>

  </filled>

  </field>

</form>

</vxml>


<MyItemWeightGrammar.xml>
<?xml version= "1.0"?>

<grammar xmlns="http://www.w3.org/2001/06/grammar"
          xml:lang="en-US" root = "MYRULE">

  <rule id="MYRULE" scope="public">

    <one-of>
      <item> marmot
<tag> <![CDATA[  <F_1 "marmot">  ]]>  </tag>
      </item>

      <item weight="0.0"> goat vomit
<tag> <![CDATA[  <F_1 "goat vomit">  ]]>  </tag>
      </item>

    <item weight="1.0"> stabilizing fin
<tag> <![CDATA[  <F_1 "stabilizing fin">  ]]>  </tag>
    </item>
  </one-of>
    </rule>

</grammar>


<ItemRepeatProbCode.vxml>
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>


<form id="F1">

  <field name="F_1">
    <prompt>
      What was Marlon Brandos famous last line in the movie Apocalypse Now?
    </prompt>

    <grammar src="MyRepeatGram.xml" type="application/grammar-xml"/>

    <filled>

      <prompt>Yes, thats right. The horror.</prompt>

  </filled>

  </field>

  </form>

</vxml>


<MyRepeatGram.xml>
<?xml version= "1.0"?>

<grammar xmlns="http://www.w3.org/2001/06/grammar"
        xml:lang="en-US" root = "MYRULE">

<rule id="MYRULE" scope="public">

  <one-of lang-list="en-US">
<item repeat="0-2" repeat-prob="0.6">
          the horror
        </item>

<item repeat="2">

            nanoo
        </item>

<item repeat-prob="0.0" repeat="0-1">

            machines are gonna fail, lewis
        </item>
  </one-of>
  </rule>
</grammar>



additional links

W3C SRGS 1.0 Specification


  ANNOTATIONS: EXISTING POSTS
hstclair
8/24/2006 12:04 PM (EDT)
I suggest that you replace the text:

item repeat="3"                The utterance must be repeated 3 times
item repeat="2-4"              The utterance must be repeated 2 to 4 times
item repeat="2-"                The utterance must be repeated 2 or more times
item repeat="0-3"              The utterance is not required to be repeated, but can be repeated for up to 3 times

with:

item repeat="3"                The utterance must be spoken 3 times
item repeat="2-4"              The utterance must be spoken 2 to 4 times
item repeat="2-"                The utterance must be spoken 2 or more times
item repeat="0-3"              The utterance is not required, but may be spoken up to 3 times


Admittedly, it's a minor point but I think that it might help others down the road.  I remember experiencing some uncertainty about how to interpret the 'repeat' count and whether it could be used to make an item optional when I first read this page.

mikethompson
8/24/2006 1:09 PM (EDT)
Hey Hal,

I must admit, your rendition of the repeat="0-3" row is a bit more clear.  I will let our keepers of the doucmentation know about the ambiguity of the current statement.

Best,
Mike Thompson
Voxeo Corporation
mtatum111
10/8/2008 10:49 AM (EDT)
In preparing for my certification test, I have been presented the following practice question

1. Which grammar rule accepts the following input and produces the indicated output?  The answer here is C.  However, I was told that D will also work.  I am a little confused about D working because we have the following <item repeat = "0-1"> the </item>.  It was my understanding that when we have this and the caller speaks "the" then it will be returned as the text output.  Am I missing something here.  For instance, if the caller says "Raise the Volume" then according to D, I would have thought the text output would be "Raise the Volume" and not "Raise Volume"
Thanks for any input


Spoken Input Text Output
Raise volume Raise volume
Raise the volume Raise volume
Lower volume Lower volume
Lower the volume Lower volume
Raise air         Raise air
Raise the air Raise air
Lower air         Lower air
Lower the air Lower air

<rule id = "direction">
<one-of>
<item> Raise</item>
<item> Lower </item>
<one-of>
</rule>

<rule id = "control">
<one-of>
<item> volume</item>
<item> air </item>
<one-of>
</rule>

A. <rule id = "spoken_commands">
  <ruleref uri = "#direction"/>
  <ruleref uri = "#control"/>
            </rule>

B. <rule id = "spoken_commands">
  <ruleref uri = "#direction"/>
<item> the </item>
  <ruleref uri = "#control"/>
            </rule>
C. <rule id = "spoken_commands">
  <ruleref uri = "#direction"/>
<ruleref special = "GARBAGE"/>
  <ruleref uri = "#control"/>
            </rule>

D. <rule id = "spoken_commands">
  <ruleref uri = "#direction"/>
<item repeat = "0-1"> the </item>
  <ruleref uri = "#control"/>
            </rule>
VoxeoDustin
10/8/2008 10:53 AM (EDT)
Hey Melissa,

You are correct. In this instance, option D will return 'the' as part of the interpretation if it is spoken. The GARBAGE rule in C will not return any value in the interpretation.

Cheers,
Dustin
sreenivasan
3/10/2009 11:09 AM (EDT)
I wanted to have dynamic variable instead of hard coding the values, say we have <item repeat="1-4"/>. I want 1 and 4 to be variable.  But I am not able to find where I did to see if an answer was posted. Can you help please.
VoxeoDustin
3/10/2009 11:33 AM (EDT)
Hey Sreeni,

SRGS grammars do not allow for Javascript expressions, so in order to input these values dynamically, you will want to implement a bit of server-side scripting.

Something like this would do the trick:

<?php

$min-repeat = 1;
$max-repeat = 2;

?>

<item repeat="<?php echo $min-repeat . "-" . echo $max-repeat?>"> foobar </item>

Let me know if we can be of further assistance.

Cheers,
Dustin Hayre
Customer Support Engineer 2
Voxeo Support
sreenivasan
3/10/2009 1:28 PM (EDT)
Thanks, I will try this. Also, when you have a nomatch, is there a way to see what was the dtmf key that was pressed. Say for example, your grammar had valid inputs as 1 to 5. But if the user pressed * or 9, it is going to nomatch block. But can we log what was keyed?
sreenivasan
3/10/2009 1:40 PM (EDT)
Thanks, I will try this. Also, when you have a nomatch, is there a way to see what was the dtmf key that was pressed. Say for example, your grammar had valid inputs as 1 to 5. But if the user pressed * or 9, it is going to nomatch block. But can we log what was keyed?
sreenivasan
3/10/2009 1:49 PM (EDT)
The javascript for repeat variables works. Thanks.
shawnaslam1
6/2/2009 10:04 AM (EDT)
Hello,
I also don't want Item repeat value to be hard coded.
I am using field in the VXML where from I get the Alpha Numeric code from the Caller which can be of length 5 ,6 or 8.
I am writing the grammar to check what caller has input but now how I come to know in XML grammar document what length code user has entered or to how many time I should repeat the grammar.
Can't we know in the XML grammar document what user has input?

Please assist.



Regards,
Shawn
mikethompson
6/2/2009 11:44 AM (EDT)
Hi Shawn,

If you'd like to set your repeat values dynamically, you'll have to use server-side logic, as Dustin explained in his above post. Here's a bare bones example with some PHP:

<item repeat="<?php echo $min-repeat . "-" . echo $max-repeat?>"> foobar </item>

All you need to do is pass in the constraints you would like to use for repeat length (min and max) upon calling the grammar from your VoiceXML document.

<grammar src="http://www.yourweb-server.com/mygrammar.php?minimumRepeat=2&maximumRepeat=4" type="application/grammar-xml"/>

Grab these values from the querystring and assign them to $min-repeat and $max-repeat and you should be all set!

Hope this helps,
Mike Thompson
Voxeo Corporation
shawnaslam1
6/2/2009 1:46 PM (EDT)
If I use the server site in this case I have to send the min and max value.Caller has given input in the field now how we come to know that what length of input is this.below is the code
In the case when we are takling voice input we might not able to get that entereed data by using the field name (i am getting the undefine).Now if user enter 5 digit and max length is 8 grammar automatically filled that last 3 digit though I have put repeat check as 3-8.

<field name="EnteredCode"> 
            <prompt>
                  Please Enter your Alpha Numeric code
            </prompt>
         
            <grammar src="GetCodeGrammar.xml" type="application/grammar-xml" root="GetCode"/>
           
            <filled mode="any" >
                             
           
           
                              <var name="EnteredCodeLen" expr="lenOfStr(Code)"/>
                              <log expr="'Entered Code Length==='+ EnteredCodeLen"/>
           
                              <prompt>
                                    The Entered Code is
                              </prompt>
                             
                              <var name="arrayA3" expr="TTSArray(lastresult$.interpretation.alphaSlot1)"/>
                              <prompt bargein="false">
                                <foreach item="digitA3" array="arrayA3">
                                    <audio expr="tts(digitA3)">
                                            <break time="3000" />
                                            <break time="3000" />
                                    </audio>
                                </foreach>
                              </prompt>

                               
                                <prompt>                             
                                Thank you and good bye
                                </prompt>


Please advice!


Regards,
Shawn
jdyer
6/2/2009 4:47 PM (EDT)
Hello Shawn,

I do apologize but we are not exactly clear on your request here; It seems as if you are looking for a method of determining the length of an utterance and acting on that length.  Since this is what I believe you are looking for I have gone ahead and included a small example on how to do this below:

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<form id="F1">
  <var name="stringLength"/>

  <field name="MyField" type="digits?minlength=3">
    <prompt>
    Please input a numeric value from three to eight digits
    </prompt>

    <filled>

      <!-- This parses our return and assigns it to a variable -->  
      <assign name="stringLength" expr="MyField.length"/>
 
      <!-- Here we use if / else if to act on this return -->
      <if cond="stringLength == '3'">
        <log expr="'******* String Length ' + stringLength"/>  
      <elseif cond="stringLength =='4'"/>
        <log expr="'******* String Length ' + stringLength"/>
      <elseif cond="stringLength =='5'"/>
        <log expr="'******* String Length ' + stringLength"/>
      </if>
      </filled>
    </field>
  </form>
</vxml>


If this is not what you are looking for I do apologize.  If this is the case we will certainly be standing by for your response, and clarification, so we can help!

Regards,

John Dyer
Customer Engineer
Voxeo Support
shawnaslam1
6/3/2009 6:35 AM (EDT)

I am sorry If I didn't describe my problem correctly.
In your example you are taking only numeric input in which case surely we can get the length the way you described.

My question is I am getting the voice data and also using the grammar to cipher it. So I want to get the length of voice input given by the caller.

In case we cannot do I have any alternative because background of this is caller can entered max 8 digits but if caller has entered 5 then grammar add last 3 by its self means i get the wrong result.

Here is the code

<form id="F1">
<field name="EnteredCode"> 

    <grammar src="GetCodeGrammar.xml" type="application/grammar-xml" root="GetCode"/>
   
    <filled mode="all" >
        <!--===========================-->
<!--  Here How I get the length of the voice input  -->
        <assign name="Code" expr="EnteredCode.length"/>
        <log expr="'EnteredCode ==='+ Code"/>
        <!--===========================-->
       
        <var name="EnteredCodeLen" expr="lenOfStr(Code)"/>
        <log expr="'Entered Code Length==='+ EnteredCodeLen"/>
       
        <prompt>                             
            Thank you and good bye
        </prompt>
        <exit />
    </filled>
   
</field>
    </\form>


I hope it clears you my question.
voxeojeremyr
6/3/2009 9:06 AM (EDT)
Hi Shawn,

I think the real root of the issue is that the grammar is returning 8 characters when the caller only said 5.  Based on that explanation, there seems to be a problem with the grammar that you are using. 

It is worthy to note that alphanumerics is one of the hardest things for a Speech recognizer to successfully recognize because of the short utterances and the fact that many of the letters sounds alike, (p, b, v, c...etc).

If you would like to send us your grammar, we would be happy to take a look at it and recommend any changes.

Regards,
Jeremy Richmond
Voxeo Support
shawnaslam1
6/3/2009 9:42 AM (EDT)
Here is the grammar


<?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US">
   
    <rule id="GetCode" scope="public">
        <tag> out.alphaSlot1= "" </tag>                           
                <item repeat="3-8">
                            <ruleref uri="#alphaRule1"/>
                                <tag>out.alphaSlot1=out.alphaSlot1 + rules.alphaRule1.slot</tag>
                </item>
        </rule>
   
    <rule id="alphaRule1" scope="public">
       
            <item weight="1.0">
               
                <one-of>
                    <item> zero <tag> out.slot="0" </tag></item>
                    <item> one <tag> out.slot="1" </tag></item>
                    <item> two <tag> out.slot="2" </tag></item>
                    <item> three <tag> out.slot="3" </tag></item>
                    <item> four <tag> out.slot="4" </tag></item>
                    <item> five <tag> out.slot="5" </tag></item>
                    <item> six <tag> out.slot="6" </tag></item>
                    <item> seven <tag> out.slot="7" </tag></item>
                    <item> eight <tag> out.slot="8" </tag></item>
                    <item> nine <tag> out.slot="9" </tag></item>
                    <!--  For A Utterence  -->
                    <item> a <tag> out.slot="A" </tag></item>
                    <item> aa <tag> out.slot="A" </tag></item>
                    <item> aye <tag> out.slot="A" </tag></item>
                    <item> ay <tag> out.slot="A" </tag></item>
                    <item> ah <tag> out.slot="A" </tag></item>
                    <!--  For B Utterence  -->
                    <item> b <tag> out.slot="B" </tag></item>
                    <item> be <tag> out.slot="B" </tag></item>
                    <item> bee <tag> out.slot="B" </tag></item>
                    <item> beh <tag> out.slot="B" </tag></item>
                    <item> bea <tag> out.slot="B" </tag></item>                   
                    <!--  For C Utterence  -->
                    <item> c <tag> out.slot="C" </tag></item>
                    <item> ce <tag> out.slot="C" </tag></item>
                    <item> cee <tag> out.slot="C" </tag></item>
                    <item> sea <tag> out.slot="C" </tag></item>
                    <item> ceh <tag> out.slot="C" </tag></item>                   
                    <!--  For D Utterence  -->
                    <item> d <tag> out.slot="D" </tag></item>
                    <item> dee <tag> out.slot="D" </tag></item>
                    <item> de <tag> out.slot="D" </tag></item>
                    <item> dea <tag> out.slot="D" </tag></item>
                    <!--  For E Utterence  -->
                    <item> e <tag> out.slot="E" </tag></item>
                    <item> ee<tag> out.slot="E" </tag></item>
                    <item> eee <tag> out.slot="E" </tag></item>
                    <item> eeh <tag> out.slot="E" </tag></item>                 
                    <!--  For F Utterence  -->
                    <item> f <tag> out.slot="F" </tag></item>
                    <item> ef <tag> out.slot="F" </tag></item>
                    <item> eff <tag> out.slot="F" </tag></item>
                    <item> efh <tag> out.slot="F" </tag></item>   
                    <!-- ================= -->
                    <item> g <tag> out.slot="G" </tag></item>
                    <item> ge <tag> out.slot="G" </tag></item>
                    <item> gee <tag> out.slot="G" </tag></item>
                    <item> gea <tag> out.slot="G" </tag></item>
                    <!-- ================= -->
                    <item> h <tag> out.slot="H" </tag></item>
                    <item> eh <tag> out.slot="H" </tag></item>
                    <item> ahche <tag> out.slot="H" </tag></item>
                    <!-- ================= -->
                    <item> i <tag> out.slot="I" </tag></item>
                    <item> ie <tag> out.slot="I" </tag></item>
                    <item> iae <tag> out.slot="I" </tag></item>
                    <item> iye <tag> out.slot="I" </tag></item>
                    <item> eye <tag> out.slot="I" </tag></item>
                    <!-- ================= -->
                    <item> j <tag> out.slot="J" </tag></item>
                    <item> jay <tag> out.slot="J" </tag></item>
                    <item> jai <tag> out.slot="J" </tag></item>
                    <!-- ================= -->
                    <item> k <tag> out.slot="K" </tag></item>
                    <item> kay <tag> out.slot="K" </tag></item>
                    <item> kai <tag> out.slot="K" </tag></item>
                    <!-- ================= -->
                    <item> l <tag> out.slot="L" </tag></item>
                    <item> el <tag> out.slot="L" </tag></item>
                    <item> elh <tag> out.slot="L" </tag></item>
                    <!-- ================= -->
                    <item> m <tag> out.slot="M" </tag></item>
                    <item> emm <tag> out.slot="M" </tag></item>
                    <item> em <tag> out.slot="M" </tag></item>
                    <item> emh <tag> out.slot="M" </tag></item>
                    <!-- ================= -->
                    <item> n <tag> out.slot="N" </tag></item>
                    <item> en <tag> out.slot="N" </tag></item>
                    <item> enn <tag> out.slot="N" </tag></item>
                    <!-- ================= -->
                    <item> o <tag> out.slot="O" </tag></item>
                    <item> ohh <tag> out.slot="O" </tag></item>
                    <!-- ================= -->                   
                    <item> p <tag> out.slot="P" </tag></item>
                    <item> pee <tag> out.slot="P" </tag></item>
                    <item> pea <tag> out.slot="P" </tag></item>
                    <!-- ================= -->
                    <item> q <tag> out.slot="Q" </tag></item>
                    <item> queue <tag> out.slot="Q" </tag></item>
                    <item> qu <tag> out.slot="Q" </tag></item>
                    <!-- ================= -->
                    <item> r <tag> out.slot="R" </tag></item>
                    <item> arr <tag> out.slot="R" </tag></item>
                    <item> arh <tag> out.slot="R" </tag></item>
                    <!-- ================= -->
                    <item> s <tag> out.slot="S" </tag></item>
                    <item> ess <tag> out.slot="S" </tag></item>
                    <item> ese <tag> out.slot="S" </tag></item>
                    <!-- ================= -->
                    <item> t <tag> out.slot="T" </tag></item>
                    <item> tee <tag> out.slot="T" </tag></item>
                    <item> tea <tag> out.slot="T" </tag></item>
                    <item> teh <tag> out.slot="T" </tag></item>
                    <!-- ================= -->
                    <item> u <tag> out.slot="U" </tag></item>
                    <item> ueu <tag> out.slot="U" </tag></item>
                    <item> you <tag> out.slot="U" </tag></item>
                    <!-- ================= -->
                    <item> v <tag> out.slot="V" </tag></item>
                    <item> vee <tag> out.slot="V" </tag></item>
                    <item> vea <tag> out.slot="V" </tag></item>
                    <!-- ================= -->
                    <item> w <tag> out.slot="W" </tag></item>
                    <item> dubba u <tag> out.slot="W" </tag></item>
                    <item> double u <tag> out.slot="W" </tag></item>
                    <!-- ================= -->
                    <item> x <tag> out.slot="X" </tag></item>
                    <item> exe <tag> out.slot="X" </tag></item>
                    <item> exx <tag> out.slot="X" </tag></item>
                    <item> x ray <tag> out.slot="X" </tag></item>
                    <!-- ================= -->
                    <item> y <tag> out.slot="Y" </tag></item>
                    <item> why <tag> out.slot="Y" </tag></item>
                    <item> ye <tag> out.slot="Y" </tag></item>
                    <!-- ================= -->
                    <item> z <tag> out.slot="Z" </tag></item>
                    <item> zea <tag> out.slot="Z" </tag></item>
                    <item> zee <tag> out.slot="Z" </tag></item>
                    <item> zzz <tag> out.slot="Z" </tag></item>
                    <!-- ================= -->

                </one-of>
            </item>
    </rule>
</grammar>



is that confirm that we cannot get the length of voice input in the field tag?
Please reply me bit early as I need to report on this.
Thanks in advance!
Secondly if possible please
mikethompson
6/3/2009 12:31 PM (EDT)
Hello,

Thank you for providing us with your grammar.  I was able to do some testing against your grammar, and everything looks great on that front.  The structure is fine and returned several alpha-numeric combinations I tested.  In all cases, when I said a string of 5 characters, the returned result was 5 characters as well. 

The very important shadow variable I think you are overlooking is $.interpretation.  This will allow you to build access the complete slot return (ex: 00AJK), instead of the utterance "zero zero aa jay kay."  Below I will paste the code I used for my VoiceXML to log out several important shadow variables (including interpretation) for grammars.  I also evaluated the length of the slot return and applied conditional logic against it.  This was using your grammar:

[code]
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">

<form id="F1">
 
<var name="stringLength"/>
<var name="InterpretationResult"/>

  <field name="MyField">
   
    <grammar src="alphanum-gram.grxml" type="application/grammar-xml" root="GetCode"/>

    <prompt>
    Please input an alpha numeric value from three to eight digits
    </prompt>

    <filled>

        <log expr="'**********************************************'"/>
        <log expr="'CONFIDENCE = ' +lastresult$.confidence"/>
        <log expr="'UTTERANCE = ' + lastresult$.utterance"/>
        <log expr="'INPUTMODE = ' + lastresult$.inputmode"/>
        <log expr="'INTERPRETATION = ' + MyField$.interpretation.alphaSlot1"/>
        <log expr="'**********************************************'"/>

      <!-- This gets the interpretation (slot return) from the utterance -->
    <assign name="InterpretationResult" expr="MyField$.interpretation.alphaSlot1"/>
     
      <!-- This parses our slot return and assigns it to a variable --> 
  <assign name="stringLength" expr="InterpretationResult.length"/>

      <!-- Here we use if / else if to act on this return.  You can take necessary action  -->
      <if cond="stringLength == '3'">
        <log expr="'******* String Length ' + stringLength"/> 
      <elseif cond="stringLength =='4'"/>
        <log expr="'******* String Length ' + stringLength"/>
      <elseif cond="stringLength =='5'"/>
        <log expr="'******* String Length ' + stringLength"/>
      <elseif cond="stringLength =='6'"/>
        <log expr="'******* String Length ' + stringLength"/>
      <elseif cond="stringLength =='7'"/>
        <log expr="'******* String Length ' + stringLength"/>
      <elseif cond="stringLength =='8'"/>
        <log expr="'******* String Length ' + stringLength"/>
      </if>

    </filled>
   
  </field>

  </form>

</vxml>
[/code]

Here is what was logged when I spoke "zero zero A J K":

[code]
**********************************************
LOG: CONFIDENCE = 0.59
LOG: UTTERANCE = zero zero a j k
LOG: INPUTMODE = voice
LOG: INTERPRETATION = 00AJK
**********************************************
[/code]

Also, there are two excellent blog postings we made in the past regarding alpha-numeric voice recognition.  I think you may find them useful, so I will paste the links for you:

Part One:
http://blogs.voxeo.com/voxeodeveloperscorner/2008/05/05/certified-tech-tip-alpha-numeric-voice-recognition-grammars-part-one/

Part Two:
http://blogs.voxeo.com/voxeodeveloperscorner/2008/05/20/certified-tech-tip-alpha-numeric-voice-recognition-grammars-part-two/

Please let me know if you have any questions at all regarding the working example code I provided, as I'm happy to help.  I've attached the complete code to the post as well for your convenience.

Best,
Mike Thompson
Voxeo Corporation
shawnaslam1
6/4/2009 11:16 AM (EDT)

I am really thank full of you Mike for the explain answer.
Now you have seen my grammar and you told me that there is no issue with the grammar but I dont why after even using the shadow variable I am still getting the 8 digits though I have only spoken 5 digits might be it something to my accent, however I am posting my VXML code to you might be you able to find something missing


<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" application="AlphaNumeric-root.xml">
   
    <form id="F1">
       
        <field name="EnteredCode">
            <prompt>
                Please Speak your Alpha Numeric code
            </prompt>
       
            <grammar src="GetCodeGrammar.xml" type="application/grammar-xml" root="GetCode"/>
           
            <filled mode="any" >
                            <log expr="'Grammar Has Interpretted The Input As ==='+ EnteredCode$.interpretation.alphaSlot1"/>
                            <!--lastresult-->
                            <prompt>
                                The Entered Code is
                            </prompt>
                           
                            <var name="arrayA3" expr="TTSArray(EnteredCode$.interpretation.alphaSlot1)"/>
                            <prompt bargein="false">
                                <foreach item="digitA3" array="arrayA3">
                                    <audio expr="tts(digitA3)">
                                        <break time="3000" />
                                        <break time="3000" />
                                    </audio>
                                </foreach>
                            </prompt>
                         
                            <exit />
            </filled>
           
        </field>
       
    </form>
</vxml>

let me know If any thing can be corrected?

One more very important thing I sent this module to the client for the testing and she reported back that she is not able to get recognise V character, below are the resilts

Speak =      V  V  V 
Recognized As = D  Z  1

you already have my grammar in the post still giving you below what I am using for V

<item> v <tag> out.slot="V" </tag></item>
<item> vee <tag> out.slot="V" </tag></item>
<item> vea <tag> out.slot="V" </tag></item>

How can I improve it any idea?


Shawn
MattHenry
6/4/2009 1:07 PM (EDT)


Hello Shawn,

The main problem with accurate alphanumeric reco is that this is without a doubt, the most difficult topic for recognition that exists in IVR, as stated in the blog postings that Mike had provided to you. In my estimation, alphanumeric voice capture where the string length is arbitrary is always, always going to have instances of mis-recognitions even in ideal circumstances. I should stress that the blog links do cover the specific challenges in detail, and provide many helpful hints on what can be done to improve accuracy, and it would be very beneficial for you to read these entries very closely and thoroughly.

Best of luck,

~Matthew Henry
bobpandey
7/28/2009 3:58 AM (EDT)
Hi All,

As a part of my assignment, I'm trying to return some value if nothing is recognized.  I tried it as below. I'm trying to use the garbage model.

My Requirment: If the user spoke "Subway" and the grammar does not have any such entry then it should match with the garbage and return some garbage value. (Say test_value).

Could anyone help me understand if I can return something like this or not.

<?xml version="1.0" encoding="ISO-8859-1"?>
<grammar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" tag-format="swi-semantics/1.0" version="1.0"
root="subway" mode="voice" xmlns="http://www.w3.org/2001/06/grammar" xsi:schemaLocation="http://www.w3.org/2001/06/grammar
http://www.w3.org/TR/speech-grammar/grammar.xsd" xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions">

<meta name="swirec_compile_parser" content="1"/>

  <rule id="subway" scope="public">
    <one-of>
      <item weight="1.0">
        <item>subway</item>
        <tag>value="NAME=subway"</tag>
      </item>
      <item weight="10.0">
        <ruleref special="GARBAGE"/>
        <tag>value="NAME=GARBAGE_RULE  Gbg_val=test_value"</tag>
      </item>
    </one-of>
  </rule>
</grammar>

Also, do I need to enable any configuration parameter in Nuance configuration ?

Any help will be highly appreciated.  Thanks.

Bob.
voxeoJeffK
7/28/2009 7:50 AM (EDT)
Hello,

A nomatch situation is always best handled using a nomatch handler as that is its specific purpose, and any desired values can be assigned as necessary within the <nomatch>.

In the case of using the special ruleref GARBAGE, this is not possible as per the SRGS specification:

"A $GARBAGE reference is equivalent to a transition that accepts platform specific input and produces as output ε."

where

"Let ε (epsilon) or "" denote the unique string of length 0, also known as the empty string."

Which basically tells us that GARBAGE references return nothing.

Regards,
Jeff Kustermann
Voxeo Support
sambhav
3/17/2010 2:49 AM (EDT)
Hello everyone

My query is regarding weight attribute of item tag.

<one-of>
  <item weight="0.0">
        ball.
  </item>

  <item weight="0.4">
      apple.
  </item>

  <item weight="0.6">
      sun.
  </item>
</one-of>

What does weight 0 implies?
voxeoJeffK
3/17/2010 3:45 AM (EDT)
Hello,

A weight specified as:

  <item weight="0.0">

sets the likeliness of a match to zero. In the presence of other item possibilities then that item will never be selected.

Regards,
Jeff Ksutermann
Voxeo Support

login



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