david isbitski - enabling new voice experiences with amazon alexa and aws lambda

38
An Introduction to Using AWS and ASK to Build Voice Driven Experiences DAVE ISBITSKI CHIEF EVANGELIST, ALEXA AND ECHO @TheDaveDev [email protected]

Upload: withthebest

Post on 21-Apr-2017

134 views

Category:

Devices & Hardware


0 download

TRANSCRIPT

Page 1: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

An Introduction to Using AWS and ASK to Build Voice Driven Experiences

DAVE ISBITSKICHIEF EVANGELIST, ALEXA AND ECHO

@TheDaveDev

[email protected]

Page 2: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

2

http://developer.amazon.com/askhttp://developer.amazon.com/blog

Page 3: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

What  is  Alexa?

Page 4: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Alexa,  Hello.

Page 5: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Skills are how you, as a developer, make Alexa smarter.

They give customers new experiences.

They’re the voice-first apps for Alexa.

Page 6: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

The  Alexa Platform

Page 7: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Connected Home (CoHo) and Lighting API

Page 8: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Alexa App

http://alexa.amazon.com

Page 9: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda
Page 10: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Alexa  Skills  Kit  (ASK)  Overview

Page 11: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

ALEXA SKILLS KIT (ASK)https://developer.amazon.com/ask

Page 12: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

ALEXA VOICE SERVICE (AVS)https://developer.amazon.com/avs

Page 13: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

THE ALEXA FUNDhttps://developer.amazon.com/alexafund

Page 14: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Alexa is the cloud service used by Amazon Echo

The Alexa Skills Kit allows developers to build new Skills (new voice experiences) for Echo

ALEXA SKILLS KIT

Page 15: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Alexa Architecture

Amazon Alexa

ServiceGUI cards are rendered in the Amazon Alexa app

User audio is streamed to the service

Audio responses are rendered on-device

Page 16: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Creating your ownALEXA SKILLSAlexa Skills have two parts:

Configuration data in Amazon Developer Portal

Hosted Service responding to user requests

Page 17: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Alexa Skills Kit Architecture

Amazon  Alexa  Service

Developer’s Application

Service

Amazon’s Developer

PortalApplication, intents, sample data Developer Service URL EndPoint

Configured through portal

User  intents  and  arguments  are  sent  to  the  developer  service

GUI cards are rendered in the Amazon Alexa app

User  audio  is  streamed  to  the  serviceAudio responses are rendered on-device

Text response and/or GUI card data is returned

Page 18: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Sample Interactions ofALEXA SKILLSOne and done

“Alexa, start Astrology and get the Pisces horoscope.”[Horoscope Provided]

Conversation“Alexa, start Astrology”[“What’s your sign?”]“Pisces”[Horoscope Provided]

Page 19: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

DemoConfiguring a new Alexa Skill

Page 20: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Building an Alexa SkillHOSTED SERVICE• Adheres to ASK service interface• Uses HTTP over SSL/TLS on port 443• Must be Internet-accessible• Presents a trusted certificate matching

domain name– Can use self-signed certificate for

development– Trusted certificate required for

certification

Page 21: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Building an Alexa SkillHOSTED SERVICE• You define interactions for your skill

through Intent Schemas• Each intent consists of two fields. The

intent field gives the name of the intent. The slots field lists the slots associated with that intent.

• Slots can be any internal types such as AMAZON.LITERAL, AMAZON.NUMBER or they can be ones you create.

Page 22: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Implementing Custom Slot TypesØ AMAZON.DATE – converts words that indicate dates (“today”,

“tomorrow”, or “july”) into a date format (such as “2015-07-00T9”).

Ø AMAZON.DURATION – converts words that indicate durations (“five minutes”) into a numeric duration (“PT5M”).

Ø AMAZON.FOUR_DIGIT_NUMBER - Provides recognition for four-digit numbers, such as years.

Ø AMAZON.NUMBER – converts numeric words (“five”) into digits (such as “5”).

Ø AMAZON.TIME – converts words that indicate time (“four in the morning”, “two p m”) into a time value (“04:00”, “14:00”).

Page 23: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Implementing Custom Slot TypesØ AMAZON.US_CITY - provides recognition for major cities in the

United States.

Ø AMAZON.US_STATE - provides recognition for US states, territories, and the District of Columbia.

Ø AMAZON.US_FIRST_NAME - provides recognition for thousands of popular first names, based on census and social security data.

Ø AMAZON.LITERAL – always try to use a custom slot type first. Used for backwards compatibility.

Page 24: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Building an Alexa SkillHOSTED SERVICE• The mappings between intents and the

typical utterances that invoke those intents are provided in a tab-separated text document of sample utterances.

• Each possible phrase is assigned to one of the defined intents.

• GetModelsByYear what where the Amiga models in {1997|Date}

• GetModel what year was the {model} released

Page 25: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

The Amazon Alexa ServiceWILL POST EVENTSLaunchRequest

Maps to onLaunch() and occurs when the user launches the app without specifying what they want

IntentRequestMaps to onIntent() and occurs when when the user specifies an intent

SessionEndedRequestMaps to OnSessionEnded() and when the user ends the session

Page 26: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Alexa ServiceExamining the JSON Requests from

Page 27: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda
Page 28: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Handling Amazon Alexa ServiceREQUESTS• You will need to handle POST requests to

your service over port 443 and parse the JSON

• You need to check the session variable to see if the user started a new session or if request is from existing one

• Requests always Include a type, requestId and timestamp

• requestId maps directly to LaunchRequest, IntentRequest and SessionEndedRequest

Page 29: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Increasing Accuracy withBuilt-In Intents• Called in a natural, spontaneous by users

across all skills and Alexa core functionality

• These intents provides a way for you to return help or response whenever these Intents are killed.

• CancelIntent, HelpIntent, YesIntent, NoIntent, RepeatIntent, StartOverIntent, StopIntent

Page 30: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Increasing Accuracy withCUSTOM SLOTS• Created inside Interaction Model

page once in the Developer Portal• Greatly reduces the number of

sample utterances required• Can define as many as you need with

values line separated• Can be combined with existing

AMAZON internal types

Page 31: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Changing Alexa’s inflection with SSML• Alexa automatically handles normal punctuation, such as

pausing after a period, or speaking a sentence ending in a question mark as a question.

• Speech Synthesis Markup Language (SSML) is a markup language that provides a standard way to mark up text for the generation of synthetic speech.

• Tags supported include: speak, p, s, break, say-as, phoneme, w and audio.

Page 32: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Existing Customer withACCOUNT LINKING• Allow your customers to link their

existing accounts with you, to Alexa. • Customers are prompted to log in to

your site using their normal credentials with webview url you provide.

• You authenticate the customer and generate an access token that uniquely identifies the customer and link the accounts.

Page 33: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Testing Your Skill SERVICE SIMULATOR• Enabled once a Skill has been

configured in the Developer Portal• Use spoken utterances to generate

ad hoc results• Use JSON to verify requests• Combine with AWS Lambda Unit

Tests to verify both client and service side Alexa end points

Page 34: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

Testing Your Skill VOICE SIMULATOR• The new Voice Simulator tool will let

you create SSML on the fly and then have Alexa respond.

• The Voice Simulator does not interact with the service for your skill, so you can use it to hear text-to-speech conversion before you have completed the minimum configuration for your skill.

Page 35: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda
Page 36: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

DemoCreating a new Alexa skill with AWS Lambda

Page 37: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

37

http://developer.amazon.com/askhttp://developer.amazon.com/blog

Page 38: David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda

An Introduction to Using AWS and ASK to Build Voice Driven Experiences

DAVE ISBITSKICHIEF EVANGELIST, ALEXA AND ECHO

@TheDaveDev

[email protected]