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

Build a ChatBot in 10 minutes!

Dave Kerr
October 27, 2017

Build a ChatBot in 10 minutes!

Use serverless technology such as AWS Lambda to build a chatbot with AWS Lex

Dave Kerr

October 27, 2017
Tweet

More Decks by Dave Kerr

Other Decks in Technology

Transcript

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

    View Slide

  2. …or… chatbot jugaad!
    @dwmkerr
    #inserverless

    View Slide

  3. Thank-you to the organisers and sponsors!

    View Slide

  4. Who am I?
    @dwmkerr
    #inserverless

    View Slide

  5. I am a technology consultant.
    @dwmkerr
    #inserverless

    View Slide

  6. View Slide

  7. Which is closer to this…
    @dwmkerr
    #inserverless

    View Slide

  8. View Slide

  9. What am I going to talk about?
    @dwmkerr
    #inserverless

    View Slide

  10. Chatbots!
    @dwmkerr
    #inserverless
    Perfect for serverless technology. Today is about fun, not ROI!

    View Slide

  11. …I’ve got to come clean about
    something…
    @dwmkerr
    #inserverless

    View Slide

  12. …I know almost nothing about
    chatbots!
    @dwmkerr
    #inserverless

    View Slide

  13. Lawrence Hunt, Selin Lanzafame, Dave Kerr

    View Slide

  14. Introducing Lex
    @dwmkerr
    #inserverless

    View Slide

  15. “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

    View Slide

  16. Say what?
    @dwmkerr
    #inserverless

    View Slide

  17. Let’s see it in action!
    @dwmkerr
    #inserverless

    View Slide

  18. Demo 1: Get a boring-bot running
    https://github.com/dwmkerr/lex-starter-kit
    refs/heads/demo1
    @dwmkerr
    #inserverless

    View Slide

  19. We setup the project with make setup
    @dwmkerr
    #inserverless

    View Slide

  20. We can deploy lex models with make deploy

    View Slide

  21. Here’s how our conversation looks so far
    @dwmkerr
    #inserverless

    View Slide

  22. Getting Input
    @dwmkerr
    #inserverless

    View Slide

  23. Most conversations need input!
    @dwmkerr
    #inserverless

    View Slide

  24. Demo 2: Getting Input with Slots
    https://github.com/dwmkerr/lex-starter-kit
    refs/heads/demo2
    @dwmkerr
    #inserverless

    View Slide

  25. We configure the environment with make config

    View Slide

  26. We can deploy lex models with make deploy

    View Slide

  27. Our conversation flow is now more complete

    View Slide

  28. Cool kids use the shell for
    everything
    github.com/dwmkerr/effective-shell
    @dwmkerr
    #inserverless

    View Slide

  29. Intermission: Using lex-chat
    https://github.com/dwmkerr/lex-chat
    @dwmkerr
    #inserverless

    View Slide

  30. Using sessions to manage
    conversation state
    @dwmkerr
    #inserverless

    View Slide

  31. Sometimes we have state which
    we build up over a conversation…
    @dwmkerr
    #inserverless

    View Slide

  32. Demo 3: Sessions
    https://github.com/dwmkerr/lex-starter-kit
    refs/heads/demo3
    @dwmkerr
    #inserverless

    View Slide

  33. Use the session to persist conversation state
    between intents

    View Slide

  34. This gets complex! When do you
    clear a session?
    At least you save time on the
    scripting J
    @dwmkerr
    #inserverless

    View Slide

  35. 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

    View Slide

  36. Thanks!
    @dwmkerr
    dwmkerr.com
    github.com/dwmkerr
    linkedin.com/in/dwmkerr

    View Slide

  37. Appendices
    @dwmkerr
    #inserverless

    View Slide

  38. 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

    View Slide