Using Machine Learning and Chatbots
to handle 1st line Technical Support
Barbara Fusinska
@BasiaFusinska
About me
Programmer
Machine Learning
Data Scientist
@BasiaFusinska
https://github.com/BasiaFusinska/TechSupportChatBot
Agenda
• What is a chatbot?
• Why would you use it?
• How to build a chatbot?
• What are available tools?
• How to apply AI in a chatbot?
What’s a chatbot?
Turing Test:
Man vs the Machine
The Translator
The companion
Why would
you need a
machine on
the other
side?
Production
Chatbots
• Customer Service / Tech
Support
• FAQ
• Scripted scenarios
• Forms replacement
• Online ordering
Flights Booking
Demo
Chatbot
Platforms
Overview
• Microsoft’s Bot Platform
• Facebook’s Bots for Messenger
• Rebot.me
• Imperson
• ChatScript
• Pandorabots
Microsoft Bot Framework Architecture
Receive & Send
Messages
Process Message
System Integration
UseCase:ITCrowd
AnsweringMachine
“Hello”
“Hi, something’s
wrong with my
computer”
“Hello, IT?”
“Have you tried to
turn it off an on
again?”
Turning off
worked
“You are welcome
then”
“No, no, I will do
that. Thanks.”
YES
“Is it definitely
plugged in?”
NO
“Yes, tried that and
nothing happens!”
USER CHATBOT
<<anything>>
<<anything>>
“Hello, IT?”
“Have you tried to
turn it off an on
again?”
Turning off
worked
“You are welcome
then”
<<anything
containing “no”>>
YES
“Is it definitely
plugged in?”
NO
<<anything
containing “yes”>>
USER CHATBOT
The IT Crowd Answering Machine
Demo
Scripted
solutions
• Conversation order
• Going off script
• Information retrieval
• Closed list of answers
• Regular expressions
Chatbots without machine learning
Natural
Language
Processing
• Information Extraction
• Guessing the context
(Intents)
• Retrieving data (Named
Entity Recognition)
• Creative Machines
Classification problem
Model training
Published model
Classification data
Source #Links #Characters ... Fake
TopNews 10 2750 … T
Twitter 2 120 … F
TopNews 235 502 … F
Channel X 1530 3024 … T
Twitter 24 70 … F
StoryLeaks 722 1408 … T
Facebook 98 230 … T
… … … … ...
Features
Labels
Classification problem in NLP
Bag of words
The quick brown fox jumps over the lazy dog
Never jump over the lazy dog quickly
Dictionary:
{brown, dog, fox, jump, jumps, lazy, never,
over, quick, quickly, the}
Stemming
jump, jumps => jump
quick, quickly => quick
Dictionary:
{brown, dog, fox, jump, lazy, never, over, quick,
the}
Stop words
a, an, are, in, is, it, the …
Dictionary:
{brown, dog, fox, jump, lazy, never, over, quick}
Frequency vectors
The quick brown fox jumps over the lazy dog
[1, 1, 1, 1, 1, 0, 1, 1]
Never jump over the lazy dog quickly
[0, 1, 0, 1, 1, 1, 1, 1]
Dictionary:
{brown, dog, fox, jump, lazy, never, over, quick}
Term Frequency - Inverse Document Frequency
𝑡𝑓 𝑡, 𝑑 = 0.5 + 0.5 ∙
𝑓𝑡,𝑑
max
𝑢𝜖𝑑
𝑓𝑢,𝑑
𝑖𝑑𝑓 𝑡, 𝐷 = log
𝐷
{𝑑𝜖𝐷: 𝑡𝜖𝑑}
𝑡𝑓𝑖𝑑𝑓 𝑡, 𝑑, 𝐷 = 𝑡𝑓(𝑡, 𝑑) ∙ 𝑖𝑑𝑓(𝑡, 𝐷)
[0.02, 0.5, ..., 0.001]
Applying Artificial Intelligence
Receive & Send
Messages
Process Message
System Integration
AI
(LUIS)
“Hi, something’s
wrong with my
computer”
“Have you tried to
turn it off an on
again?”
Already
advised
“Great, and what is
the result?”
“No, I will try it
now.”
YES
“Ok, noted. We
should schedule
the repair”
NO
“Yes, tried that and
nothing happens!”
USER CHATBOT
Not Working
Not Working
Try
“That’s great. You
are welcome then”
“I’ve just tried it
and it worked!”
Worked
Language Understanding Intelligent Service
Demo
Applying Intelligence to the Chatbot
Demo
LUIS
Challenges
• Training process
• Script vs Intents
• Classification errors
• Common phrases
• Hello/Goodbye
• Yes/No
Bot connector
Keep in touch
BarbaraFusinska.com
@BasiaFusinska
https://github.com/BasiaFusinska/TechSupportChatBot

Using Machine Learning and Chatbots to handle 1st line Technical Support