build, deploy & operate intelligent chatbots with amazon...

30
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian Massingham | AWS Technical Evangelist @IanMmmm aws.amazon.com/lex

Upload: others

Post on 20-May-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Build, Deploy & Operate Intelligent Chatbots with Amazon Lex

Ian Massingham | AWS Technical Evangelist @IanMmmm

aws.amazon.com/lex

Page 2: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Building Chatbots with Amazon Lex

Why did we build Amazon Lex?

What is Amazon Lex?

How do I get started using Amazon Lex?

Q&A

Page 3: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Why Did We Build Amazon Lex?

Page 4: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Advent of Conversational Interactions

1st Gen: Punch Cards & Memory Registers

2nd Gen: Pointers & Sliders

3nd Gen: Conversational Interfaces

Page 5: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Natural

Conversational Access to ApplicationsConversational Access

On-demand

Accessible

Efficient

Natural

On-demand

Accessible

Efficient

Page 6: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Amazon Lex: A service for building conversational interfaces using voice and text

Page 7: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Amazon Lex - FeaturesText and speech language understanding: powered by the same technology as Alexa

Enterprise SaaS connectors: connect to enterprise systems

Deployment to chat services

Designed for builders: efficient and intuitive tools to build conversations; scales automatically

Versioning and alias support@

Page 8: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Text and Speech Language Understanding

Speech Recognition

Natural Language Understanding

Powered by the same deep learning technology as Alexa

Page 9: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Amazon Lex

Scale

Business Logic

SecurityAnalytics

Text to Speech

Speech to Intent

End to End

Native support & maintains context

One-click deployment

Completely managed service

Native integration with AWS Lambda

Encrypted data in transit & at

rest

Monitor and improve

Amazon Polly integrated into API

ASR + NLU integrated into one API

Dialog Management Deployment

Page 10: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Designed for Builders

Efficient and intuitive tools to build conversations

Page 11: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Versioning and Alias Support

AliasVersioning

• Supported for Intents, Slots & Bots

• Enables multi-developer environment

• Rollback to previous versions

• Deploy different aliases to different platforms

• Run different stacks for dev, stage & prod environments

• Target different user groups with different aliases

v1 v2 v3 latest

v1 Dev

v2 Stage

v3 Prod

Page 12: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Amazon Lex

Utterances Spoken or typed phrases that invoke your intent

BookHotelIntents An Intent performs an action in response to natural language user input

Slots Slots are input data required to fulfill the intent

Fulfilment Fulfilment mechanism for your intent

Page 13: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

“Book a Hotel”

Book Hotel

NYC

“Book a Hotel in NYC”

Automatic Speech Recognition

Hotel Booking

New York City

Natural Language Understanding

Intent/Slot Model

UtterancesHotel Booking

City New York City

Check In Nov 30th

Check Out Dec 2nd

“Your hotel is booked for Nov 30th”

Polly Confirmation: “Your hotel is booked for Nov 30th”

“Can I go ahead with the booking?

a

in

Page 14: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Utterances

I’d like to book a hotel

I want to make my hotel reservations

I want to book a hotel in New York City

Can you help me book my hotel?

Page 15: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Slots

destination City New York City, Seattle, London, …

Slot Type Values

Check In Date Valid dates

Check Out Date Valid dates

Page 16: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Slot Elicitation

I’d like to book a hotel

What date do you check in?

New York City

Sure what city do you want to book?

Nov 30th Check In 11/30/2017

City New York City

Page 17: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Fulfilment

AWS Lambda Integration Return to Client

User input parsed to derive intents and slot values.

Output returned to client for further processing.

Intents and slots passed to AWS Lambda function for

business logic implementation.

Page 18: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Save, Build, and Publish

Save Build

Saving your bot preserves the current state on the server

Building your bot creates versions that

you can test

Publish

Publishing your app will create a version of your bot and provide an

alias to your clients

Test

Test your bot in a chat window on the console

Page 19: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Monitoring

Track your bot

Request Latency

Missed Utterance Count

Traffic by Channel

Page 20: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Amazon Lex Pricing

  Text Speech

Price per 1000 requests $0.75 $4.00

Free Tier* (requests per month) 10,000 5,000

*Available for the first year upon sign-up to new Amazon Lex customers

Page 21: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Demo:

You make the demo!

Score me & leave feedback with my Amazon Lex Chatbot at facebook.com/ian.massingham.aws

Page 22: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Facebook Channel

Lex

Voice over PSTN

ConnectAre you on Twitter?

Sure. I'm on Twitter at https://twitter.com/IanMmmm. Follow me there.

What about GitHub?

You can find my GitHub account at https://github.com/ianmas-aws

Web App

facebook.com/ian.massingham.aws

https://bit.ly/rating-my-talk

Page 23: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

facebook.com/ian.massingham.aws

https://bit.ly/rating-my-talk

Which session do you want to leave feedback on? Ian

I want to leave feedback

Which session do you want to leave feedback on?

Deep Dive: Amazon Lex

What date was this session on?

Today

Which city did this session take place in?

Page 24: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

AWS LambdaAmazon Lex

Dialog & Fulfilment Code Hook

Slot Validation Slot Elicitation

Kinesis StreamKinesis Firehose Delivery Steam

Intent Resolution Session Management

Slot Extraction Channels (webhooks)

Amazon KinesisAmazon

Elasticsearch service

Amazon Comprehend

Sentiment Analysis

Record Ingest

Ingest

Record Storage, Indexing & Search

Dashboards

Page 25: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Kinesis Elasticsearch + Kibana

Lex Lambda

Comprehend

Voice over PSTN

Connect

AthenaS3 QuickSight

Facebook Channel

Web App

Page 26: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Dialogue & Validation Function Structure

Intent Router

RateSession Elicit & Validate Slots

Post to Kinesis Stream

ProvideFeedbackElicit &

Validate SlotsSentiment

EnrichmentPost to

Kinesis Stream✅

Thanks

Page 27: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Amazon Lex - Technology

Amazon Lex

Automatic Speech Recognition (ASR)

Natural Language Understanding (NLU)

Same technology that powers Alexa

Cognito CloudTrail CloudWatch

AWS Services

ActionAWS Lambda

Authentication & Visibility

Speech API

Language API

Fulfillment

End-Users

Developers

Console

SDK

Intents, Slots, Prompts, Utterances

Input: Speech or Text

Multi-Platform Clients: Mobile, IoT, Web,

Chat

API

Output: Speech (via Polly TTS) or Text

Page 28: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

How Do I Get Started Using Amazon Lex?

Page 29: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

Sign up for a free account @ https://aws.amazon.com/lex

Build your first bot!

✔✔✔

Page 30: Build, Deploy & Operate Intelligent Chatbots with Amazon Lexaws-de-media.s3.amazonaws.com/images/DevDays 2018... · Build, Deploy & Operate Intelligent Chatbots with Amazon Lex Ian

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

Thank You. Any questions?Score me & leave feedback with my Amazon Lex Chatbot at facebook.com/ian.massingham.aws

Ian Massingham | AWS Technical Evangelist @IanMmmm

aws.amazon.com/lex [email protected]