voicexml acs 352 based on

74
VoiceXML ACS 352 Based on http://www.voicexml.org/tutorials/ intro1.html

Upload: laura-sparks

Post on 27-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: VoiceXML ACS 352 Based on

VoiceXML

ACS 352

Based onhttp://www.voicexml.org/tutorials/intro1.

html

Page 2: VoiceXML ACS 352 Based on

VoiceXML VoiceXML is a Web-based markup

language for representing human-computer dialogs.

VoiceXML assumes a voice browser with audio output (computer-synthesized and/or recorded), and audio input (voice and/or keypad tones). 

Page 3: VoiceXML ACS 352 Based on

VoiceXML Forum VoiceXML 1.0 is also a specification of

the VoiceXML Forum, an industry consortium of over 388 companies. 

Page 4: VoiceXML ACS 352 Based on

Voice Browser The typical VoiceXML voice browser of

today runs on a specialized voice gateway node that is connected both to the public switched telephone network and to the Internet.

Page 5: VoiceXML ACS 352 Based on

                                                       

                    

HTML vs. VoiceXML

Page 6: VoiceXML ACS 352 Based on

Telephones… These voice gateways extend the

power of the web to the world's 1,300,000,000 phones.

Page 7: VoiceXML ACS 352 Based on

WAP The Wireless Application Protocol is

a secure specification that allows users to access information instantly via handheld wireless devices such as mobile phones, pagers, two-way radios, smartphones and communicators.

Page 8: VoiceXML ACS 352 Based on

VoiceXML vs. WAP WAP is a useful technology, but WAP

screens are small and can be restrictive, and keypad input can be difficult. 

WAP is far harder than voice to use while driving, and it is available only in a tiny percentage of phones and geographic regions.  

Page 9: VoiceXML ACS 352 Based on

History of VoiceXML

Page 10: VoiceXML ACS 352 Based on

Voice XML 1.0 VoiceXML Forum

AT&T, IBM, Motorola y Lucent Technologies 398 compañias

VoiceXML 1.0 Marzo 2000 www.voicexml.org

World Wide Web Consortium www.w3.org Recomendación (Mayo 2000)

Page 11: VoiceXML ACS 352 Based on

Advantages VoiceXML takes advantage of several

trends: The growth of the World-Wide Web and of

its capabilities. Improvements in computer-based speech

recognition and text-to-speech synthesis. The spread of the WWW beyond the

desktop computer.

Page 12: VoiceXML ACS 352 Based on

Speech Technologies Automated speech recognition (ASR)

Training free-form dictation

Without Training speech grammars

Page 13: VoiceXML ACS 352 Based on

Speech Technologies Speech synthesis, or

text-to-speech (TTS) waveform concatenation speech synthesis

Page 14: VoiceXML ACS 352 Based on

IBM’s Voice Server

Page 15: VoiceXML ACS 352 Based on

PSTN PSTN

Short for Public Switched Telephone Network, which refers to the international telephone system based on copper wires carrying analog voice data.

Page 16: VoiceXML ACS 352 Based on

XML and VoiceXML Web data representation has advanced.  XML is a general and highly flexible

representation of any type of data, and various transformation technologies make it easy to map one XML structure to another, or to map XML into other data formats. 

VoiceXML is based on XML.

Page 17: VoiceXML ACS 352 Based on

What is XML?

The eXtensible Markup Language is really a meta-language. It is used to create markup languages, such as HTML.

Although it is very similar to SGML, being a subset, it differs in two main ways: it is much more compact and efficient than SGML

and is Web-native.

Page 18: VoiceXML ACS 352 Based on

Definition of XML

Extensible Markup Language (XML) is the universal language for data on the Web. It gives developers the power to deliver structured data from a wide variety of applications to the desktop for local computation and presentation. XML allows the creation of unique data formats for specific applications. It is also an ideal format for server-to-server transfer of structured data.

Page 19: VoiceXML ACS 352 Based on

How XML is similar to HTML

XML uses tags just like HTML, but those tags don’t define text formatting. Instead the tags are used to create data structures.

Let’s see some examples…

Page 20: VoiceXML ACS 352 Based on

Examples of HTML and XML

HTML Code:

<b> This is bold text…</b>

XML Code:

<President> Clinton</President>

Using our own custom tag named “President”, we have stored a small piece of information.

Page 21: VoiceXML ACS 352 Based on

Detailed Example

XML Documents can be organized in a hierarchal fashion. Each

tag or node can have “sub” nodes under it. <President>

<Name>Clinton, Bill</Name><Age>52</Age><Terms>2</Terms>

</President>

Any number of nodes can be created under any given node. But each node must be “closed” using a closing tag, like </President>

Page 22: VoiceXML ACS 352 Based on

XML Elements

A “Node” in an XML document is known as an Element. An XML document can have any number of elements. For example we could store information about 10 Presidents in a document.

Page 23: VoiceXML ACS 352 Based on

Multiple Elements

<Car><Manufacturer>Mitsubishi</Manufacturer><Model>Eclipse</Model><Year>1998</Year>

</Car>

<Car><Manufacturer>Pontiac</Manufacturer><Model>Sun Fire</Model><Year>1997<Year>

</Car> <Car>

<Manufacturer>Nissan</Manufacturer><Model>X-Terra</Model><Year>2000<Year><SUV>Yes</SUV>

</Car>

Page 24: VoiceXML ACS 352 Based on

Attributes

Besides having “sub-elements”, every element can also have what are known as Attributes.

Attributes are declared “inside” the tag. You may already know how to use attributes if you have used the <IMG> or <A> tags in HTML.

For example:<A HREF=“somepage.html”>click here</A>

Page 25: VoiceXML ACS 352 Based on

XML Attributes

Here’s an example of an XML element with an Attribute….

<Vehicle VIN=“3232382432832”><Year>1997</Year><Make>Dodge</Make>

</Vehicle>

We could make any element an attribute…For example, Make and Year could also have been made attributes. However you usually want only some unique characteristic of the element to be an attribute. Examples: Serial #, SKU#, Stock symbol, Product ID etc.

Page 26: VoiceXML ACS 352 Based on

A Complete Example

<Customer ssn=“325-93-3323”><FirstName>Rachel</FirstName><LastName>McKinnon</LastName><Accounts>

<Account AccountNumber=“0023003020”><Type>Checking</Type><CurrentBalance>10000</CurrentBalance><OpenedOn>12/12/1999</OpenedOn>

</Account><Account AccountNumber=“4423 1121 1122 1425”>

<Type>Credit Card</Type><CurrentBalance>2000</CurrentBalance><OpenedOn>4/1/1997</OpenedOn>

</Account></Accounts>

</Customer>

Page 27: VoiceXML ACS 352 Based on

Try this one yourself …

Company Name

Symbol Stock Price

Recent News Stories

Microsoft MSFT 72.50 Microsoft introduces Windows NextGen technology.

Amazon.com AMZN 47.00 Amazon.com announces new e-commerce services at conference in NYC.

Page 28: VoiceXML ACS 352 Based on

XML Editors

Page 29: VoiceXML ACS 352 Based on

XML Resources

Microsoft Developer Network (MSDN)http://msdn.microsoft.com/xml

The BizTalk Frameworkhttp://www.biztalk.org

IBM’s XML Zonehttp://www.ibm.com/developer/xml/

W3C XML Standards Bodyhttp://www.w3c.org/xml

Page 30: VoiceXML ACS 352 Based on

XML Example; FIRST.XML<?xml version="1.0" encoding="ISO8859-1" ?><?xml-stylesheet type="text/xsl" href="first.xsl"?><CATALOG> <CD> <TITLE>Empire Burlesque</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia</COMPANY> <PRICE>10.90</PRICE> <YEAR>1985</YEAR> </CD></CATALOG>

Page 31: VoiceXML ACS 352 Based on

<?xml version='1.0'?><xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"><xsl:template match="/"> <html> <body> <table border="2" bgcolor="yellow"> <tr> <th>Title</th> <th>Artist</th> </tr> <xsl:for-each select="CATALOG/CD"> <tr> <td><xsl:value-of select="TITLE"/></td> <td><xsl:value-of select="ARTIST"/></td> </tr> </xsl:for-each> </table> </body> </html></xsl:template></xsl:stylesheet>

FIRST.XSL

Page 32: VoiceXML ACS 352 Based on

Make an XML Declaration XML document type declaration:

a mechanism that allows XML authors to communicate data to document readers (such as browsers).

This data includes: markup language, version, standalone document declaration and character encoding.

Page 33: VoiceXML ACS 352 Based on

XML document type declarations <?xml version="1.0"

standalone="yes"?> <?xml version="1.0"

standalone="no"?> <?xml version="1.0"

standalone="no" ENCODING="UTF-8"?>

Page 34: VoiceXML ACS 352 Based on

<? These character open the declaration.

xml This statement differentiates XML from other

document formats, such as SGML and HTML.

version This statement differentiates between

versions of XML.Default Value: "1.0"

Page 35: VoiceXML ACS 352 Based on

standalone The Standalone Document Declaration allows

the document author to specify whether a document-type-definition is to be used. Possible Values: "yes", "no"

encoding Ignore this feature unless you want to use

another type of character encoding other than UTF-8. Default Value: "UTF-8"

?> These characters close the declaration.

Page 36: VoiceXML ACS 352 Based on

Example DTD(Document Type Definition) Novel Document Type

<?xml version="1.0" standalone="no"?><!DOCTYPE NOVEL [<!ELEMENT NOVEL (FORWORD,CHAPTER+,BIOGRAPHY?,CRITICALESSAY*)><!ELEMENT FORWORD (PARAGRAPH+)> <!ELEMENT CHAPTER (SECTION+|PARAGRAPH+)><!ELEMENT SECTION (PARAGRAPH+)> <!ELEMENT BIOGRAPHY(PARAGRAPH+)> <!ELEMENT CRITICALESSAY (SECTION+)> <!ELEMENT PARAGRAPH (#PCDATA)> <!ELEMENT SIGN (#PCDATA)>]>

Page 37: VoiceXML ACS 352 Based on

External DTD <?xml version="1.0"?>

<!DOCTYPE greeting SYSTEM "hello.dtd"> <greeting>Hello, world!</greeting>

Page 38: VoiceXML ACS 352 Based on

Internal DTD <?xml version="1.0" encoding="UTF-8"

?> <!DOCTYPE greeting [ <!ELEMENT greeting (#PCDATA)> ]> <greeting>Hello, world!</greeting>

Page 39: VoiceXML ACS 352 Based on

XML DTD <?xml version="1.0" standalone="no"?>

<!DOCTYPE MEMO [<!ELEMENT MEMO (TO,FROM,SUBJECT,BODY,SIGN)><!ELEMENT TO (#PCDATA)><!ELEMENT FROM (#PCDATA)><!ELEMENT SUBJECT (#PCDATA)><!ELEMENT BODY (P+)><!ELEMENT P (#PCDATA)><!ELEMENT SIGN (#PCDATA)>]>

Page 40: VoiceXML ACS 352 Based on

XML DTD (Detail) <!ELEMENT

Elements state their relationships with other elements, so that document readers understand how documents, complying to the DTD, work.

Page 41: VoiceXML ACS 352 Based on

+,*,?,| These symbols represent the allowed use of

elements. For example, if "+" is associated with an element, then that element must be used at least once and can be used limitlessly.

+: required and multiple *: optional and multiple ?: optional but singular

Page 42: VoiceXML ACS 352 Based on

#PCDATA This statement, to a document reader,

means text. If a DTD designer wants text to be allowed in a document, "#PCDATA" will be used in the DTD to state that.

Page 43: VoiceXML ACS 352 Based on

VoiceXML… Continue What sorts of voice applications are

best suited for VoiceXML?  Information retrieval applications V-Commerce Telephone services

like personal voice dialing Unified messaging applications

Page 44: VoiceXML ACS 352 Based on

VoiceXML Tags

< element_name attribute_name="attribute_value">

......contained items......

< /element_name>

Page 45: VoiceXML ACS 352 Based on

VoiceXML Documents A VoiceXML application consists of one

or more text files called documents. These document files are denoted by a

".vxml" file extension and contain the various VoiceXML instructions for the application.

Page 46: VoiceXML ACS 352 Based on

Tags It is recommended that the first

instructions in any document to be seen by the interpreter be:

<?xml version="1.0"?>

<vxml version="1.0">

Page 47: VoiceXML ACS 352 Based on

Hello World!" example

<?xml version="1.0"?><vxml version="1.0"> <form> <block>Hello World!</block> </form></vxml>

Page 48: VoiceXML ACS 352 Based on

VoiceXML defines two types of dialogs that the application uses to interface with the user: forms menus.

Page 49: VoiceXML ACS 352 Based on

Forms

<?xml version="1.0"?><vxml version="1.0">

<form id=“Something"> -- content --

</form>

</vxml>

Page 50: VoiceXML ACS 352 Based on

VoiceXML: Dialogs VoiceXML dialogs

Each dialog is in a form

Page 51: VoiceXML ACS 352 Based on

<Form> A form is simply used to present

information to a user or to retrieve information from the user.

The <form> element generally includes a <goto> directive that tells the application where to jump based on the user's input.

Page 52: VoiceXML ACS 352 Based on

Menu A menu is a specialized form that

forces the user to choose a specific option and then branch based on the option that was chosen.

A menu uses multiple <choice> elements to define where to transition to based on the user's selection.

Page 53: VoiceXML ACS 352 Based on

A document may also have <meta> elements, <var> and <script> elements, <property> elements, <catch> elements, and <link> elements.

Page 54: VoiceXML ACS 352 Based on

Another Hello Example

<?xml version="1.0"?>

<vxml version="1.0">

<meta name="author" content="John Doe"/>

<meta name="maintainer" content="[email protected]"/>

Page 55: VoiceXML ACS 352 Based on

<var name="hi" expr="'Hello World!'"/><form><block>

<value expr="hi"/><goto next="#say_goodbye"/>

</block></form><form id="say_goodbye"><block>

Goodbye!</block>

</form></vxml>

Page 56: VoiceXML ACS 352 Based on

<?xml version="1.0"?>

<vxml version="1.0">

<var name="hi" expr="'Hello World!'"/>

<form>

<block><value expr="hi"/>Goodbye!</block>

</form>

</vxml>

Page 57: VoiceXML ACS 352 Based on

<?xml version="1.0"?><vxml version="1.0"> <menu id="Simple_Example"> <prompt> <audio>Welecome to my voice mail. Say Mail to leave me a voice mail and Operator to return back to our operator.</audio> </prompt> <choice next="voicemail.vxml"> Mail </choice> <choice next="operator.vxml"> Operator </choice> <default><reprompt/></default> </menu></vxml>

Page 58: VoiceXML ACS 352 Based on

<FORM > … Field Tags <field>

toma un elemento proporcionado por el usuario por medio de voz o del teclado numérico del teléfono

<record> graba un mensaje de audio dado por el usuario

<transfer> transfiere al usuario a otro numero telefónico

Page 59: VoiceXML ACS 352 Based on

<FORM> …. Control Tags <block>

involucra una secuencia de estatutos para hacer ‘prompts’ y cómputos diversos

<initial> controla las interacciones de los elementos

encontrados en las formas

Page 60: VoiceXML ACS 352 Based on

Examples

Page 61: VoiceXML ACS 352 Based on

First VoiceXML Program< ?xml version="1.0"?>

< vxml application=“primero.vxml" version="1.0">

< form id=“bienvenidos">

< block>

< prompt>Hello ACS 367!</prompt>

< /block>

< /form>

< /vxml>

Page 62: VoiceXML ACS 352 Based on

Second Program<menu>

<prompt> What do you want, coffee or tea?

</prompt><choice next="#getcoffee"> coffee </choice><choice next="#gettea"> tea </choice><noinput>

Please say coffee or tea. </noinput><nomatch>

Please say coffee or tea. </nomatch>

</menu>

Page 63: VoiceXML ACS 352 Based on

< Disconnect><block>

You have selected to drink coffee!<disconnect />

</block>

Page 64: VoiceXML ACS 352 Based on

Use of Fields & Grammars<form id="getPhoneNumber"> <field name="PhoneNumber">

<prompt>What's your phone number? </prompt> <grammar type=“digits”/> <help>

Please say your ten digit phone number. </help>

</field> </form>

Page 65: VoiceXML ACS 352 Based on

<Record><form>

<record name="message" beep="true" maxtime="10s" finalsilence="4s">

<prompt> At the tone, please record your message

</prompt></record>

<field name="confirm" type="boolean">The message is <value expr="message“ mode="recorded"/>

<prompt> To keep it, say yes. To discard it, say no.

</prompt>

Page 66: VoiceXML ACS 352 Based on

Record (confirm)

.

.<filled>

<if cond="confirm">Message saved, goodbye.

<else/>Message discarded, goodbye.

</if></filled>

</field></form>

Page 67: VoiceXML ACS 352 Based on

VoiceXML Calculator <?xml version="1.0" ?> <vxml version="1.0"> <form id="myCalculator">

<var name="result" /> <field name="op">

<!-- OPERATION --> <prompt>

A Voice XML calculator. Choose add, or multiply.</prompt>

<grammar>[add multiply]</grammar>

Page 68: VoiceXML ACS 352 Based on

Add or multiply?<!-- Choose your operation, add or multiply -->

<help>Say add, or multiply.</help> <filled>

<prompt> Okay, let's <value expr="op" /> two numbers. </prompt>

</filled></field>

Page 69: VoiceXML ACS 352 Based on

First Number<!-- FIRST OPERAND --> <field name="a" type="number">

<prompt>What’s the first number?</prompt>

<help>Please say a number. This number will be the first operand.

</help> <filled>

<prompt> <value expr="a" /> </prompt></filled>

</field>

Page 70: VoiceXML ACS 352 Based on

Second Number<!-- SECOND OPERAND --> <field name="b" type="number">

<prompt>and the second number?</prompt> <help>Please say a number.

This number will be the second operand. </help>

<filled><prompt> <value expr="b" /> Okay. </prompt></filled>

</field>

Page 71: VoiceXML ACS 352 Based on

Evaluation (op==add)<block><!-- NOW SAY THE RESULT -->

<if cond="op=='add'"><assign name="result" expr="Number(a) + Number(b)" />

<prompt> <value expr="a" /> plus <value expr="b" />

equals <value expr="result" /> </prompt>

Page 72: VoiceXML ACS 352 Based on

(op==multiply)<elseif cond="op=='multiply'" />

<assign name="result" expr="a * b" /> <prompt> <value expr="a" /> times <value expr="b" />

equals <value expr="result" /> </prompt>

</if> <clear /> <!-- clear all fields, and continue! --> </block>

</form></vxml>

Page 73: VoiceXML ACS 352 Based on

Referencias VoiceXML Forum

www.voicexml.org

Be Vocal Café cafe.bevocal.com/ W3C WWW Consortium

www.w3.org/TR/voicexml/

Page 74: VoiceXML ACS 352 Based on

Grammars The JavaTM Speech Grammar Format is a

platform-independent, vendor-independent textual representation of grammars for use in speech recognition.

Grammars are used by speech recognizers to determine what the recognizer should listen for, and so describe the utterances a user may say.

Speech Recognition Grammar Format (SRGF)