Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Smarter Serverless Chatbots

Smarter Serverless Chatbots

Building a simple chatbot is simple - building a great one takes a lot more work. Serverless technology and AI services have put very powerful tools into any developer’s hands, but the ease of using them can make us forget some very basic things - and not even spot some more complex ones.

So, set aside that chatbot you created with that 30min online tutorial. Let me walk you through the journey of designing and building a smarter chatbot using the learnings from my own experiences and mistakes building a digital assistant chatbot.

Gillian Armstrong

May 15, 2018
Tweet

More Decks by Gillian Armstrong

Other Decks in Technology

Transcript

  1. Our chatbot is built on AWS with Amazon Lex, but

    all the tips are applicable to all platforms Disclaimer Not all Chatbots use Artificial Intelligence, but today we’re only going to talk about those that use Natural Language Understanding Gillian Armstrong @virtualgill
  2. Utterance What the user said Entities Variables like names, places,

    dates or times Intents What the user means Fulfilment What action to take Response Natural Language Processing Natural Language Understanding Text to Speech Automatic Speech Recognition Gillian Armstrong @virtualgill
  3. Quick Easy Commands Tell me the weather Turn on the

    lights! Gillian Armstrong @virtualgill
  4. Large Lookups and Lists Tell me all the deals of

    the day Gillian Armstrong @virtualgill
  5. Simple FAQs What time are you open at? Your chatbot

    can handle the simple questions so you have more time, it can talk to everyone at once, and it never needs to sleep Gillian Armstrong @virtualgill
  6. Anything that is easier to do without a chatbot How

    do users do this right now? me reminding you not to just build a chatbot without considering other options Sketch from @malweene Gillian Armstrong @virtualgill
  7. Why did we build a Chatbot? We work in a

    large Fortune 100 Company, this means lots of big legacy internal systems and information in lots of different places. We wanted to provide “one place to go” where you could ask your question just the same as you would to a colleague or the help desk…and get an answer, or even some get tasks done for you. Gillian Armstrong @virtualgill
  8. Intent Utterance I’d like a coffee Please may I have

    coffee One coffee I’ll take a coffee I want to order a coffee Get me a coffee, thanks I would like to order a juice I’ll take a juice Get me a juice Juice please I want a juice Get me a shake I am going to order a shake One shake please I’ll have a shake My order is a shake Gillian Armstrong @virtualgill
  9. Intent Utterance I’d like a coffee Please may I have

    coffee One coffee I’ll take a coffee I want to order a coffee Get me a coffee, thanks I would like to order a juice I’ll take a juice Get me a juice Juice please I want a juice Get me a shake I am going to order a shake One shake please I’ll have a shake My order is a shake Gillian Armstrong @virtualgill
  10. Intent Utterance I’d like a coffee Please may I have

    coffee One coffee I’ll take a coffee I want to order a coffee Get me a coffee, thanks I would like to order a juice I’ll take a juice Get me a juice Juice please I want a juice Get me a shake I am going to order a shake One shake please I’ll have a shake My order is a shake Gillian Armstrong @virtualgill
  11. Intent Utterance I’d like a {DRINK} Please may I have

    {DRINK} One {DRINK} I’ll take a {DRINK} I want to order a {DRINK} Get me a {DRINK} thanks I would like to order a {DRINK} {DRINK} please I want a {DRINK} Get me a {DRINK} I am going to order a {DRINK} One {DRINK} I’ll have a {DRINK} My order is a {DRINK} Coffee Juice Shake … {DRINK} Entity Gillian Armstrong @virtualgill
  12. Intent Utterance I’d like a {DRINK} Please may I have

    {DRINK} One {DRINK} I’ll take a {DRINK} I want to order a {DRINK} Get me a {DRINK} thanks I would like to order a {DRINK} {DRINK} please I want a {DRINK} Get me a {DRINK} I am going to order a {DRINK} One {DRINK} I’ll have a {DRINK} My order is a {DRINK} Energizer Iron Man Stress Down Veggie Focus Herb Tonic Avo Shake Coffee Shake Choco Shake Uppercut Ginger Shot Espresso Cup of Joe Flat White … {DRINK} Entity Gillian Armstrong @virtualgill
  13. You wouldn’t make up training data for other ML –

    don’t make up your conversational data either. Get it from your users. Gillian Armstrong @virtualgill
  14. Remember a chatbot is still an Application, just one with

    a new Interface 3 Gillian Armstrong @virtualgill
  15. CONTEXT CONVERSATION SESSION CHAT STREAM ANALYTICS NLP + INTENT MAPPING

    FULFILLMENT … Amazon Lex Amazon VPC AWS Direct Connect AWS Lambda AWS Lambda Amazon DynamoDB Amazon DynamoDB AWS Lambda Amazon CloudWatch Amazon ES IAM Amazon Polly Amazon S3 AWS X-Ray Amazon API Gateway Amazon Athena Amazon S3 Amazon API Gateway THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE
  16. CONTEXT CONVERSATION SESSION … AWS Lambda AWS Lambda Amazon DynamoDB

    Amazon DynamoDB IAM AWS X-Ray Amazon API Gateway THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE
  17. CONTEXT CONVERSATION SESSION NLP + INTENT MAPPING … Amazon Lex

    AWS Lambda AWS Lambda Amazon DynamoDB Amazon DynamoDB IAM Amazon Polly AWS X-Ray Amazon API Gateway THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE
  18. CONTEXT CONVERSATION SESSION NLP + INTENT MAPPING FULFILLMENT … Amazon

    Lex Amazon VPC AWS Direct Connect AWS Lambda AWS Lambda Amazon DynamoDB Amazon DynamoDB AWS Lambda IAM Amazon Polly Amazon S3 AWS X-Ray Amazon API Gateway THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE
  19. CONTEXT CONVERSATION SESSION CHAT STREAM ANALYTICS NLP + INTENT MAPPING

    FULFILLMENT … Amazon Lex Amazon VPC AWS Direct Connect AWS Lambda AWS Lambda Amazon DynamoDB Amazon DynamoDB AWS Lambda Amazon CloudWatch Amazon ES IAM Amazon Polly Amazon S3 AWS X-Ray Amazon API Gateway Amazon Athena Amazon S3 Amazon API Gateway THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE
  20. Serverless means you don’t pay if no-one talks to your

    bot… Gillian Armstrong @virtualgill
  21. Serverless means you don’t pay if no-one talks to your

    bot… …and lets you scale seamlessly if everyone wants to talk to your bot! Gillian Armstrong @virtualgill
  22. Lambdas are quick to develop, isolate small pieces of functionality

    and allow you to scale different parts of the conversation independently. Gillian Armstrong @virtualgill
  23. Being able to change quickly is vital, because you won’t

    get it right first time. Users will surprise you, you’ll want to keep adding new functionality, and getting natural language understanding to work well takes effort. Gillian Armstrong @virtualgill
  24. You can build faster and change faster by using as

    many managed services as possible. No to servers, yes to services. A chatbot’s power is in its connected services Gillian Armstrong @virtualgill
  25. It’s important you know the SLA for any APIs you

    call – how fast do they return? API Lambda function Conversation (especially with Voice) needs to be fast Gillian Armstrong @virtualgill
  26. Conversation (especially with Voice) needs to be fast Make sure

    everything in your architecture scales as well as your lambdas – performance test to verify! API Lambda functions Amazon DynamoDB Gillian Armstrong @virtualgill
  27. Monitor, no, seriously, monitor If your chatbot stopped working, would

    you know? If you have to wait for user complaints you’ve already lost users. Gillian Armstrong @virtualgill
  28. It’s not poor AI that’s ‘killing’ chatbots – it’s a

    lack of understanding of good conversational interaction design Gillian Armstrong @virtualgill
  29. HUMANS TECHNOLOGY HUMAN-COMPUTER INTERACTION psychology emotion mental models mental processing

    expectation & affordance memory & attention social AI product design copywriting script writing storytelling conversational design voice design personality design creativity imagination language analysis conversational & voice ux data science ML NLP NLU AI cloud services software engineering soundscape design cognitive & socio-linguistics
  30. HUMANS TECHNOLOGY HUMAN-COMPUTER INTERACTION psychology emotion mental models mental processing

    expectation & affordance memory & attention social AI product design copywriting script writing storytelling conversational design voice design personality design creativity imagination language analysis conversational & voice ux data science ML NLP NLU AI cloud services software engineering soundscape design cognitive & socio-linguistics
  31. HUMANS TECHNOLOGY HUMAN-COMPUTER INTERACTION psychology emotion mental models mental processing

    expectation & affordance memory & attention social AI product design copywriting script writing storytelling conversational design voice design personality design creativity imagination language analysis conversational & voice ux data science ML NLP NLU AI cloud services software engineering soundscape design cognitive & socio-linguistics
  32. HUMANS TECHNOLOGY HUMAN-COMPUTER INTERACTION psychology emotion mental models mental processing

    expectation & affordance memory & attention social AI product design copywriting script writing storytelling conversational design voice design personality design creativity imagination language analysis conversational & voice ux data science ML NLP NLU AI cloud services software engineering soundscape design cognitive & socio-linguistics Gillian Armstrong @virtualgill
  33. Conversational Analytics are vital Is a long conversation better or

    worse? How critical are returning customers? Work out what metrics you need to track to know how your chatbot is performing. Gillian Armstrong @virtualgill
  34. CONTEXT CONVERSATION SESSION CHAT STREAM ANALYTICS NLP + INTENT MAPPING

    FULFILLMENT … Amazon Lex Amazon VPC AWS Direct Connect AWS Lambda AWS Lambda Amazon DynamoDB Amazon DynamoDB AWS Lambda Amazon CloudWatch Amazon ES IAM Amazon Polly Amazon S3 AWS X-Ray Amazon API Gateway Amazon Athena Amazon S3 Amazon API Gateway THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE
  35. CHAT STREAM ANALYTICS Amazon CloudWatch Amazon ES Amazon Athena Amazon

    S3 Amazon API Gateway THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE
  36. Examples of our Analytics Number of users Number of conversations

    Length of conversations What functionality is being used Where we are getting it right What people want us to add Where we are getting it wrong Gillian Armstrong @virtualgill
  37. Getting Feedback is essential. Work to rapidly be able to

    fix what isn’t working, and add more of what is! You won’t get it right first time – listen to your users, and monitor how well intent recognition is working. Gillian Armstrong @virtualgill
  38. Get the right Use Case Get your NLU training model

    right Remember, it’s still an Application Write a great Conversation Know how to Analyse Conversational Data Have an AWESOME Chatbot Smarter Serverless Chatbot Checklist Gillian Armstrong @virtualgill