voicexml acs 352 based on

Post on 27-Dec-2015

223 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

VoiceXML

ACS 352

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

html

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). 

VoiceXML Forum VoiceXML 1.0 is also a specification of

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

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.

                                                       

                    

HTML vs. VoiceXML

Telephones… These voice gateways extend the

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

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.

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.  

History of VoiceXML

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)

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.

Speech Technologies Automated speech recognition (ASR)

Training free-form dictation

Without Training speech grammars

Speech Technologies Speech synthesis, or

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

IBM’s Voice Server

PSTN PSTN

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

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.

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.

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.

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…

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.

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>

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.

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>

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>

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.

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>

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.

XML Editors

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

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>

<?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

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.

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"?>

<? 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"

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.

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)>]>

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

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

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

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

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)>]>

XML DTD (Detail) <!ELEMENT

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

+,*,?,| 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

#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.

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

VoiceXML Tags

< element_name attribute_name="attribute_value">

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

< /element_name>

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.

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">

Hello World!" example

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

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

Forms

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

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

</form>

</vxml>

VoiceXML: Dialogs VoiceXML dialogs

Each dialog is in a form

<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.

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.

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

Another Hello Example

<?xml version="1.0"?>

<vxml version="1.0">

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

<meta name="maintainer" content="hello-support@hi.example"/>

<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>

<?xml version="1.0"?>

<vxml version="1.0">

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

<form>

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

</form>

</vxml>

<?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>

<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

<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

Examples

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>

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>

< Disconnect><block>

You have selected to drink coffee!<disconnect />

</block>

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>

<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>

Record (confirm)

.

.<filled>

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

<else/>Message discarded, goodbye.

</if></filled>

</field></form>

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>

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>

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>

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>

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>

(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>

Referencias VoiceXML Forum

www.voicexml.org

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

www.w3.org/TR/voicexml/

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)

top related