Main Menu
|
Section Menu
|
Syllabus
|
Previous
|
Next |
Mixed Initiative Forms | Page 5 of 7 |
In directed forms, forms implements rigid, computer-directed conversations. To make a form mixed initiative, where both the computer and the human direct the conversation, it must one or more <initial> form items and one or more form-level grammars.
If a form has form-level grammars:
Its fields can be filled in any order.
More than one field can be filled as a result of a single user utterance.
Also, the forms grammars can be active when the user is in other dialogs. If a document has two forms on it, say a car rental form and a hotel reservation form, and both forms have grammars that are active for that document, a user could respond to a request for hotel reservation information with information about the car rental, and thus direct the computer to talk about the car rental instead. The user can speak to any active grammar, and have fields set and actions taken in response.
Example. Here is a second version of the weather information service,
showing mixed initiative. It has
been enhanced for illustrative purposes with advertising and with
a confirmation of the city and state:
<form id="weather_info"> <grammar src="cityandstate.grxml" type="application/grammar+xml"/> <!-- Caller can't barge in on today's advertisement. --> <block> <prompt bargein="false"> Welcome to the weather information service. <audio src="http://www.online-ads.example.com/wis.wav"/> </prompt> </block> <initial name="start"> <prompt> For what city and state would you like the weather? </prompt> <help> Please say the name of the city and state for which you would like a weather report. </help> <!-- If user is silent, reprompt once, then try directed prompts. --> <noinput count="1"> <reprompt/></noinput> <noinput count="2"> <reprompt/> <assign name="start" expr="true"/></noinput> </initial> <field name="state"> <prompt>What state?</prompt> <help> Please speak the state for which you want the weather. </help> </field> <field name="city"> <prompt>Please say the city in <value expr="state"/> for which you want the weather.</prompt> <help>Please speak the city for which you want the weather.</help> <filled> <!-- Most of our customers are in LA. --> <if cond="city == 'Los Angeles' && state == undefined"> <assign name="state" expr="'California'"/> </if> </filled> </field> <field name="go_ahead" type="boolean" modal="true"> <prompt>Do you want to hear the weather for <value expr="city"/>, <value expr="state"/>? </prompt> <filled> <if cond="go_ahead"> <prompt bargein="false"> <audio src="http://www.online-ads.example.com/wis2.wav"/> </prompt> <submit next="/servlet/weather" namelist="city state"/> </if> <clear namelist="start city state go_ahead"/> </filled> </field> </form> Here is a transcript showing the advantages for even a novice user:
C: Welcome to the weather information service. Buy Joes Spicy Shrimp
Sauce.
C: For what city and state would you like the weather?
H: Uh, California.
C: Please say the city in California for which you want the weather.
H: San Francisco, please.
C: Do you want to hear the weather for San Francisco, California?
H: No
C: What state?
H: Los Angeles.
C: Do you want to hear the weather for Los Angeles, California?
H: Yes
C: Dont forget, buy Joes Spicy Shrimp Sauce tonight!
C: Mostly sunny today with highs in the 80s. Lows tonight from the low 60s
The go_ahead field has its modal attribute set to true. This causes all grammars
to be disabled except
the ones defined in the current form item, so that the only grammar active during
this field is the built-in
grammar for boolean.
An experienced user can get things done much faster (but is still forced to listen to the ads):
C: Welcome to the weather information service. Buy Joes Spicy Shrimp
Sauce.
C: What
H (barging in): LA
C: Do you
H (barging in): Yes
C: Dont forget, buy Joes Spicy Shrimp Sauce tonight!
C: Mostly sunny today with highs in the 80s. Lows tonight from the low 60s
Main Menu
|
Section Menu
|
Syllabus
|
Previous
|
Next |