build a chatbot in 10 minutes!

38
Build a ChatBot in 10 Minutes! Serverless Summit 2017, Bangalore @dwmkerr #inserverless Dave Kerr Senior Expert, McKinsey & Company

Upload: dave-kerr

Post on 22-Jan-2018

227 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Build a ChatBot in 10 minutes!

Build a ChatBot in 10 Minutes!Serverless Summit 2017, Bangalore

@dwmkerr

#inserverless

Dave Kerr

Senior Expert, McKinsey & Company

Page 2: Build a ChatBot in 10 minutes!

…or… chatbot jugaad!

@dwmkerr

#inserverless

Page 3: Build a ChatBot in 10 minutes!

Thank-you to the organisers and sponsors!

Page 4: Build a ChatBot in 10 minutes!

Who am I?

@dwmkerr

#inserverless

Page 5: Build a ChatBot in 10 minutes!

I am a technology consultant.

@dwmkerr

#inserverless

Page 6: Build a ChatBot in 10 minutes!
Page 7: Build a ChatBot in 10 minutes!

Which is closer to this…

@dwmkerr

#inserverless

Page 8: Build a ChatBot in 10 minutes!
Page 9: Build a ChatBot in 10 minutes!

What am I going to talk about?

@dwmkerr

#inserverless

Page 10: Build a ChatBot in 10 minutes!

Chatbots!

@dwmkerr

#inserverless

Perfect for serverless technology. Today is about fun, not ROI!

Page 11: Build a ChatBot in 10 minutes!

…I’ve got to come clean about

something…

@dwmkerr

#inserverless

Page 12: Build a ChatBot in 10 minutes!

…I know almost nothing about

chatbots!

@dwmkerr

#inserverless

Page 13: Build a ChatBot in 10 minutes!

Lawrence Hunt, Selin Lanzafame, Dave Kerr

Page 14: Build a ChatBot in 10 minutes!

Introducing Lex

@dwmkerr

#inserverless

Page 15: Build a ChatBot in 10 minutes!

“Amazon Lex is an AWS service for building conversational interfaces for any applications using

voice and text. With Amazon Lex, the same conversational engine that powers Amazon Alexa

is now available to any developer, enabling you to build sophisticated, natural language

chatbots into your new and existing applications. Amazon Lex provides the deep functionality

and flexibility of natural language understanding (NLU) and automatic speech recognition

(ASR) so you can build highly engaging user experiences with lifelike, conversational

interactions, and create new categories of products.”

@dwmkerr

#inserverless

Page 16: Build a ChatBot in 10 minutes!

Say what?

@dwmkerr

#inserverless

Page 17: Build a ChatBot in 10 minutes!

Let’s see it in action!

@dwmkerr

#inserverless

Page 18: Build a ChatBot in 10 minutes!

Demo 1: Get a boring-bot running

https://github.com/dwmkerr/lex-starter-kit

refs/heads/demo1

@dwmkerr

#inserverless

Page 19: Build a ChatBot in 10 minutes!

We setup the project with make setup

@dwmkerr

#inserverless

Page 20: Build a ChatBot in 10 minutes!

We can deploy lex models with make deploy

Page 21: Build a ChatBot in 10 minutes!

Here’s how our conversation looks so far

@dwmkerr

#inserverless

Page 22: Build a ChatBot in 10 minutes!

Getting Input

@dwmkerr

#inserverless

Page 23: Build a ChatBot in 10 minutes!

Most conversations need input!

@dwmkerr

#inserverless

Page 24: Build a ChatBot in 10 minutes!

Demo 2: Getting Input with Slots

https://github.com/dwmkerr/lex-starter-kit

refs/heads/demo2

@dwmkerr

#inserverless

Page 25: Build a ChatBot in 10 minutes!

We configure the environment with make config

Page 26: Build a ChatBot in 10 minutes!

We can deploy lex models with make deploy

Page 27: Build a ChatBot in 10 minutes!

Our conversation flow is now more complete

Page 28: Build a ChatBot in 10 minutes!

Cool kids use the shell for

everythinggithub.com/dwmkerr/effective-shell

@dwmkerr

#inserverless

Page 29: Build a ChatBot in 10 minutes!

Intermission: Using lex-chat

https://github.com/dwmkerr/lex-chat

@dwmkerr

#inserverless

Page 30: Build a ChatBot in 10 minutes!

Using sessions to manage

conversation state

@dwmkerr

#inserverless

Page 31: Build a ChatBot in 10 minutes!

Sometimes we have state which we

build up over a conversation…

@dwmkerr

#inserverless

Page 32: Build a ChatBot in 10 minutes!

Demo 3: Sessions

https://github.com/dwmkerr/lex-starter-kit

refs/heads/demo3

@dwmkerr

#inserverless

Page 33: Build a ChatBot in 10 minutes!

Use the session to persist conversation state between

intents

Page 34: Build a ChatBot in 10 minutes!

This gets complex! When do you

clear a session?

At least you save time on the

scripting

@dwmkerr

#inserverless

Page 35: Build a ChatBot in 10 minutes!

Bootstrap your bots, and join in for

the next set of features!github.com/dwmkerr/lex-starter-kit

github.com/dwmkerr/lex-chat

@dwmkerr

#inserverless

Page 36: Build a ChatBot in 10 minutes!

Thanks!

@dwmkerr

dwmkerr.com

github.com/dwmkerr

linkedin.com/in/dwmkerr

Page 37: Build a ChatBot in 10 minutes!

Appendices

@dwmkerr

#inserverless

Page 38: Build a ChatBot in 10 minutes!

Tips and Tricks

• Question marks in intent utterances will break Lex!

• Train with realistic data

• Complicated or very variable slots are very hard to work with (e.g.

sentences), consider using cards

• Encrypt sensitive environment variables such as keys when using lambda

functions

@dwmkerr

#inserverless