Chatbots
Introduction
Chatbots provide a natural language
interface to their users
Eugene Goostman
Google AI chatbot
Facebook AI develops
own language
Microsoft’s Tay
The Good of Chatbots
Message platforms are everywhere
Simple, known interface
Applicable to many situations
63% of the people are willing to communicate through chatbots[1]
[1]: https://venturebeat.com/2017/06/17/the-good-the-bad-and-the-ugly-of-chatbots/
avaamo.com
Introduction: the Bad of Chatbots
73% won’t use the chatbot again after a bad experience[1]
75% want to know it is a bot[1]
50% are disturbed when a bot pretends to be human[1]
Not all languages are equally supported
[1]: https://venturebeat.com/2017/06/17/the-good-the-bad-and-the-ugly-of-chatbots/
steemit.com/@resteemitnow
Natural Language Processing
NLG
Natural Language Generation
Data => ‘Natural’ text
Easy
NLU NLG
Natural Language Understanding Natural Language Generation
Natural text to structured data Data to natural text
Hard Easy
Types of Chatbots
Easy
FAQ
Form
Hard
Complex
Conversation Within
Domain
Smart Home,
Basic Customer Service,
Basic Information
Adv. Customer Service
(Advanced FAQ + Form)
String
Distance
Conversation
Flow
Matching Commands
And Arguments
Conversation
Context
Conversation Flow
+ Commands
Advanced
Information
Database Access
+ Filter Matching
FAQ / Simple Information Lookup
• User: asks questions
• Chatbot: gives answers
• Easy to build
• No machine learning
Guided Conversation / Form
• Chatbot asks questions
• User answers
• Slightly harder
• machine learning -> extract entities
Information Lookup
• Database access through conversation
• User asks questions or gives commands
• Chatbot gives answers, asks questions back
• Difference with FAQ: Context and Entity resolution
Smart Home / Simple Information Lookup
• Perform tasks
• User tells Chatbot what to do
• Chatbot answers/confirms/asks follow-up questions
Types of Chatbots: Personal Assistant
• Collection of other chatbots
• Redirects actions/questions to ‘sub’
chatbots
• Seamless integration between
different chatbots
• e.g. Google Assistant, Siri, ...
Common Concepts
•Intents
•Entities
•Context
•Prompts
•Follow-up / Flows
Common Concepts: Intents
• Phrases get mapped to intents
• Function calls on the chatbot
→entities are arguments
• Often a function in back-end
Common Concepts: Entities
• Building blocks of the conversation
• Entities are passed to back-end
• e.g:
Common Concepts: Entities - Example
• “number” entity → mapped to 3
• Request 3 of something from back-end
Common Concepts: Entities - Example
• “Movies” → “requested” entity
• Request movies from back-end
Common Concepts: Entities - Example
• “person” entities
• Passes persons as arguments
Common Concepts: Entities - Example
• “with_actors” composite entity
• Passes list of persons as “actors” argument
Common Concepts: Context
• Context = entities from previous phrases & replies
● pagination
○ “three more please”
● changing part of the query
○ “who played in <movie>?”
○ “who directed it?”
● follow-up
Common Concepts: Prompts
•Prompt when missing required entities
•e.g.:
• User: “What’s the weather for today?”
• Weatherbot: “For what city?”
Common Concepts: Follow-up / Flows
•Follow-up questions guide users into Flows
•Example
•InsureBot: “What brand of car?”
•User: “<car brand>”
•InsureBot: “What year was the car made?”
•…
Technologies
Amazon Facebook Google IBM Microsoft Oracle
VPA Amazon Echo line - Google Home line -
Cortana,
Integration with
Amazon Alexa
Oracle Voice (ios
app store)
Dev Platform
Alexa Voice Services,
Alexa Skills Kit
RESTful wit.ai
backend
Dialogflow IBM BlueMix Windows
Oracle Mobile
Cloud Services
Speech
Synthesis API
Polly (+SSML) - unnamed (+SSML)
Watson Text To
Speech (Bluemix)
Bing Speech API
(+SSML)
Nuance (paywall)
NLU Lex wit.ai Dialogflow Conversation API LUIS.ai Nuance (paywall)
Bot Creation
Interface with Echo
line
Interface with
Facebook Chat
One-click Integration
in multiple platforms
BlueMix
MS Bot
Framework
Graphical UI
Free? Yes Yes
Dialogflow: Yes
Google cloud: Limited
Yes (Limited) Yes (Limited) No
Dutch? No Limited Limited Yes (Beta) Yes End 2017
Example data flow
•Lower Level libraries allow you to fine-tune (e.g. in python):
• spaCy
• nltk
• polyglot
• dateparser
DIY with Python
Natural Language Processing
Natural Language Understanding:
Hard
Need a lot of training data
Get semantic and entities from a
sentence
Create structured data from
unstructured natural text
Natural Language Generation:
Easy
Create file with template
sentences and insert entities
Add randomness
Natural Language Understanding: Pipeline
Best Practices
•Confirmation
•Buttons
•Openness
•Redirecting
•Design Considerations
Confirmation
•Stating the confirmation is fine for inconsequential mistakes:
•“What’s the weather for Memphis for next sunday?”
•“The weather for Memphis, Egypt for October 15th is …”
•“Cancel. What’s the weather for Memphis, Tennessee?”
Confirmation
•Asking for confirmation is better when there’s money on the line:
•“Book a flight for Memphis for tomorrow.”
•“Do you want me to book a flight for Memphis, Egypt on Thursday
the 12th of October?”
•“No, book a flight for Memphis, Tennessee.”
Confirmation
•Pick between choices:
•“Call Ellen”
•“Do you mean Ellen X or Ellen Y?”
•“Ellen Y”
Buttons
•for questions with clear options
•with buttons:
● users are reassured they’ll be understood
● users see all possibilities
● users can do nothing wrong
Openness
•Let Users Know it’s a Bot
•Bots are imperfect, users know and forgive
•Bots are limited, users adapt and stay on topic
•Users trust you/your bot, disguised bots break that trust
Redirect to Human
•Why?
•people will go beyond the bot’s capabilities and require human support
•When?
•complicated question, not covered in FAQ
•complaints
•on request
•How?
•low traffic: contact form may suffice
•high traffic: replace bot with human in same interface
Design Considerations
•Design considerations based on goal:
● Strict, down-to-business
● Informal with slang and jokes
● Voice interface
Design Considerations: Voice Interface
Bad
No buttons or images
Mispronunciation
Not private
Pros Cons
Wow-factor No buttons or images
Hands-free Mispronounciations
Faster than typing Not private
Testing
• Write recurrent test for your service
• API’s are young and prone to change
• Ensure proper working
• Notify if test are broken
Conclusion: Future
● NLU improvement
○ Speed
○ Accuracy
○ Language coverage
● More used by Businesses
● More accepted by Users
Questions?
Thanks for listening!
Smart Data Innovator
https://vectr.consulting

Chatbots

  • 1.
  • 2.
    Introduction Chatbots provide anatural language interface to their users
  • 3.
    Eugene Goostman Google AIchatbot Facebook AI develops own language Microsoft’s Tay
  • 4.
    The Good ofChatbots Message platforms are everywhere Simple, known interface Applicable to many situations 63% of the people are willing to communicate through chatbots[1] [1]: https://venturebeat.com/2017/06/17/the-good-the-bad-and-the-ugly-of-chatbots/ avaamo.com
  • 5.
    Introduction: the Badof Chatbots 73% won’t use the chatbot again after a bad experience[1] 75% want to know it is a bot[1] 50% are disturbed when a bot pretends to be human[1] Not all languages are equally supported [1]: https://venturebeat.com/2017/06/17/the-good-the-bad-and-the-ugly-of-chatbots/ steemit.com/@resteemitnow
  • 6.
    Natural Language Processing NLG NaturalLanguage Generation Data => ‘Natural’ text Easy NLU NLG Natural Language Understanding Natural Language Generation Natural text to structured data Data to natural text Hard Easy
  • 8.
    Types of Chatbots Easy FAQ Form Hard Complex ConversationWithin Domain Smart Home, Basic Customer Service, Basic Information Adv. Customer Service (Advanced FAQ + Form) String Distance Conversation Flow Matching Commands And Arguments Conversation Context Conversation Flow + Commands Advanced Information Database Access + Filter Matching
  • 9.
    FAQ / SimpleInformation Lookup • User: asks questions • Chatbot: gives answers • Easy to build • No machine learning
  • 10.
    Guided Conversation /Form • Chatbot asks questions • User answers • Slightly harder • machine learning -> extract entities
  • 11.
    Information Lookup • Databaseaccess through conversation • User asks questions or gives commands • Chatbot gives answers, asks questions back • Difference with FAQ: Context and Entity resolution
  • 12.
    Smart Home /Simple Information Lookup • Perform tasks • User tells Chatbot what to do • Chatbot answers/confirms/asks follow-up questions
  • 13.
    Types of Chatbots:Personal Assistant • Collection of other chatbots • Redirects actions/questions to ‘sub’ chatbots • Seamless integration between different chatbots • e.g. Google Assistant, Siri, ...
  • 14.
  • 15.
    Common Concepts: Intents •Phrases get mapped to intents • Function calls on the chatbot →entities are arguments • Often a function in back-end
  • 16.
    Common Concepts: Entities •Building blocks of the conversation • Entities are passed to back-end • e.g:
  • 17.
    Common Concepts: Entities- Example • “number” entity → mapped to 3 • Request 3 of something from back-end
  • 18.
    Common Concepts: Entities- Example • “Movies” → “requested” entity • Request movies from back-end
  • 19.
    Common Concepts: Entities- Example • “person” entities • Passes persons as arguments
  • 20.
    Common Concepts: Entities- Example • “with_actors” composite entity • Passes list of persons as “actors” argument
  • 21.
    Common Concepts: Context •Context = entities from previous phrases & replies ● pagination ○ “three more please” ● changing part of the query ○ “who played in <movie>?” ○ “who directed it?” ● follow-up
  • 22.
    Common Concepts: Prompts •Promptwhen missing required entities •e.g.: • User: “What’s the weather for today?” • Weatherbot: “For what city?”
  • 23.
    Common Concepts: Follow-up/ Flows •Follow-up questions guide users into Flows •Example •InsureBot: “What brand of car?” •User: “<car brand>” •InsureBot: “What year was the car made?” •…
  • 25.
    Technologies Amazon Facebook GoogleIBM Microsoft Oracle VPA Amazon Echo line - Google Home line - Cortana, Integration with Amazon Alexa Oracle Voice (ios app store) Dev Platform Alexa Voice Services, Alexa Skills Kit RESTful wit.ai backend Dialogflow IBM BlueMix Windows Oracle Mobile Cloud Services Speech Synthesis API Polly (+SSML) - unnamed (+SSML) Watson Text To Speech (Bluemix) Bing Speech API (+SSML) Nuance (paywall) NLU Lex wit.ai Dialogflow Conversation API LUIS.ai Nuance (paywall) Bot Creation Interface with Echo line Interface with Facebook Chat One-click Integration in multiple platforms BlueMix MS Bot Framework Graphical UI Free? Yes Yes Dialogflow: Yes Google cloud: Limited Yes (Limited) Yes (Limited) No Dutch? No Limited Limited Yes (Beta) Yes End 2017
  • 26.
  • 27.
    •Lower Level librariesallow you to fine-tune (e.g. in python): • spaCy • nltk • polyglot • dateparser DIY with Python
  • 28.
    Natural Language Processing NaturalLanguage Understanding: Hard Need a lot of training data Get semantic and entities from a sentence Create structured data from unstructured natural text Natural Language Generation: Easy Create file with template sentences and insert entities Add randomness
  • 29.
  • 31.
  • 32.
    Confirmation •Stating the confirmationis fine for inconsequential mistakes: •“What’s the weather for Memphis for next sunday?” •“The weather for Memphis, Egypt for October 15th is …” •“Cancel. What’s the weather for Memphis, Tennessee?”
  • 33.
    Confirmation •Asking for confirmationis better when there’s money on the line: •“Book a flight for Memphis for tomorrow.” •“Do you want me to book a flight for Memphis, Egypt on Thursday the 12th of October?” •“No, book a flight for Memphis, Tennessee.”
  • 34.
    Confirmation •Pick between choices: •“CallEllen” •“Do you mean Ellen X or Ellen Y?” •“Ellen Y”
  • 35.
    Buttons •for questions withclear options •with buttons: ● users are reassured they’ll be understood ● users see all possibilities ● users can do nothing wrong
  • 36.
    Openness •Let Users Knowit’s a Bot •Bots are imperfect, users know and forgive •Bots are limited, users adapt and stay on topic •Users trust you/your bot, disguised bots break that trust
  • 37.
    Redirect to Human •Why? •peoplewill go beyond the bot’s capabilities and require human support •When? •complicated question, not covered in FAQ •complaints •on request •How? •low traffic: contact form may suffice •high traffic: replace bot with human in same interface
  • 38.
    Design Considerations •Design considerationsbased on goal: ● Strict, down-to-business ● Informal with slang and jokes ● Voice interface
  • 39.
    Design Considerations: VoiceInterface Bad No buttons or images Mispronunciation Not private Pros Cons Wow-factor No buttons or images Hands-free Mispronounciations Faster than typing Not private
  • 40.
    Testing • Write recurrenttest for your service • API’s are young and prone to change • Ensure proper working • Notify if test are broken
  • 41.
    Conclusion: Future ● NLUimprovement ○ Speed ○ Accuracy ○ Language coverage ● More used by Businesses ● More accepted by Users
  • 42.
  • 43.