Chatbots and Deep Learning:
From theory to practice
Andherson C. Maeda
Developer Consultant @ thoughtworks
$ whoami
Chatbots
Definition
What's chatbot means?
1
“
Program that simulate human
behavior though questions and
answers.
Can machines think?
◉ Computing Machinery and Intelligence
(TURING, 1950)
◉ Imitation game
In 50 years
An interrogator will not have more than 70%
chance to make the right identification after 5
minutes conversation
Chatbots timeline2
Chatbots timeline
60's: Eliza
Simulation of
rogerian
psychologist. Use
pieces of input to
build output phrase
(Wallace)
90's: Julia
TinyMUD bot. Based
on rules recognition
and neural networks
(Mauldin)
2000: Alice
Based on rules also,
but with more
features. Inspired by
XML: AIML (Wallace)
Natural Language Processing
Neural Networks
What's that?
Natural Language
Processing3
“
Field of Computer Science and
Linguistics concerned with
interactions between computers
and human natural languages
NLP: example
How can I build my own bot?
Chatbots toolbox4
Alice: AIML
<category>
<pattern>WHAT ARE YOU</pattern>
<template>
<think><set name="topic">Me</set></think>
I am the latest result in artificial intelligence,
which can reproduce the capabilities of the
human brain
with greater speed and accuracy.
</template>
</category>
Platforms, APIs and Libs
or not...
Caveats5
Caveats (or not)
◉ Handcrafted rules
◉ Unknown questions will generate default
answers
Machine Learning
Deep, embeddings, etc.
Definition
What's Machine Learning?
6
“
"A computer program is said to learn from experience E with respect
to some class of tasks T and performance measure P if its
performance at tasks in T, as measured by P, improves with
experience E" (Mitchel, 1997)
Machine Learning Algorithms
A Neural Conversational Model
Word Embeddings
A Neural Conversational Model
Seq2Seq
Building...
Building my own neural bot <3
7
Place your screenshot here
Dialog corpus selection
Find a large dialog
corpus
NLP Tasks
Apply NLP tasks to clean
your dataset like:
- Lowercase
- Tokenization
Word Embeddings
Build the Word2Vec
embedding from your
dialog corpus
- 40k most frequent
words could be
good enough
Train Seq2Seq Model
Train your model with a
dialog corpus.
- Use some testing
technique
(70%/30%, cross
validation, etc)
- GPU!
Demo (portuguese version)
Sequence to Sequence trained with StarWars
corpus:
◉ https://webot.personaltek.com
Seq2Seq StarWars Bot
or not...
Caveats8
Caveats (or not)
◉ Handcrafted rules
◉ Unknown questions will generate default
answers answers!
○ Weird answers, but answers...
◉ Long training time…
◉ Lot of resources needed
◉ Hard to test the model = (
Any questions ?
You can find me at
◉ @maedabr
◉ maeda.br@gmail.com
◉ amaeda@thoughtworks.com
Thanks!

Chatbots and Deep Learning