Larson Technical Services: Voice Technology Consulting

Exercise 10.2

Repeat exercise 8-2 for the pizza restaurant, this time developing a mixed initiative dialog.


<?xml version="1.0"?> 

<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN" 
 "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
 <vxml version="2.0" xmlns = "http://www.w3.org/2001/vxml">

<!-- exercise 10.2 mixed initiative   -->
<!-- get drinks (get pizza toppings not implemented;  -->
<!-- they are similar to get drink)                                                   -->
<!-- get drink  --> 

<script>

     <![CDATA[

          var drink_size = new Array();
          var drink_content = new Array();

          // set listindex
          var drink_list_index  = 0;

     ]]>

</script>

<form id = "get_drink">  
<grammar type = "application/grammar+xml" 
               src="drink.grxml"/>

<initial name = "start">
     <prompt>
          What would you like to drink?
     </prompt>
</initial>  

<field name = "current_drink_content">
     <prompt>
          Which drink? <break/> coke, pepsi, dietpepsi, lemonade, water?
     </prompt>
     <grammar type = "application/grammar+xml" 
          src="drink.grxml.#drink_kind" />
</field>

<field name = "current_drink_size">
     <prompt>
          Drink size <break/> small, medium, or large? 
     </prompt>
     <grammar type = "application/grammar+xml" 
          src = "drink.grxml#drink_glass"/>
</field>
     <filled>
          <script>

               <![CDATA[

                    drink_size[drink_list_index] = current_drink_size;
                    drink_content[drink_list_index] = current_drink_content;
                    drink_list_index = drink_list_index + 1;

               ]]>

          </script>
          <goto next="#another_drink"/>
     </filled>
</form>

<form id="another_drink">
     <field name="more">
          <prompt>do you want another drink? </prompt>
               <grammar type = "application/grammar+xml" root = "yes_no">
                    <rule id = "yes_no" scope = "public">
                         <one-of>
                              <item> yes </item>
                              <item> no </item>
                         </one-of>
                    </rule>
               </grammar>
          <filled>
          <if cond = "more == 'yes'"> 
               <goto next="#get_drink"/>
          </if>
          <submit namelist= "drink_list_index drink_size drink_content"/>
     </filled>        
     </field>
</form>
</vxml>

With the following grammar, drink.grxml:

<grammar type = "application/grammar+xml" root="get_drink"
          xml:lang = "en">
     <rule id = "get_drink" scope = "public">
          <item repeat = "1-">
               <one-of> 
                    <item>
                         <ruleref uri= "#drink_kind" /> 
                    </item>
                    <item>
                         <ruleref uri= "#drink_glass" /> 
                    </item>
               </one-of>
          </item>
     </rule>
     <rule id = "drink_glass" scope = "public">
          <one-of>
               <item> small <tag>current_drink_size ="small"</tag> </item>
               <item> medium <tag>curreint_drink_size="medium"</tag> </item>
               <item> large <tag>current_drink_size="large"</tag> </item>
          </one-of>
     </rule>
     <rule id = "drink_kind" scope = "public">
          <one-of>
               <item> coke<tag>current_drink_content="coke"</tag>  </item>
               <item> pepsi<tag>current_drink_content="pepsi"</tag>  </item>
               <item> dietpepsi<tag>current_drink_content="dietpepsi"</tag>  </item>
               <item> lemonade<tag>current_drink_content="lemonade"</tag>  </item>
               <item> water<tag>current_drink_content="water"</tag>  </item>
          </one-of>
     </rule>
</grammar>

A. Perform a comparison test of both versions with novice callers. Which version do you recommend for novice callers?

Most novice users prefer (a) because it leads them to do the right thing. They don’t have to guess what the right words are.

B. Perform a comparison test of both versions with experienced callers. Which version do you recommend for experienced callers?

Several experienced users (who understand mixed initiative dialogs) find (b) faster. However, they can always drop back into the application-directed mode when they need to.

Return to the Instructor’s Page

Comments are off for this post