Lesson 8 – Confirming Input

Objectives

Lesson 8 introduces the Confirmation object used to confirm input collected by the caller and, if required, to correct it.

After completing this lesson you will know

·          how to configure a Confirmation object with a single correction item,

·          how to manipulate dialog flows in the Dialog Designer.

Confirmation

So far, the Prime Life Insurance service just repeats back the recognized caller input through a simple Output object. In this lesson you will learn how to specify a Confirmation object in order to allow correction.

A Confirmation object is used to confirm and if necessary to correct the information collected in the previous dialog. It belongs to the object category Components. For a detailed description refer to Confirmation in the Object Reference.

The Confirmation object is one of the more advanced objects. It can be used to confirm individual caller inputs immediately after each is collected, or to confirm a summarized block of items at the end of an input series. If the summary is rejected, the caller can specify which item needs to be corrected. Thus, the Confirmation object can be configured to confirm several caller inputs in one dialog step.

In the Life Insurance application a Confirmation object is used to confirm two inputs in a row. The caller is asked to confirm the recognized gender and age. If the caller denies he or she is asked again for his gender, age, or both, depending on what has been rejected.

Creating a Confirmation Object

To create the Confirmation object for the Life Insurance application, do the following:

1.     From the New menu, select Confirmation or click the Confirmation button  on the toolbar. An empty Confirmation editor will open up.



2.     In the Confirmation editor, enter Confirm gender and age as the name for the new Confirmation object.

@8Tip: If you configure a more advanced object like the Confirmation object, it is recommended to save it from time to time by clicking the Save button   on the toolbar of the editor.

Specify the confirmation request

Expand the Confirmation Request section and link the Repeat caller gender and age Output object – created in Lesson 6 – into the text field by browsing for it via the Context Menu button  . This Output object repeats the collected input using two variables: Ok, I have recognized your gender as <Caller gender Variable object> and your age as <Caller age Variable object>. Add Is that correct? behind the Output object.

Your Confirmation Request section looks like this now:

Specify the confirmation grammar

Next, specify two separate recognition grammars for confirming and denying:

1.     Expand the Confirmation Grammar section.

2.     On the Confirm tab, enter some affirming utterances like yes, okay, or correct etc. in the text field.


 

3.     Switch to the Deny tab and enter some rejecting utterances like no, not correct etc. in the text field.

Specify the correction request

Expand the Correction Request section and enter the initial prompt of the correction request (e.g. Please tell me what was wrong. Gender, age, or both?) in the text field.

This prompt is played if the caller denies the confirmation request before processing the object that performs the correction.

Specify the correction mapping

The Correction Mapping section consists of one or more correction items. Each item contains an object reference as a destination, and an embedded grammar definition.

The grammar defines the utterances that identify this particular item as the one that needs to be corrected. These utterances are in reply to the correction request.

The object reference specified in the Object field of a correction item points to the object that processes the correction, typically an Input or a Sequence object.

1.     Expand the Correction Mapping section.

2.     Define a first correction item to be processed when the caller answered “gender by entering Gender as its label into the Label field in the Correction Item section.

3.     Link the Ask for gender Input object as a destination object into the Object.

4.     In the Grammar section of the correction item, enter gender into the text field.

 

5.     Add a second row by clicking the Add button in the toolbar of the Correction Mapping section.

6.     Define a second correction item to be processed when the caller answered “age by entering Age into the Label field of the second correction item and linking the Ask for age Input object into its Object field. Enter age into the text field of its Grammar section.

7.     Add a third row to define a third correction item to be processed when the caller answered both with label Both.

8.     From the context menu right from the Object field select New and then Sequence to create a new Sequence object that will ask for gender and age sequentially.

9.     In the Sequence editor, enter Ask for gender and age as the name for the new Sequence object.

10.   In the Object Sequence section, link the Ask for gender Input object in to the Object field. Add a new row by using the Add button on the toolbar and link the Ask for age Input object into the second Object field. The Sequence editor looks like this now:



11.   Click Save and Close on the toolbar of the Sequence editor to link the Sequence object as a destination object into the third correction item. For further information on the Sequence object refer to Sequence in the Object Reference.

12.   In the Grammar section of the third correction item, enter both into the text field.

Finally, click Save and Close on the toolbar of the Confirmation editor.

Modify the input request

Since the input request of the Ask for Gender Input object is quite long and best serves as an initial prompt (To help me calculate what your monthly premium would be for life insurance, please say if you are male or female.) you should add a second shorter output for any repetitions of that output (e.g. in the case of confirmation).

1.     Open the Ask for gender Input object and expand the Input Request section.

2.     In the Occurrence field of the first output select Only once.

3.     Add a second row by clicking the Add button in the toolbar of the Input Request section.

4.     Enter a request like Please say if you are male or female. in the text area of the second output.

5.     In the Occurrence field of the second output select If >=2.

6.     Leave all other values as default.

Your Input Request section looks like that now:

 

Click Save and Close on the toolbar of the Input editor.

Manipulating Dialog Flows in the Dialog Designer

You can add the Confirm gender and age Confirmation object to the Life Insurance Module object either in the corresponding Module editor (by adding it to the object sequence, see Lesson 6 – Interacting with the Caller) or directly in the Dialog Designer.

To add it to the dialog flow in the Dialog Designer, open the Dialog Designer for the Life Insurance Module object (if not already open).

Since the Confirm gender and age Confirmation object already includes the Repeat gender and age Output object in the correction request it is no longer needed in the dialog flow and can be replaced by the Confirmation object.

1.     In the Dialog Designer, select the Repeat gender and age Output object.

2.     Right-click it and from the context menu select Replace, then Browse, and then Confirmation.

3.     In the Search Result window, click the Confirm gender and age Confirmation object.

The Confirm gender and age Confirmation object will be inserted into the dialog flow in place of the Repeat gender and age Output object.

 

For a detailed description of all commands for manipulating objects in dialog flows provided on the context menus of the Object Browser and the Dialog Designer refer to Chapter 4 – Object Browser, Chapter 5 – Dialog Designer, and Chapter 7 – Basic Commands in the Desktop for Web Guide.

Dialog Flow 7

You have now added a confirmation to the Life Insurance application, which will do the following:

The caller is asked to confirm their gender and age that have each been stored in a variable. When the caller confirms the recognized input, the dialog proceeds with the next object in the dialog flow. When the caller rejects the recognized input, the Ask for gender Input object, the Ask for age Input object, or both are processed again, depending on what the caller rejected. Afterwards, the server returns to the Confirmation object, starting over with the confirmation request, until the caller finally confirms.

After redeploying your service in the Control Center, call it and test the confirmation behavior.

The following dialog flow shows an example dialog for the Prime Life Insurance service you have created so far:

Object – Caller

Dialog Flow

Welcome to the Prime Life Insurance service!

To help me calculate what your monthly premium would be for life insurance, please say if you are male or female.


Caller

Female.

Now please say your age.


Caller

Twenty-eight.

Ok, I have recognized your gender as female and your age as thirty-eight. Is that correct?


Caller

No.

Please tell me what was wrong. Gender, age, or both?


Caller

Age.

Now please say your age.


Caller

Twenty-eight.

Ok, I have recognized your gender as female and your age as twenty-eight. Is that correct?


Caller

Yes.

Thanks for calling. Goodbye!

What Comes Next

Next, you will learn about layers and how to add a custom layer to your application which changes the dialog behavior depending on the time of the call.

Lesson 9 – Using Layers