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.

705df02f597ff36f900251c749e879cf?s=128

Gillian Armstrong

May 15, 2018
Tweet

Transcript

  1. Smarter Serverless Chatbots Gillian Armstrong

  2. 2 Liberty Information Technology Gillian Armstrong @virtualgill Technologist, Cognitive Technologies

    Liberty IT / Workgrid Software
  3. 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
  4. Gillian Armstrong @virtualgill

  5. 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
  6. Gillian Armstrong @virtualgill

  7. Gillian Armstrong @virtualgill

  8. Gillian Armstrong @virtualgill

  9. So what is needed for a smarter chatbot? Gillian Armstrong

    @virtualgill
  10. Get the right Use Case 1 Gillian Armstrong @virtualgill

  11. Quick Easy Commands Tell me the weather Turn on the

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

    the day Gillian Armstrong @virtualgill
  13. Simple Data Collection I’d like a black coffee What size?

    Large Gillian Armstrong @virtualgill
  14. 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
  15. 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
  16. 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
  17. Gillian Armstrong @virtualgill

  18. https://www.workgrid.com

  19. Get your NLU training model right 2 Gillian Armstrong @virtualgill

  20. Chatbots aren’t magic (although I wish they were) Gillian Armstrong

    @virtualgill
  21. Gillian Armstrong @virtualgill

  22. ORDER COFFEE Intent Utterance ORDER JUICE ORDER SHAKE Gillian Armstrong

    @virtualgill
  23. ORDER COFFEE Intent Utterance ORDER JUICE ORDER SHAKE Fulfillment Gillian

    Armstrong @virtualgill
  24. 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
  25. Gillian Armstrong @virtualgill

  26. Gillian Armstrong @virtualgill

  27. 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
  28. Gillian Armstrong @virtualgill

  29. CAT DOG ZEBRA Gillian Armstrong @virtualgill

  30. 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
  31. 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
  32. 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
  33. 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
  34. Remember a chatbot is still an Application, just one with

    a new Interface 3 Gillian Armstrong @virtualgill
  35. Chatbots aren’t magic (although I wish they were) Gillian Armstrong

    @virtualgill
  36. 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
  37. CONTEXT CONVERSATION SESSION … AWS Lambda AWS Lambda Amazon DynamoDB

    Amazon DynamoDB IAM AWS X-Ray Amazon API Gateway THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE
  38. 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
  39. 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
  40. 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
  41. Why Serverless? Gillian Armstrong @virtualgill

  42. “Don’t be a serverless hipster” Gillian Armstrong @virtualgill

  43. “be a serverless hipster” Gillian Armstrong @virtualgill

  44. Serverless means you don’t pay if no-one talks to your

    bot… Gillian Armstrong @virtualgill
  45. 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
  46. Lambdas are quick to develop, isolate small pieces of functionality

    and allow you to scale different parts of the conversation independently. Gillian Armstrong @virtualgill
  47. 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
  48. 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
  49. Be careful! Gillian Armstrong @virtualgill

  50. 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
  51. 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
  52. 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
  53. Write a great Conversation 4 Gillian Armstrong @virtualgill

  54. It’s not poor AI that’s ‘killing’ chatbots – it’s a

    lack of understanding of good conversational interaction design Gillian Armstrong @virtualgill
  55. In a chatbot, Conversation is the Interface Gillian Armstrong @virtualgill

  56. Source: http://hosanna1.com/

  57. 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
  58. 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
  59. 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
  60. 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
  61. Know how to Analyse and Use Conversational Data 5 Gillian

    Armstrong @virtualgill
  62. 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
  63. 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
  64. CHAT STREAM ANALYTICS Amazon CloudWatch Amazon ES Amazon Athena Amazon

    S3 Amazon API Gateway THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE
  65. None
  66. 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
  67. 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
  68. 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
  69. Got questions? Let’s chat! @virtualgill http://virtualgill.io

  70. 70 Liberty Information Technology Gillian Armstrong @virtualgill Technologist, Cognitive Technologies

    Liberty IT / Workgrid Software