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. Smarter Serverless
    Chatbots
    Gillian Armstrong

    View full-size slide

  2. 2
    Liberty Information Technology
    Gillian Armstrong @virtualgill
    Technologist, Cognitive Technologies
    Liberty IT / Workgrid Software

    View full-size slide

  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

    View full-size slide

  4. Gillian Armstrong @virtualgill

    View full-size slide

  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

    View full-size slide

  6. Gillian Armstrong @virtualgill

    View full-size slide

  7. Gillian Armstrong @virtualgill

    View full-size slide

  8. Gillian Armstrong @virtualgill

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  11. Quick Easy Commands
    Tell me the
    weather
    Turn on
    the lights!
    Gillian Armstrong @virtualgill

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  17. Gillian Armstrong @virtualgill

    View full-size slide

  18. https://www.workgrid.com

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  21. Gillian Armstrong @virtualgill

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  25. Gillian Armstrong @virtualgill

    View full-size slide

  26. Gillian Armstrong @virtualgill

    View full-size slide

  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

    View full-size slide

  28. Gillian Armstrong @virtualgill

    View full-size slide

  29. CAT DOG ZEBRA
    Gillian Armstrong @virtualgill

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  34. Remember a
    chatbot is still an
    Application,
    just one with a
    new Interface
    3
    Gillian Armstrong @virtualgill

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  41. Why Serverless?
    Gillian Armstrong @virtualgill

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  49. Be careful!
    Gillian Armstrong @virtualgill

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  53. Write a great
    Conversation
    4
    Gillian Armstrong @virtualgill

    View full-size slide

  54. It’s not poor AI that’s
    ‘killing’ chatbots – it’s a
    lack of understanding of
    good conversational
    interaction design
    Gillian Armstrong @virtualgill

    View full-size slide

  55. In a chatbot,
    Conversation is
    the Interface
    Gillian Armstrong @virtualgill

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  61. Know how to
    Analyse and Use
    Conversational Data
    5
    Gillian Armstrong @virtualgill

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  64. CHAT STREAM
    ANALYTICS
    Amazon
    CloudWatch
    Amazon ES
    Amazon
    Athena Amazon
    S3
    Amazon API
    Gateway
    THE DIGITAL ASSISTANT BOT PLATFORM ARCHITECTURE

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  68. Got questions?
    Let’s chat!
    @virtualgill
    http://virtualgill.io

    View full-size slide

  69. 70
    Liberty Information Technology
    Gillian Armstrong @virtualgill
    Technologist, Cognitive Technologies
    Liberty IT / Workgrid Software

    View full-size slide