SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Jhen-Wei Huang (黃振維)
Solutions Architect, AWS
Integrate Your Amazon Lex
Chatbot with Any Messaging
Service
October 12, 2017
Sponsor
Overview
• “Alexa, What is Amazon Lex?”
• Going Serverless (AWS Lambda & Amazon API
Gateway)
• Integrating with Facebook
• Teach Your Bot How to Text with Twilio SMS
• Can we talk? Adding Support for Voice
The Need for Amazon Lex
Amazon Lex
Graphical User
Interface
Conversational
Interface
Text and Speech Language Understanding
Speech
Recognition
Natural Language
Understanding
Powered by the same Deep Learning technology as Alexa
Lex Bot Structure
Utterances
Spoken or typed phrases that invoke
your intent
BookHotel
Intents
An Intent performs an action in
response to natural language user
input
Slots
Slots are input data required to fulfill
the intent
Fulfillment
Fulfillment mechanism for your intent
“Book a Hotel”
Book Hotel
Taipei
“Book a Hotel in
Taipei”
Automatic Speech
Recognition
Hotel Booking
Taipei City
Natural Language
Understanding
Intent/Slot
Model
Utterances
Hotel Booking
City Taipei City
Check In Nov 30th
Check Out Dec 2nd
“Your hotel is booked for
Nov 30th”
Amazon Polly
Confirmation: “Your hotel
is booked for Nov 30th”
a
in
“Can I go ahead
with the booking?
Versioning and Alias Support
AliasVersioning
v1 v2 v3 latest
• Supported for Intents, Slots and Bots
• Enables multi-developer environment
• Rollback to previous versions
v1 Dev
v2 Stage
v3 Prod
• Deploy different aliases to different platforms
• Run different stacks for dev, stage and prod
environments
• Target different user groups with different
aliases
Save, Build, Test, and Publish
Save Build
Preserve the current
state on the server
Create versions
you can test
Publish
Create a version of your bot
with an alias for your clients
Test
Test your bot in a chat
window on the console
Amazon Lex: Use Cases
Informational Bots
Manage everyday consumer requests
Application Bots
Build powerful interfaces to mobile applications
• News updates
• Weather information
• FAQs ….
• Book tickets
• Order food
• Manage bank accounts ….
Enterprise Productivity Bots
Streamline enterprise work activities
• Check sales numbers
• Marketing performance
• Inventory status ….
Internet of Things (IoT) Bots
Enable conversational interfaces for device interactions
• Wearables
• Appliances
• Auto ….
Lex Console: Designed for Builders
Serverless, event-driven compute service
AWS Lambda = microservice without servers
AWS Lambda
Components of AWS Lambda
• An AWS Lambda function (that you write)
• An event source
• The AWS Lambda service
• The function networking environment
Amazon API Gateway
Create Configure Publish
Maintain Monitor Secure
Fully Managed Service for Your APIs
Built-in integrating Amazon
Lex with Facebook
#1: Create Facebook App
http://docs.aws.amazon.com/lex/latest/dg/fb-bot-association.html
#2: Create Page
#3: Create Page Access Token
#4: Create Lex Bot
#5: Setup Facebook Channel
#6: Setup Webhook
Testing the Integration
Integrating Amazon Lex with
Twilio SMS
Amazon LexLambda
Function
Amazon API
Gateway
End User Twilio
Programmable
SMS
Architecture / Message Flow
https://aws.amazon.com/blogs/ai/integrate-your-amazon-lex-bot-with-any-messaging-service/
Multi-Bot Design
“Concierge” Bot
AWS
Lambda
Function
Amazon API
Gateway
End User Multiple
Messaging
Services
Amazon
DynamoDB
“Flight-Booking”
Bot
“Cruise-Booking”
Bot
user-id current-
intent
bot ttl
867-5309 BookCruise Cruise-Booking 1494013599
“I want to book a cruise”
#1: Creating an Amazon Lex bot
https://console.aws.amazon.com/lex/home?region=us-east-1
#2: Setting up a Twilio Phone Number
https://www.twilio.com/try-twilio
#3: IAM Policy & the AWS Lambda Function
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"lex:PostText"
],
"Resource": [
"*"
]
}
]
}
AWS.config.region = 'us-east-1';
var lexruntime = new AWS.LexRuntime();
var userNumber = twilioSMS.From.replace('+', '');
var params = {
botAlias: process.env.BOT_ALIAS,
botName: process.env.BOT_NAME,
inputText: twilioSMS.Body,
userId: userNumber,
sessionAttributes: {
}
};
lexruntime.postText(params, function(err, data) {
var twimlResponse = new twilio.TwimlResponse();
if (err) {
console.log(err, err.stack); // an error occurred
twimlResponse.message('Sorry, we ran into a problem at our end.');
callback(err, twimlResponse.toString());
} else {
console.log(data); // got something back from Amazon Lex
twimlResponse.message(data.message);
callback(null, twimlResponse.toString());
}
});
#4: HTTPS Endpoint using Amazon API
Gateway
#5: Configuring the Twilio Webhook
https://www.twilio.com/console
Your bot can now text!
Adding Support for Voice
• Amazon Lex can support both Text and Voice
• Use the Twilio <record> verb to prompt/record user input
• Utilize Amazon Lex’s PostContent API call (instead of
PostText)
• Accept: text/plain
• Convert to TwiML and send back to Twilio
Getting Started
https://console.aws.amazon.com/lex
Remember to complete
your evaluations!
Thank you!
Get Started: https://aws.amazon.com/lex
Lex Console: https://console.aws.amazon.com/lex

Más contenido relacionado

La actualidad más candente

SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentAmazon Web Services
 
SMC302 Building Serverless Web Applications
SMC302 Building Serverless Web ApplicationsSMC302 Building Serverless Web Applications
SMC302 Building Serverless Web ApplicationsAmazon Web Services
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaAmazon Web Services
 
Automate Migration to AWS with Datapipe
Automate Migration to AWS with DatapipeAutomate Migration to AWS with Datapipe
Automate Migration to AWS with DatapipeAmazon Web Services
 
Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
 Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T... Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...Amazon Web Services
 
SRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon AuroraSRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon AuroraAmazon Web Services
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaAmazon Web Services
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaAmazon Web Services
 
A Brief Look at Serverless Architecture
A Brief Look at Serverless ArchitectureA Brief Look at Serverless Architecture
A Brief Look at Serverless ArchitectureAmazon Web Services
 
HSBC and AWS Day - Security Identity and Access Management
HSBC and AWS Day - Security Identity and Access ManagementHSBC and AWS Day - Security Identity and Access Management
HSBC and AWS Day - Security Identity and Access ManagementAmazon Web Services
 
Journey Towards Scaling Your Application to 10 million users
Journey Towards Scaling Your Application to 10 million usersJourney Towards Scaling Your Application to 10 million users
Journey Towards Scaling Your Application to 10 million usersAmazon Web Services
 
Serverless by Example: Building a Real-Time Chat System
Serverless by Example: Building a Real-Time Chat SystemServerless by Example: Building a Real-Time Chat System
Serverless by Example: Building a Real-Time Chat SystemAmazon Web Services
 
Real-time Data Processing using AWS Lambda
Real-time Data Processing using AWS LambdaReal-time Data Processing using AWS Lambda
Real-time Data Processing using AWS LambdaAmazon Web Services
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
Deep Dive on Object Storage: Amazon S3 and Amazon Glacier
Deep Dive on Object Storage: Amazon S3 and Amazon GlacierDeep Dive on Object Storage: Amazon S3 and Amazon Glacier
Deep Dive on Object Storage: Amazon S3 and Amazon GlacierAdrian Hornsby
 

La actualidad más candente (20)

SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application Development
 
AWS Lambda Deep Dive
AWS Lambda Deep DiveAWS Lambda Deep Dive
AWS Lambda Deep Dive
 
SMC302 Building Serverless Web Applications
SMC302 Building Serverless Web ApplicationsSMC302 Building Serverless Web Applications
SMC302 Building Serverless Web Applications
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS Lambda
 
Automate Migration to AWS with Datapipe
Automate Migration to AWS with DatapipeAutomate Migration to AWS with Datapipe
Automate Migration to AWS with Datapipe
 
Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
 Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T... Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
 
SRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon AuroraSRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon Aurora
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS Lambda
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS Lambda
 
A Brief Look at Serverless Architecture
A Brief Look at Serverless ArchitectureA Brief Look at Serverless Architecture
A Brief Look at Serverless Architecture
 
HSBC and AWS Day - Security Identity and Access Management
HSBC and AWS Day - Security Identity and Access ManagementHSBC and AWS Day - Security Identity and Access Management
HSBC and AWS Day - Security Identity and Access Management
 
Journey Towards Scaling Your Application to 10 million users
Journey Towards Scaling Your Application to 10 million usersJourney Towards Scaling Your Application to 10 million users
Journey Towards Scaling Your Application to 10 million users
 
Serverless by Example: Building a Real-Time Chat System
Serverless by Example: Building a Real-Time Chat SystemServerless by Example: Building a Real-Time Chat System
Serverless by Example: Building a Real-Time Chat System
 
Real-time Data Processing using AWS Lambda
Real-time Data Processing using AWS LambdaReal-time Data Processing using AWS Lambda
Real-time Data Processing using AWS Lambda
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
Almacenamiento en la nube con AWS
Almacenamiento en la nube con AWSAlmacenamiento en la nube con AWS
Almacenamiento en la nube con AWS
 
Deep Dive on Object Storage: Amazon S3 and Amazon Glacier
Deep Dive on Object Storage: Amazon S3 and Amazon GlacierDeep Dive on Object Storage: Amazon S3 and Amazon Glacier
Deep Dive on Object Storage: Amazon S3 and Amazon Glacier
 

Similar a 把您的 Amazon Lex Chatbot 與訊息服務集成

Integrate Your Amazon Lex Chatbot with Any Messaging Service
Integrate Your Amazon Lex Chatbot with Any Messaging ServiceIntegrate Your Amazon Lex Chatbot with Any Messaging Service
Integrate Your Amazon Lex Chatbot with Any Messaging ServiceAmazon Web Services
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...Amazon Web Services
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Amazon Web Services
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Amazon Web Services
 
使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人 使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人 Amazon Web Services
 
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017Amazon Web Services
 
WIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS ServicesWIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS ServicesAmazon Web Services
 
Announcing Amazon Lex - January 2017 AWS Online Tech Talks
Announcing Amazon Lex - January 2017 AWS Online Tech TalksAnnouncing Amazon Lex - January 2017 AWS Online Tech Talks
Announcing Amazon Lex - January 2017 AWS Online Tech TalksAmazon Web Services
 
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017Amazon Web Services
 
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...Amazon Web Services
 
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)Amazon Web Services
 
Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018AWS Germany
 
Building a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda WorkshopBuilding a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda WorkshopAmazon Web Services
 
Building voice enabled Apps with Alexa voice service and Amazon Lex.
Building voice enabled Apps with Alexa voice service and Amazon Lex.     Building voice enabled Apps with Alexa voice service and Amazon Lex.
Building voice enabled Apps with Alexa voice service and Amazon Lex. Amazon Web Services
 
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...Amazon Web Services
 
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...Amazon Web Services
 
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)Amazon Web Services
 
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...Amazon Web Services
 

Similar a 把您的 Amazon Lex Chatbot 與訊息服務集成 (20)

Integrate Your Amazon Lex Chatbot with Any Messaging Service
Integrate Your Amazon Lex Chatbot with Any Messaging ServiceIntegrate Your Amazon Lex Chatbot with Any Messaging Service
Integrate Your Amazon Lex Chatbot with Any Messaging Service
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - May 2017 AWS O...
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
 
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
Integrate Your Amazon Lex Chatbot with Any Messaging Service - AWS Online Tec...
 
使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人 使用 Amazon Lex 在應用程式中建立對話式機器人
使用 Amazon Lex 在應用程式中建立對話式機器人
 
Introducing Amazon Lex
Introducing Amazon Lex Introducing Amazon Lex
Introducing Amazon Lex
 
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
Building a Better .NET Bot with AWS Services - WIN205 - re:Invent 2017
 
WIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS ServicesWIN205-Building a Better .NET Bot with AWS Services
WIN205-Building a Better .NET Bot with AWS Services
 
Announcing Amazon Lex - January 2017 AWS Online Tech Talks
Announcing Amazon Lex - January 2017 AWS Online Tech TalksAnnouncing Amazon Lex - January 2017 AWS Online Tech Talks
Announcing Amazon Lex - January 2017 AWS Online Tech Talks
 
Deep Dive: Amazon Lex
Deep Dive: Amazon LexDeep Dive: Amazon Lex
Deep Dive: Amazon Lex
 
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
Building ChatBots with Amazon Lex - AWS Summit Tel Aviv 2017
 
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
BDA306 An Introduction to Amazon Lex, your Service for Building Voice and Tex...
 
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
AWS re:Invent 2016: NEW LAUNCH! Introducing Amazon Lex (MAC304)
 
Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018Building Chatbots with Amazon Lex I AWS Dev Day 2018
Building Chatbots with Amazon Lex I AWS Dev Day 2018
 
Building a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda WorkshopBuilding a Chatbot with Amazon Lex and AWS Lambda Workshop
Building a Chatbot with Amazon Lex and AWS Lambda Workshop
 
Building voice enabled Apps with Alexa voice service and Amazon Lex.
Building voice enabled Apps with Alexa voice service and Amazon Lex.     Building voice enabled Apps with Alexa voice service and Amazon Lex.
Building voice enabled Apps with Alexa voice service and Amazon Lex.
 
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
Building Multichannel Conversational Interfaces Using Amazon Lex - MCL312 - r...
 
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
Serve Your Customers with AI from the Cloud: AWS Developer Workshop - Web Sum...
 
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
 
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
BDA306 NEW LAUNCH! An Introduction to Amazon Lex, your service for building v...
 

Más de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Más de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

把您的 Amazon Lex Chatbot 與訊息服務集成

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Jhen-Wei Huang (黃振維) Solutions Architect, AWS Integrate Your Amazon Lex Chatbot with Any Messaging Service October 12, 2017
  • 3. Overview • “Alexa, What is Amazon Lex?” • Going Serverless (AWS Lambda & Amazon API Gateway) • Integrating with Facebook • Teach Your Bot How to Text with Twilio SMS • Can we talk? Adding Support for Voice
  • 4. The Need for Amazon Lex Amazon Lex Graphical User Interface Conversational Interface
  • 5. Text and Speech Language Understanding Speech Recognition Natural Language Understanding Powered by the same Deep Learning technology as Alexa
  • 6. Lex Bot Structure Utterances Spoken or typed phrases that invoke your intent BookHotel Intents An Intent performs an action in response to natural language user input Slots Slots are input data required to fulfill the intent Fulfillment Fulfillment mechanism for your intent
  • 7. “Book a Hotel” Book Hotel Taipei “Book a Hotel in Taipei” Automatic Speech Recognition Hotel Booking Taipei City Natural Language Understanding Intent/Slot Model Utterances Hotel Booking City Taipei City Check In Nov 30th Check Out Dec 2nd “Your hotel is booked for Nov 30th” Amazon Polly Confirmation: “Your hotel is booked for Nov 30th” a in “Can I go ahead with the booking?
  • 8. Versioning and Alias Support AliasVersioning v1 v2 v3 latest • Supported for Intents, Slots and Bots • Enables multi-developer environment • Rollback to previous versions v1 Dev v2 Stage v3 Prod • Deploy different aliases to different platforms • Run different stacks for dev, stage and prod environments • Target different user groups with different aliases
  • 9. Save, Build, Test, and Publish Save Build Preserve the current state on the server Create versions you can test Publish Create a version of your bot with an alias for your clients Test Test your bot in a chat window on the console
  • 10. Amazon Lex: Use Cases Informational Bots Manage everyday consumer requests Application Bots Build powerful interfaces to mobile applications • News updates • Weather information • FAQs …. • Book tickets • Order food • Manage bank accounts …. Enterprise Productivity Bots Streamline enterprise work activities • Check sales numbers • Marketing performance • Inventory status …. Internet of Things (IoT) Bots Enable conversational interfaces for device interactions • Wearables • Appliances • Auto ….
  • 11. Lex Console: Designed for Builders
  • 12. Serverless, event-driven compute service AWS Lambda = microservice without servers AWS Lambda
  • 13. Components of AWS Lambda • An AWS Lambda function (that you write) • An event source • The AWS Lambda service • The function networking environment
  • 14. Amazon API Gateway Create Configure Publish Maintain Monitor Secure Fully Managed Service for Your APIs
  • 15.
  • 17. #1: Create Facebook App http://docs.aws.amazon.com/lex/latest/dg/fb-bot-association.html
  • 19. #3: Create Page Access Token
  • 24. Integrating Amazon Lex with Twilio SMS
  • 25. Amazon LexLambda Function Amazon API Gateway End User Twilio Programmable SMS Architecture / Message Flow https://aws.amazon.com/blogs/ai/integrate-your-amazon-lex-bot-with-any-messaging-service/
  • 26. Multi-Bot Design “Concierge” Bot AWS Lambda Function Amazon API Gateway End User Multiple Messaging Services Amazon DynamoDB “Flight-Booking” Bot “Cruise-Booking” Bot user-id current- intent bot ttl 867-5309 BookCruise Cruise-Booking 1494013599 “I want to book a cruise”
  • 27. #1: Creating an Amazon Lex bot https://console.aws.amazon.com/lex/home?region=us-east-1
  • 28. #2: Setting up a Twilio Phone Number https://www.twilio.com/try-twilio
  • 29. #3: IAM Policy & the AWS Lambda Function { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "lex:PostText" ], "Resource": [ "*" ] } ] } AWS.config.region = 'us-east-1'; var lexruntime = new AWS.LexRuntime(); var userNumber = twilioSMS.From.replace('+', ''); var params = { botAlias: process.env.BOT_ALIAS, botName: process.env.BOT_NAME, inputText: twilioSMS.Body, userId: userNumber, sessionAttributes: { } }; lexruntime.postText(params, function(err, data) { var twimlResponse = new twilio.TwimlResponse(); if (err) { console.log(err, err.stack); // an error occurred twimlResponse.message('Sorry, we ran into a problem at our end.'); callback(err, twimlResponse.toString()); } else { console.log(data); // got something back from Amazon Lex twimlResponse.message(data.message); callback(null, twimlResponse.toString()); } });
  • 30. #4: HTTPS Endpoint using Amazon API Gateway
  • 31. #5: Configuring the Twilio Webhook https://www.twilio.com/console
  • 32. Your bot can now text!
  • 33. Adding Support for Voice • Amazon Lex can support both Text and Voice • Use the Twilio <record> verb to prompt/record user input • Utilize Amazon Lex’s PostContent API call (instead of PostText) • Accept: text/plain • Convert to TwiML and send back to Twilio
  • 36.
  • 37. Thank you! Get Started: https://aws.amazon.com/lex Lex Console: https://console.aws.amazon.com/lex