31
Template-based framework for building VoiceXML application Jonathan Law

Template-based framework for building VoiceXML application

  • Upload
    habib

  • View
    56

  • Download
    0

Embed Size (px)

DESCRIPTION

Template-based framework for building VoiceXML application. Jonathan Law. Agenda. What is VoiceXML ? System overview Development platform Template-based Application Framework Design process Deployment platforms. What is VoiceXML ?. VoiceXML is an extension of XML - PowerPoint PPT Presentation

Citation preview

Page 1: Template-based framework for building VoiceXML application

Template-based framework for building VoiceXML application

Jonathan Law

Page 2: Template-based framework for building VoiceXML application

Agenda

What is VoiceXML ? System overview Development platform Template-based Application Framework Design process Deployment platforms

Page 3: Template-based framework for building VoiceXML application

What is VoiceXML ?

VoiceXML is an extension of XML VoiceXML 1.0 is a specification of VoiceXML

Forum VoiceXML is a Web-based markup language for

representing human-computer dialogs VoiceXML leverages the Internet for voice

application development and delivery VoiceXML is not a universal solution to making

web pages voice accessible

Page 4: Template-based framework for building VoiceXML application

History of VoiceXML ?

It started back in 1995 with AT&T researchers

VoiceXML combined Phone Markup Language (PML- AT&T & Lucent), SpeechML (IBM) and VoxML (Motorola)

The founding companies are Lucent, IBM, Motorola and AT&T

VoiceXML 1.0 came out in March 2000 and accepted by W3C in May 2000

VoiceXML 2.0 draft released in January 2001

Page 5: Template-based framework for building VoiceXML application

Voice-centric Devices

Page 6: Template-based framework for building VoiceXML application

Multi-Channel System Architecture

Page 7: Template-based framework for building VoiceXML application

Multi-Channel System Architecture

Page 8: Template-based framework for building VoiceXML application

IDE Tools IBM Voice Server and Apache Forum

Apache Web Server PHP

mySQL PHP

PHP

PHP

IBM Voice Server

Page 9: Template-based framework for building VoiceXML application

Voice Web Architecture

Page 10: Template-based framework for building VoiceXML application

Development Platform

Open source Apache Forum Products on Windows NT 4.0

Web Server - Apache HTTP Server Database - mySQL Server Side Scripting - PHP VoiceXML server - IBM ViaVoice SDK

Page 11: Template-based framework for building VoiceXML application

Design Objectives

Distinct layers architecture (presentation layer, business logic layer and data access layer)

Scalable architecture based on J2EE (enable vendor independence, RAD workflow process)

Abstract data access layer (allow easy plug-n-play for new data access channels)

Easy of use and user-friendly (separate designer and programmer skill sets)

Abstract execution environment (allow multiple-content to multiple devices)

Page 12: Template-based framework for building VoiceXML application

VoiceXML Essentials

Each application has one or more VoiceXML documents

Each document has one or more dialogs Each dialog can be either informational or

interactive Informational - prompts Interactive - requests and responses

Page 13: Template-based framework for building VoiceXML application

Basic Elements

<vxml> - root element <form> - define interactive or informational

dialog <block> - container for executable elements <audio> - play audio file or synthesized speech

(TTS) <goto> - navigates to another dialog block

Page 14: Template-based framework for building VoiceXML application

Simple VoiceXML application

The elements are arranged in a nested hierarchy according to the specification of VoiceXML DTD v 1.0

<vxml>

<form>

<block>

<audio> welcome to Pace University Speech Lab </audio>

</block>

<form>

</vxml>

Page 15: Template-based framework for building VoiceXML application

Template-based Application Framework Benefits

Ease of use, easy to understand Short learning curve Proven Apache Forum shareware Based on J2EE standard, JSP compatible Fast, Very Fast performance Scalable, abstract architecture Reusable component Abstract execution environment Flexible delivery system to multiple devices

Page 16: Template-based framework for building VoiceXML application

Template-based Application Framework Components

Framework contains 6 modules Resources - resource bundles, config files Prompts - pre- recorded wave files, text for prompts

Grammars - grammars files Templates - dialog designs

Includes - sources code, common

Common - XML DTD, DB abstract, generic codes

Page 17: Template-based framework for building VoiceXML application

Application Framework Design

Classic Software Design Paradigm Model - manages the behavior View, responds to request,

and instruction to change state View - manages the outputs Controller - Interpret input from user, command the model

and change the view as appropriate

Model

Controller View

Page 18: Template-based framework for building VoiceXML application

Application Framework mapping

(BusinessLogic )

phptem plate

files

d ia log s

P rom p ts

G ram m a r

C on fig

In clu d es

vxm l

Controller ViewModel

Page 19: Template-based framework for building VoiceXML application

Implementation Process Dialog Design

– Pre-recorded or TTS Build VXML component

– speech objects

– define grammar Map dialog with contents from DB tables

– build API for data retrieval

Apply Business Logic– map dynamic and static contents

Unit testing via browser using PHP– call up each component through URL

System Integration in VXML platforms

Page 20: Template-based framework for building VoiceXML application

Dialog DesignBasic Call Flow Control

A Voice application is a collection of dialogs. The interpreter navigates from dialog to dialog in

document source order. A dialog is referenced via the value of its id attribute. The id of each dialog within a document should be unique. The URL consists of a hash symbol (#) followed by the

value of the <form> element’s id attribute. Outside the document, the URL consists of the absolute

or relative HTTP path to the document

Page 21: Template-based framework for building VoiceXML application

Dialog DesignBasic Call Flow Control example

<!-- main.vxml -->

<vxml>

<form id=“main”>

<block>

<goto next=“action1.vxml#say_hello”/>

</block>

</form>

<form id=“goodbye”>

<block>

<audio>Good Bye</audio>

<goto next=“_home”/>

</block>

</form>

</vxml>

<!-- action1.vxml -->

<vxml>

<form id=“say_hello”>

<block>

<audio> Welcome to Pace U</audio>

<goto next=“#do_next”/>

</block>

</form>

<form id=“do_next”>

<block>

<goto next=“main.vxml#goodbye”/>

</block>

</form>

</vxml>

Page 22: Template-based framework for building VoiceXML application

Dialog DesignCompare Audio and TTS

Pre-recorder Audio Text-To-Speech

Resource Large Small

Vocabulary Small Unlimited

Intelligibility High Highly Intelligible

Voice Quality Natural

Pleasant Mechanical

Voice Customizability Must re-record Unlimited

Cost Expensive Negligible

Flexibility None Unlimited vocabulary

Page 23: Template-based framework for building VoiceXML application

Build VXML componentsA simple dialog template

<form id="login">

<field name="userid">

{USERID_GRAMMAR}

{USERID_PROMPT}

<noinput count="1">

<reprompt/>

</noinput>

</field>

<field name="password">

{USERPWD_GRAMMAR}

{USERPWD_PROMPT}

<filled>

<assign name="application.userid" expr="userid"/>

<submit next=”{GOTO_PAGE}" namelist=”{GOTO_PARAMETERS}"/>

</filled>

</field>

</form>

Page 24: Template-based framework for building VoiceXML application

Build VXML componentsDefine Prompts and Grammars

<?php

$USERID_PROMPT='<prompt><audio>Please say your six digit user ID.</audio></prompt>';

$USERPWD_PROMPT='<prompt><audio>Say your four digit password.</audio></prompt>';

$MENU_USERID_INVALID_PROMPT='<prompt><audio>That user ID does not exist. Login again.</audio></prompt>';

$MENU_USERPWD_INVALID_PROMPT='<prompt><audio>That password is incorrect. Login again.</audio></prompt>';

?>

Example of a prompt file for US_EN

Page 25: Template-based framework for building VoiceXML application

Build VXML componentsDefine Grammars

<?php

$USERID_GRAMMAR='src=builtin:grammar/digits?length={USERID_LENGTH}"></grammar>’;

$USERPWD_GRAMMAR=src=builtin:grammar/digits?length={USERPWD_LENGTH}"></grammar>’;

?>

Page 26: Template-based framework for building VoiceXML application

Integrate into Application Template Framework

<?php

include "includes/class.FastTemplate.php";

include "includes/common.php";

include "includes/functions.php";

include "includes/abstractdatabase.php";

# to have language specific prompts, and grammars

include (RESOURCES_DIR . "/login_" . LANGUAGE . ".php");

$db = new db();

$db->open(DATABASE, HOST, USER, PASSWORD);

# create a new query object

$q = new query($db);

Common

Include files

Configurations

Database Abstract

Page 27: Template-based framework for building VoiceXML application

Apply Business Logic# any thing that you want to do at the beginning of the page common all pages.

pageStart();

# don't really need to declare as global since there are

# no functions using $tpl

global $tpl;

# initialize FastTemplace class

$tpl = new FastTemplate(TEMPLATE_DIR);

$tpl->define(array("main" => "main.tpl",

"login" => "login.tpl"));

$tpl->assign(array("USERID_LENGTH" => LOGIN_ID_LENGTH,

"USERPWD_LENGTH" => LOGIN_PASSWORD_LENGTH,

"USERID_PROMPT" => $USERID_PROMPT,

"USERPWD_PROMPT" => $USERPWD_PROMPT,

"LOGIN_GRAMMAR" => createLoginGrammar(LOGIN_ID_LENGTH),

"PASSWORD_GRAMMAR" => createPasswordGrammar(LOGIN_PASSWORD_LENGTH)));

template

mappings

Variables substitution

Page 28: Template-based framework for building VoiceXML application

Apply Business Logic cont.

# doing a search and replace here

# variable CONTENT will get the value of the list template after the search and replace

$tpl->parse("CONTENT", "login");

# variable MAIN will get the value of the main template

# NOTE how the CONTENT variable assigned in the previous instruction gets replaced in the template.

$tpl->parse("MAIN", "main");

#print out the last variable: MAIN

$tpl->FastPrint();

# any thing that you want to do at the end of the page common to

# all pages

pageEnd();

Page 29: Template-based framework for building VoiceXML application

Unit Testing via browser

Login.php

Page 30: Template-based framework for building VoiceXML application

VoiceXML Application Tools BeVocal Café, BeVocal, Inc.

– http://café.bevocal.com

WebSphere Voice Server SDK, IBM Corp.– http://www.ibm.com/software/speech/enterprise/ep_11.html

Mobile ADK, Motorola, Inc.– http://mix.motorola.com/audiences/developers/madk_intro_dev.asp

V-Builder, Nuances Communication– http://extranet.nuance.com/developer

Tellme Studio, Tellme Networks, Inc– http://studio.tellme.com

VoiceGenie Dev. Workshop– http://developer.voicegenie.com

voxeo community, voxeo Corporation– http://community.voxeo.com

Page 31: Template-based framework for building VoiceXML application

Application Tools References

Apache Software Foundation– http://www.apache.org

VoiceXML Forum– http://www.voicexml.org

IBM VoiceXML Resources– http://www.alphaworks.ibm.com/tech/voicexml

PHP – http://www.php.net

mySQL– http://www.mysql.com