Writing your first
smart chatbot
Ajay Viswanathan, Software Engineer - Sigmoid
@MonadicNomad
Machines should work,
people should think
- Jim Henson
Human Communication
• Complex - subtext, sarcasm
• Rich - body language, gestures, intonation
• Evolved over millennia
• Higher dynamic range of expressions
Online Communication
• Stripped of any emotion
• Hacks like Emoticons, Emoji, Gifs
• Shorthand, lingo, buzzwords - underline the basic
human need to be conveyed efficiently
Messaging today
• Rich media - audio, video, images, ¯_(ツ)_/¯
• Async
• Easy to consume on the go
• Informal tone
• Always connected
Why Messaging Apps might
take over native apps
• Next evolution in messaging apps - building
functionality into them
• Apps are bulky, discoverability and maintaining
them is an issue
• Trend is to shift towards consistent interactions
• Apps have taken note and started moving out of
their silos and becoming integrable services
Your UI is your product’s
humble compensation for not
being telepathic
- @mortenjust
Why the sudden Bot
uprising?
• Preceding advancements in Machine learning,
Natural language processing, scalable computing,
massive API ecosystem, improvements in
messaging and notification systems
What is a Bot?
• The future of web design according to some
• A program to simulate conversation, to
• Find information
• Connect to resources
• Learn keywords
• Think about responses
• Bot != Conversational AI (not necessarily)
What makes a great
bot?
• Adds value of some kind
• Requires minimal input/direction
• Reliable, robust like standard software
• Relieves stress for humans
• Anticipates needs of users
Design principles
• Not Being Human - don’t try too hard to make them appear human. They can still
have a personality
• Keep it simple in functionality - Bots need to walk before they can run
• Be as smart as a puppy - Be endearing enough when failures occur and keep
learning
• Optimize for end-user and messaging medium
• Always have a human fallback mode
• {Structured input + Retrieval response} > {Freeform input + Generative response} -
We at not an acceptable reliability level for the latter
• Use feedback analytics and keep improving the user experience
Common pitfalls
• Don’t attempt to replace tasks better done by a human
• Don’t add a feature just because it is cool. It needs to
have business value
• Don’t keep winding conversations - anything more than
2 exchanges is a drag
• Avoid rhetorics, be neutral in tone
• Always have a “shut up” command for the bot
Before starting to develop a
Bot
• Define objectives
• Choose a domain/knowledge base for the Bot
• Select an appropriate personality
• Personality is often tied to domain
• Challenging medium because it is limited to just text
• Copywriter is king
• The future “UI” designer may never need to write HTML,
CSS rather be a comedian or literature major
Helpful tools
• Prototyping - Twine
• NLP - IBM Bluemix Watson APIs, NLTK, ScalaNLP
• Bots - Hubot, BotKit
• Client APIs - Slack, Facebook Messenger, Google
Hangouts
Simple architecture
• Raw input — Lexical parser —> Structured input
• Structured input — Functionality —> Domain
output
• Domain output — Persona —> Richer output
• Richer output — Client communication —> API
call to app
Demo: Uber Bot
• Domain
• Fetch user history of rides
• Book a cab
• Train bot to understand cab booking patterns and
anticipate bookings
• Personality
• Jesse Pinkman (:P)
References
• Introduction to Bots and basic principles - http://designmodo.com/chatbots-design/
• About how messaging is taking over the world - https://blog.intercom.io/messaging-apps-just-getting-started/
• How messaging would evolve in the future - https://blog.intercom.io/emoji-and-stickers-are-just-the-beginning/
• Priciples of bot design - https://blog.intercom.io/principles-bot-design/
• Funny article on the origins of BASAAP - http://berglondon.com/blog/2010/09/04/b-a-s-a-a-p/
• Developing chatbot personalities - http://www.fastcodesign.com/3054934/the-next-phase-of-ux-designing-
chatbot-personalities
• Flow of a bot application - http://www.a-i.com/show_tree.asp?id=61&level=3&root=1
• How to make a better bot - https://chatbotsmagazine.com/how-to-make-a-better-bot-c038626fd401#.gkgztq4sg
• How not to piss off users - https://medium.com/@andknf/3-tools-for-building-bots-that-people-won-t-tell-to-fuck-
off-584889eaf6b9#.x2th8d4v6
• Advanced Deep learning model for retrieval based systems - http://www.wildml.com/2016/07/deep-learning-
for-chatbots-2-retrieval-based-model-tensorflow/

Building bots to automate common developer tasks - Writing your first smart chatbot

  • 1.
    Writing your first smartchatbot Ajay Viswanathan, Software Engineer - Sigmoid @MonadicNomad
  • 2.
    Machines should work, peopleshould think - Jim Henson
  • 3.
    Human Communication • Complex- subtext, sarcasm • Rich - body language, gestures, intonation • Evolved over millennia • Higher dynamic range of expressions
  • 4.
    Online Communication • Strippedof any emotion • Hacks like Emoticons, Emoji, Gifs • Shorthand, lingo, buzzwords - underline the basic human need to be conveyed efficiently
  • 5.
    Messaging today • Richmedia - audio, video, images, ¯_(ツ)_/¯ • Async • Easy to consume on the go • Informal tone • Always connected
  • 6.
    Why Messaging Appsmight take over native apps • Next evolution in messaging apps - building functionality into them • Apps are bulky, discoverability and maintaining them is an issue • Trend is to shift towards consistent interactions • Apps have taken note and started moving out of their silos and becoming integrable services
  • 7.
    Your UI isyour product’s humble compensation for not being telepathic - @mortenjust
  • 8.
    Why the suddenBot uprising? • Preceding advancements in Machine learning, Natural language processing, scalable computing, massive API ecosystem, improvements in messaging and notification systems
  • 9.
    What is aBot? • The future of web design according to some • A program to simulate conversation, to • Find information • Connect to resources • Learn keywords • Think about responses • Bot != Conversational AI (not necessarily)
  • 10.
    What makes agreat bot? • Adds value of some kind • Requires minimal input/direction • Reliable, robust like standard software • Relieves stress for humans • Anticipates needs of users
  • 11.
    Design principles • NotBeing Human - don’t try too hard to make them appear human. They can still have a personality • Keep it simple in functionality - Bots need to walk before they can run • Be as smart as a puppy - Be endearing enough when failures occur and keep learning • Optimize for end-user and messaging medium • Always have a human fallback mode • {Structured input + Retrieval response} > {Freeform input + Generative response} - We at not an acceptable reliability level for the latter • Use feedback analytics and keep improving the user experience
  • 12.
    Common pitfalls • Don’tattempt to replace tasks better done by a human • Don’t add a feature just because it is cool. It needs to have business value • Don’t keep winding conversations - anything more than 2 exchanges is a drag • Avoid rhetorics, be neutral in tone • Always have a “shut up” command for the bot
  • 13.
    Before starting todevelop a Bot • Define objectives • Choose a domain/knowledge base for the Bot • Select an appropriate personality • Personality is often tied to domain • Challenging medium because it is limited to just text • Copywriter is king • The future “UI” designer may never need to write HTML, CSS rather be a comedian or literature major
  • 14.
    Helpful tools • Prototyping- Twine • NLP - IBM Bluemix Watson APIs, NLTK, ScalaNLP • Bots - Hubot, BotKit • Client APIs - Slack, Facebook Messenger, Google Hangouts
  • 15.
    Simple architecture • Rawinput — Lexical parser —> Structured input • Structured input — Functionality —> Domain output • Domain output — Persona —> Richer output • Richer output — Client communication —> API call to app
  • 16.
    Demo: Uber Bot •Domain • Fetch user history of rides • Book a cab • Train bot to understand cab booking patterns and anticipate bookings • Personality • Jesse Pinkman (:P)
  • 17.
    References • Introduction toBots and basic principles - http://designmodo.com/chatbots-design/ • About how messaging is taking over the world - https://blog.intercom.io/messaging-apps-just-getting-started/ • How messaging would evolve in the future - https://blog.intercom.io/emoji-and-stickers-are-just-the-beginning/ • Priciples of bot design - https://blog.intercom.io/principles-bot-design/ • Funny article on the origins of BASAAP - http://berglondon.com/blog/2010/09/04/b-a-s-a-a-p/ • Developing chatbot personalities - http://www.fastcodesign.com/3054934/the-next-phase-of-ux-designing- chatbot-personalities • Flow of a bot application - http://www.a-i.com/show_tree.asp?id=61&level=3&root=1 • How to make a better bot - https://chatbotsmagazine.com/how-to-make-a-better-bot-c038626fd401#.gkgztq4sg • How not to piss off users - https://medium.com/@andknf/3-tools-for-building-bots-that-people-won-t-tell-to-fuck- off-584889eaf6b9#.x2th8d4v6 • Advanced Deep learning model for retrieval based systems - http://www.wildml.com/2016/07/deep-learning- for-chatbots-2-retrieval-based-model-tensorflow/