使用 serverless 技術打造支援 alexa 的物聯網服務

Post on 19-Jan-2017

74 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

January 2017

使用 Serverless 技術打造支援 Alexa

的物聯網服務

John Chang (張書源)

Today’s agenda

• Skill building fundamentals

• Voice User-Interface

• Advanced skill building

• Idea Challenge

70s 80s 90s 00s Present

mode

GUI

web

mobile

character

VUI

Skill Building Fundamentals

Before we code

1. developer.amazon.com

2. aws.amazon.com

8

The Alexa Service

Alexa

Skills

Kit

Alexa

Voice

Services

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

9

Alexa Skills Kit: Processing a request

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Audio

Request

Response

Your

service

Speech Recognition

Machine Learning

Natural Language Understanding

Text to Speech

Cards

10© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Cards

Alexa Skills Kit: Utterances and Intents

Response

Your

service

Audio

Speech Recognition

Machine Learning

Natural Language Understanding

Text to Speech

RequestIntents

Utterances

ASR – Automatic Speech Recognition

for tē tīmz

• Forty Times?

• For Tea Times?

• For Tee Times?

• Four Tee Times?

Alexa, ask Anime Facts for a fact

wake word utteranceskill namelaunch

Utterances and Intents

One more please

utterance

Utterances and Intents

Alexa, ask Anime Facts for a fact

wake word utteranceskill namelaunch

GetFactIntent

Intent

utterance slot value

Utterances and Intents

One more please

utterance

Alexa, ask Anime Facts for a fact

wake word utteranceskill namelaunch

15© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Audio

Speech Recognition

Machine Learning

Natural Language Understanding

Text to Speech

Cards

Alexa Skills Kit: Requests and Responses

Request

Response

Your

service

16

Alexa Skills Kit: Request and Response

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

“Help”

17

Using Lambda for Processing the

Request & generating the response

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

18

Time to code: Build a fact of the day skill

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

developer.amazon.com

Skill information

Interaction model

End to end testing

aws.amazon.com

Skill logic

Lambda

Lamdba testing

Check in for the event:

Bit.ly/alexacheckin – event name #Re:Invent

AnswerIntent {value: “one”}

slot valueIntent

one is the answerslot value

Slots in the utterances

The answer is oneslot value

oneslot value

21

Utterances and Intent Schema

Utterances Intent Schema

22

Utterances and Intent Schema

Utterances Intent Schema

23

Built-in and Custom Slot Types

24

Session Attributes

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

25

Session Persistence

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

exports.handler = function (event, context, callback) {

var alexa = Alexa.handler(event, context);

alexa.appId = appId;

alexa.dynamoDBTableName = 'YourTableName'; // That's it!

alexa.registerHandlers(State1Handlers, State2Handlers);

alexa.execute();

};

this.attributes['yourAttribute'] = 'value';

var yourVariable = this.attributes['yourAttribute']

Add dynamoDB

table name in

your index.js

put

get

26

State Management

Define states

Event handlers

for “Trivia” state

Event handlers

for “Help” state

27

Time to code: Build a local search skill

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

developer.amazon.com

Skill information

Interaction model

End to end testing

aws.amazon.com

Skill logic

Lambda

Lamdba testing

Check in for the event:

Bit.ly/alexacheckin – event name #Re:Invent

Thank you!

top related