SlideShare a Scribd company logo
1 of 53
Conversational Agents in Portuguese
A Study Using DeepLearning
Andherson C. Maeda
Developer Consultant @ thoughtworks
$ whoami
Agenda
● Chatbots
● Machine Learning
● Context
● Research
● Results
● Final Considerations
● Future Work
Chatbots
Chatbots timeline2
Chatbots timeline
60's: Eliza
Simulation of
rogerian
psychologist. Use
pieces of input to
build output phrase
(Weizenbaum)
90's: Julia
TinyMUD bot. Based
on rules recognition
and neural networks
(Mauldin)
2000: Alice
Pattern matching.
Inspired by XML:
AIML (Wallace)
Neural Networks
Chatbots - types
◉ Tasks oriented
○ Cognitive architecture
○ Tasks accomplishment objective
○ Recognize natural language
◉ Chatter bots
○ Reactive architecture
○ Human conversation imitation
○ Wide domain
Chatbots - relevance
◉ Its abilities to dialog in natural language make
them attractive
◉ They could be available 24x7 and provides a
more natural interface for apps
◉ Big companies like Apple, Microsoft, Samsung,
Amazon and Google has been launching
products in this direction
or not...
Caveats5
Caveats (or not)
◉ Handcrafted rules
◉ Unknown questions will generate default
answers
◉ Manual effort to build and maintain the
conversation's database over the time
○ Are there alternatives?
Machine Learning
Deep Learning and so on..
Definition
What's Machine Learning and Deep Learning?
6
“
A learning definition:
"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)
“
A machine learning definition:
It's a usage of computational resources and learning algorithms
over a dataset to infer mathematical functions that represent the
dataset's information (Bengio and Courville, 2016)
“
A deep learning definition:
The main difference between a shallow learning and deep
learning it's a deep mathematical function composition. (Bengio
and Courville, 2016)
Deep Learning
timeline2
Deep Learning timeline
40's: Artificial
Neuron
It's is possible to use
a model based on
neuron to do logic
calculations.
(McCulloch and Pitts,
1943)
60's: Perceptron
Applied weights ideia
to artificial neuron
model. (Rosenblatt,
1958)
80's: XOR Problem and
Multilayer Perceptron
Perceptron works only for
linear problems (Minsky
and Pappert, 1988)
XOR problem resolved by
backpropagation algorithm
(Rumelhart at all, 1985)
Neural Networks
Deep Learning timeline
90's: Cyclical
Connections
Relaxed feedforward
conditions and allow
cyclical connections
on sequences over
the time (Graves,
2012)
90's: LSTM
Brings the gates to
address vanishing
and explosion
gradients problem
(Hochreiter, 1997)
2014: Sequence to
Sequence Model
Applied LSTM layers to
translation tasks between
english and french with
good results (Sutskever et
all, 2014)
Neural Networks
Context
From where this story has been started?
6
A Neural Conversational Model
Google Dialog Example
“
But… in english! Does it works in
portuguese?
Research
Have someone been made the same? Are there libraries?
7
Research
● Most work was made based on AIML
● All related papers are for english
● Lack of portuguese dialog corpora
● Lack of libraries and frameworks
○ Just one in lua! (neuralconvo)
Research - Corpora
● Cornell Movie-Dialogs Corpus (english)
○ 220,579 sentences
● OpenSubtitles (portuguese)
○ 2.6 billion of sentences!
○ Starwars Movie subtitles
■ 12,775 sentences
● Mobile App chat history (portuguese)
○ 30,684 sentences
Research - Bot Architecture
Research - Neural Unit
● Input tensors:
○ one hot encoding
● Output tensors
○ one hot encoding
○ Negative log-likelihood
● Encoder
○ 1 layer LSTM
● Decoder
○ 1 layer LSTM
○ LogSoftMax layer
● Adam gradient descendent
○ Mini batches
Research - Neural Topology
Recurrent Neural Networks and LSTM block
Recurrent Neural Network Unfold Recurrent Neural Network LSTM block
Research - Processing
- Oi, como vai você?
- Bem, obrigado!
- Onde você está?
- Em casa
[
{
["5","4","3","2","1","0","10"],
["6","1","7","8","10","11","11"]
},
{
["11","11","8","7","1","6","10"],
["9","4","11","5","10","11","11"]
},
{
["9","4","11","5","10","11","11"]
["11","11","10","11","11","11","11"]
}
]
{
"0": "Oi",
"1": ",",
"2": "como",
"3": "vai",
"4": "voce",
"5": "?",
"6": "Bem",
"7": "obrigado",
"8": "!",
"9": "Onde",
"10": "<EOS>"
"11": "<UNK>"
}
[[
[0,0,0,0,0,1,0,0,0,0,0,0],
[0,0,0,0,1,0,0,0,0,0,0,0],
[0,0,0,1,0,0,0,0,0,0,0,0],
[0,0,1,0,0,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0,0,0,0,0],
[1,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,1,0]
],
[
[0,0,0,0,0,0,1,0,0,0,0,0],
[0,1,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,1,0,0,0],
[0,0,0,0,0,0,0,0,0,0,1,0],
[0,0,0,0,0,0,0,0,0,0,0,1],
[0,0,0,0,0,0,0,0,0,0,0,1]
]]
Dictionary Dialog Pairs Tensors
Research - Processing
[
[0,0,0,0,0,1,0,0,0,0,0,0],
[0,0,0,0,1,0,0,0,0,0,0,0],
[0,0,0,1,0,0,0,0,0,0,0,0],
[0,0,1,0,0,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0,0,0,0,0],
[1,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,1,0]
]
[0,0,0,0,0,0,1,0,0,0,0,0] =
Bem
[0.1,0.002,0.01,0.03,0.11,0.09
,0.7,0.01,0.12,0.2,0.1,0.37]
Encoder Decoder
Recurrent autoencoder
Sentence context
Sequence to sequence model
Research - Interface
● Corpus: 10,000 sentences
● Autoencoder: 1,000 units per layer
Research - English Corpus
Tests
Research - Portuguese Corpus
Tests
● Corpus: 10,000 sentences
● Autoencoder: 1,000 units per layer
Research - StarWars Corpus
(TecnoPUC tests)
● Corpus: 12,775 sentences
● Autoencoder: 400 units per layer
○ - 600 units to reduce costs
Research - Mobile App Chat
Tests
● Corpus: 30,684 sentences
● Autoencoder: 1,000 units per layer
● Personality!
Research - Turn taking
● Since turn taking is not clearly identified,
mainly at subtitles, we trained our model to
predict the next sentence given the previous
one (Sutskever at all, 2015)
● Word generation stop at 20 words length
Results7
Results
● 90 users exchange has been used the bot
● 1,502 conversation pairs
● Users from:
○ Facebook
○ Software Engineering Classes
○ Coworkers
● 1 week test
● Users age between 17 and 62 years old
Users age range and their job area
Users profile and knowledge about chatbots
Users knowledge about StarWars and chatbots
Sample of User Dialog using StarWars tokens
Sample of User Dialog without StarWars tokens
Users age by group and individually
Users impression after chatting with bot
Final
Considerations
Final Considerations
● The results using movie subtitles, considering
the computational capacity used for and lack
of other AI techniques, were satisfactory.
● We have made an experiment using chat app
history and results was similar to Sutskever
and Vinyals results
○ Personality traits!
Future Work
Future Work
● Try to use more AI techniques like
○ Dimensionality reduction
○ Applying some NPL preprocess
○ More hidden layers and so on..
● Try another turn taking heuristic
● Experiment new frameworks like PyTorch
● Evaluate it with other corpora in portuguese
Any questions ?
You can find me at
◉ @maedabr
◉ maeda.br@gmail.com
◉ amaeda@thoughtworks.com
◉ andherson.maeda@acad.pucrs.br
Thanks!
http://bagu.al/1Bn
Paper published at KDMiLe

More Related Content

What's hot

Deep Learning for Information Retrieval
Deep Learning for Information RetrievalDeep Learning for Information Retrieval
Deep Learning for Information RetrievalRoelof Pieters
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2 Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2 Saurabh Kaushik
 
Anthiil Inside workshop on NLP
Anthiil Inside workshop on NLPAnthiil Inside workshop on NLP
Anthiil Inside workshop on NLPSatyam Saxena
 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language ProcessingDavid Rostcheck
 
Introduction to natural language processing
Introduction to natural language processingIntroduction to natural language processing
Introduction to natural language processingMinh Pham
 
Frontiers of Natural Language Processing
Frontiers of Natural Language ProcessingFrontiers of Natural Language Processing
Frontiers of Natural Language ProcessingSebastian Ruder
 
Deep Learning for NLP: An Introduction to Neural Word Embeddings
Deep Learning for NLP: An Introduction to Neural Word EmbeddingsDeep Learning for NLP: An Introduction to Neural Word Embeddings
Deep Learning for NLP: An Introduction to Neural Word EmbeddingsRoelof Pieters
 
Deep Learning, an interactive introduction for NLP-ers
Deep Learning, an interactive introduction for NLP-ersDeep Learning, an interactive introduction for NLP-ers
Deep Learning, an interactive introduction for NLP-ersRoelof Pieters
 
Recent Advances in NLP
  Recent Advances in NLP  Recent Advances in NLP
Recent Advances in NLPAnuj Gupta
 
Deep Learning for Chatbot (3/4)
Deep Learning for Chatbot (3/4)Deep Learning for Chatbot (3/4)
Deep Learning for Chatbot (3/4)Jaemin Cho
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 1
Engineering Intelligent NLP Applications Using Deep Learning – Part 1Engineering Intelligent NLP Applications Using Deep Learning – Part 1
Engineering Intelligent NLP Applications Using Deep Learning – Part 1Saurabh Kaushik
 
Seq2seq Model to Tokenize the Chinese Language
Seq2seq Model to Tokenize the Chinese LanguageSeq2seq Model to Tokenize the Chinese Language
Seq2seq Model to Tokenize the Chinese LanguageJinho Choi
 
Multi-modal Neural Machine Translation - Iacer Calixto
Multi-modal Neural Machine Translation - Iacer CalixtoMulti-modal Neural Machine Translation - Iacer Calixto
Multi-modal Neural Machine Translation - Iacer CalixtoSebastian Ruder
 
Representation Learning of Vectors of Words and Phrases
Representation Learning of Vectors of Words and PhrasesRepresentation Learning of Vectors of Words and Phrases
Representation Learning of Vectors of Words and PhrasesFelipe Moraes
 
Talk from NVidia Developer Connect
Talk from NVidia Developer ConnectTalk from NVidia Developer Connect
Talk from NVidia Developer ConnectAnuj Gupta
 
Nlp and transformer (v3s)
Nlp and transformer (v3s)Nlp and transformer (v3s)
Nlp and transformer (v3s)H K Yoon
 

What's hot (20)

Deep learning for nlp
Deep learning for nlpDeep learning for nlp
Deep learning for nlp
 
Deep Learning for Information Retrieval
Deep Learning for Information RetrievalDeep Learning for Information Retrieval
Deep Learning for Information Retrieval
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2 Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
 
Anthiil Inside workshop on NLP
Anthiil Inside workshop on NLPAnthiil Inside workshop on NLP
Anthiil Inside workshop on NLP
 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language Processing
 
Introduction to natural language processing
Introduction to natural language processingIntroduction to natural language processing
Introduction to natural language processing
 
Frontiers of Natural Language Processing
Frontiers of Natural Language ProcessingFrontiers of Natural Language Processing
Frontiers of Natural Language Processing
 
Deep Learning for NLP: An Introduction to Neural Word Embeddings
Deep Learning for NLP: An Introduction to Neural Word EmbeddingsDeep Learning for NLP: An Introduction to Neural Word Embeddings
Deep Learning for NLP: An Introduction to Neural Word Embeddings
 
Deep Learning, an interactive introduction for NLP-ers
Deep Learning, an interactive introduction for NLP-ersDeep Learning, an interactive introduction for NLP-ers
Deep Learning, an interactive introduction for NLP-ers
 
Recent Advances in NLP
  Recent Advances in NLP  Recent Advances in NLP
Recent Advances in NLP
 
Deep Learning for Chatbot (3/4)
Deep Learning for Chatbot (3/4)Deep Learning for Chatbot (3/4)
Deep Learning for Chatbot (3/4)
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 1
Engineering Intelligent NLP Applications Using Deep Learning – Part 1Engineering Intelligent NLP Applications Using Deep Learning – Part 1
Engineering Intelligent NLP Applications Using Deep Learning – Part 1
 
Seq2seq Model to Tokenize the Chinese Language
Seq2seq Model to Tokenize the Chinese LanguageSeq2seq Model to Tokenize the Chinese Language
Seq2seq Model to Tokenize the Chinese Language
 
Multi-modal Neural Machine Translation - Iacer Calixto
Multi-modal Neural Machine Translation - Iacer CalixtoMulti-modal Neural Machine Translation - Iacer Calixto
Multi-modal Neural Machine Translation - Iacer Calixto
 
Representation Learning of Vectors of Words and Phrases
Representation Learning of Vectors of Words and PhrasesRepresentation Learning of Vectors of Words and Phrases
Representation Learning of Vectors of Words and Phrases
 
NLP Bootcamp
NLP BootcampNLP Bootcamp
NLP Bootcamp
 
Talk from NVidia Developer Connect
Talk from NVidia Developer ConnectTalk from NVidia Developer Connect
Talk from NVidia Developer Connect
 
Nlp and transformer (v3s)
Nlp and transformer (v3s)Nlp and transformer (v3s)
Nlp and transformer (v3s)
 
Language models
Language modelsLanguage models
Language models
 

Similar to Conversational Agents in Portuguese: A Study Using Deep Learning

Tomáš Mikolov - Distributed Representations for NLP
Tomáš Mikolov - Distributed Representations for NLPTomáš Mikolov - Distributed Representations for NLP
Tomáš Mikolov - Distributed Representations for NLPMachine Learning Prague
 
Chatbots and Deep Learning
Chatbots and Deep LearningChatbots and Deep Learning
Chatbots and Deep LearningAndherson Maeda
 
Training at AI Frontiers 2018 - Ni Lao: Weakly Supervised Natural Language Un...
Training at AI Frontiers 2018 - Ni Lao: Weakly Supervised Natural Language Un...Training at AI Frontiers 2018 - Ni Lao: Weakly Supervised Natural Language Un...
Training at AI Frontiers 2018 - Ni Lao: Weakly Supervised Natural Language Un...AI Frontiers
 
Trends of ICASSP 2022
Trends of ICASSP 2022Trends of ICASSP 2022
Trends of ICASSP 2022Kwanghee Choi
 
Tutorial on Deep Learning in Recommender System, Lars summer school 2019
Tutorial on Deep Learning in Recommender System, Lars summer school 2019Tutorial on Deep Learning in Recommender System, Lars summer school 2019
Tutorial on Deep Learning in Recommender System, Lars summer school 2019Anoop Deoras
 
Introducción a NLP (Natural Language Processing) en Azure
Introducción a NLP (Natural Language Processing) en AzureIntroducción a NLP (Natural Language Processing) en Azure
Introducción a NLP (Natural Language Processing) en AzurePlain Concepts
 
"Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn...
"Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn..."Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn...
"Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn...Edge AI and Vision Alliance
 
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"Fwdays
 
Automatic Personality Prediction with Attention-based Neural Networks
Automatic Personality Prediction with Attention-based Neural NetworksAutomatic Personality Prediction with Attention-based Neural Networks
Automatic Personality Prediction with Attention-based Neural NetworksJinho Choi
 
MixedLanguageProcessingTutorialEMNLP2019.pptx
MixedLanguageProcessingTutorialEMNLP2019.pptxMixedLanguageProcessingTutorialEMNLP2019.pptx
MixedLanguageProcessingTutorialEMNLP2019.pptxMariYam371004
 
Deep Learning, Where Are You Going?
Deep Learning, Where Are You Going?Deep Learning, Where Are You Going?
Deep Learning, Where Are You Going?NAVER Engineering
 
DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0
DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0
DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0Plain Concepts
 
Applications of Large Language Models in Materials Discovery and Design
Applications of Large Language Models in Materials Discovery and DesignApplications of Large Language Models in Materials Discovery and Design
Applications of Large Language Models in Materials Discovery and DesignAnubhav Jain
 
#1 Berlin Students in AI, Machine Learning & NLP presentation
#1 Berlin Students in AI, Machine Learning & NLP presentation#1 Berlin Students in AI, Machine Learning & NLP presentation
#1 Berlin Students in AI, Machine Learning & NLP presentationparlamind
 
OWF14 - Big Data : The State of Machine Learning in 2014
OWF14 - Big Data : The State of Machine  Learning in 2014OWF14 - Big Data : The State of Machine  Learning in 2014
OWF14 - Big Data : The State of Machine Learning in 2014Paris Open Source Summit
 
LiDeng-BerlinOct2015-ASR-GenDisc-4by3.pptx
LiDeng-BerlinOct2015-ASR-GenDisc-4by3.pptxLiDeng-BerlinOct2015-ASR-GenDisc-4by3.pptx
LiDeng-BerlinOct2015-ASR-GenDisc-4by3.pptxVishnuRajuV
 
BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2
BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2
BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2Karthik Murugesan
 
Lukasz Kaiser at AI Frontiers: How Deep Learning Quietly Revolutionized NLP
Lukasz Kaiser at AI Frontiers: How Deep Learning Quietly Revolutionized NLPLukasz Kaiser at AI Frontiers: How Deep Learning Quietly Revolutionized NLP
Lukasz Kaiser at AI Frontiers: How Deep Learning Quietly Revolutionized NLPAI Frontiers
 
The Rise Of Conversational AI with David Low
The Rise Of Conversational AI with David LowThe Rise Of Conversational AI with David Low
The Rise Of Conversational AI with David LowDatabricks
 

Similar to Conversational Agents in Portuguese: A Study Using Deep Learning (20)

Tomáš Mikolov - Distributed Representations for NLP
Tomáš Mikolov - Distributed Representations for NLPTomáš Mikolov - Distributed Representations for NLP
Tomáš Mikolov - Distributed Representations for NLP
 
Chatbots and Deep Learning
Chatbots and Deep LearningChatbots and Deep Learning
Chatbots and Deep Learning
 
Training at AI Frontiers 2018 - Ni Lao: Weakly Supervised Natural Language Un...
Training at AI Frontiers 2018 - Ni Lao: Weakly Supervised Natural Language Un...Training at AI Frontiers 2018 - Ni Lao: Weakly Supervised Natural Language Un...
Training at AI Frontiers 2018 - Ni Lao: Weakly Supervised Natural Language Un...
 
Trends of ICASSP 2022
Trends of ICASSP 2022Trends of ICASSP 2022
Trends of ICASSP 2022
 
Tutorial on Deep Learning in Recommender System, Lars summer school 2019
Tutorial on Deep Learning in Recommender System, Lars summer school 2019Tutorial on Deep Learning in Recommender System, Lars summer school 2019
Tutorial on Deep Learning in Recommender System, Lars summer school 2019
 
Introducción a NLP (Natural Language Processing) en Azure
Introducción a NLP (Natural Language Processing) en AzureIntroducción a NLP (Natural Language Processing) en Azure
Introducción a NLP (Natural Language Processing) en Azure
 
"Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn...
"Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn..."Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn...
"Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn...
 
How to supervise a thesis in NLP in the ChatGPT era? By Laure Soulier
How to supervise a thesis in NLP in the ChatGPT era? By Laure SoulierHow to supervise a thesis in NLP in the ChatGPT era? By Laure Soulier
How to supervise a thesis in NLP in the ChatGPT era? By Laure Soulier
 
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
 
Automatic Personality Prediction with Attention-based Neural Networks
Automatic Personality Prediction with Attention-based Neural NetworksAutomatic Personality Prediction with Attention-based Neural Networks
Automatic Personality Prediction with Attention-based Neural Networks
 
MixedLanguageProcessingTutorialEMNLP2019.pptx
MixedLanguageProcessingTutorialEMNLP2019.pptxMixedLanguageProcessingTutorialEMNLP2019.pptx
MixedLanguageProcessingTutorialEMNLP2019.pptx
 
Deep Learning, Where Are You Going?
Deep Learning, Where Are You Going?Deep Learning, Where Are You Going?
Deep Learning, Where Are You Going?
 
DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0
DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0
DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0
 
Applications of Large Language Models in Materials Discovery and Design
Applications of Large Language Models in Materials Discovery and DesignApplications of Large Language Models in Materials Discovery and Design
Applications of Large Language Models in Materials Discovery and Design
 
#1 Berlin Students in AI, Machine Learning & NLP presentation
#1 Berlin Students in AI, Machine Learning & NLP presentation#1 Berlin Students in AI, Machine Learning & NLP presentation
#1 Berlin Students in AI, Machine Learning & NLP presentation
 
OWF14 - Big Data : The State of Machine Learning in 2014
OWF14 - Big Data : The State of Machine  Learning in 2014OWF14 - Big Data : The State of Machine  Learning in 2014
OWF14 - Big Data : The State of Machine Learning in 2014
 
LiDeng-BerlinOct2015-ASR-GenDisc-4by3.pptx
LiDeng-BerlinOct2015-ASR-GenDisc-4by3.pptxLiDeng-BerlinOct2015-ASR-GenDisc-4by3.pptx
LiDeng-BerlinOct2015-ASR-GenDisc-4by3.pptx
 
BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2
BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2
BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2
 
Lukasz Kaiser at AI Frontiers: How Deep Learning Quietly Revolutionized NLP
Lukasz Kaiser at AI Frontiers: How Deep Learning Quietly Revolutionized NLPLukasz Kaiser at AI Frontiers: How Deep Learning Quietly Revolutionized NLP
Lukasz Kaiser at AI Frontiers: How Deep Learning Quietly Revolutionized NLP
 
The Rise Of Conversational AI with David Low
The Rise Of Conversational AI with David LowThe Rise Of Conversational AI with David Low
The Rise Of Conversational AI with David Low
 

Recently uploaded

Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanMYRABACSAFRA2
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectBoston Institute of Analytics
 
While-For-loop in python used in college
While-For-loop in python used in collegeWhile-For-loop in python used in college
While-For-loop in python used in collegessuser7a7cd61
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsVICTOR MAESTRE RAMIREZ
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...limedy534
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 217djon017
 
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSINGmarianagonzalez07
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxNLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxBoston Institute of Analytics
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Seán Kennedy
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.natarajan8993
 

Recently uploaded (20)

Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population Mean
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis Project
 
While-For-loop in python used in college
While-For-loop in python used in collegeWhile-For-loop in python used in college
While-For-loop in python used in college
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business Professionals
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2
 
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxNLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.
 

Conversational Agents in Portuguese: A Study Using Deep Learning

  • 1. Conversational Agents in Portuguese A Study Using DeepLearning
  • 2. Andherson C. Maeda Developer Consultant @ thoughtworks $ whoami
  • 3. Agenda ● Chatbots ● Machine Learning ● Context ● Research ● Results ● Final Considerations ● Future Work
  • 6. Chatbots timeline 60's: Eliza Simulation of rogerian psychologist. Use pieces of input to build output phrase (Weizenbaum) 90's: Julia TinyMUD bot. Based on rules recognition and neural networks (Mauldin) 2000: Alice Pattern matching. Inspired by XML: AIML (Wallace) Neural Networks
  • 7. Chatbots - types ◉ Tasks oriented ○ Cognitive architecture ○ Tasks accomplishment objective ○ Recognize natural language ◉ Chatter bots ○ Reactive architecture ○ Human conversation imitation ○ Wide domain
  • 8. Chatbots - relevance ◉ Its abilities to dialog in natural language make them attractive ◉ They could be available 24x7 and provides a more natural interface for apps ◉ Big companies like Apple, Microsoft, Samsung, Amazon and Google has been launching products in this direction
  • 10. Caveats (or not) ◉ Handcrafted rules ◉ Unknown questions will generate default answers ◉ Manual effort to build and maintain the conversation's database over the time ○ Are there alternatives?
  • 12. Definition What's Machine Learning and Deep Learning? 6
  • 13. “ A learning definition: "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)
  • 14. “ A machine learning definition: It's a usage of computational resources and learning algorithms over a dataset to infer mathematical functions that represent the dataset's information (Bengio and Courville, 2016)
  • 15. “ A deep learning definition: The main difference between a shallow learning and deep learning it's a deep mathematical function composition. (Bengio and Courville, 2016)
  • 17. Deep Learning timeline 40's: Artificial Neuron It's is possible to use a model based on neuron to do logic calculations. (McCulloch and Pitts, 1943) 60's: Perceptron Applied weights ideia to artificial neuron model. (Rosenblatt, 1958) 80's: XOR Problem and Multilayer Perceptron Perceptron works only for linear problems (Minsky and Pappert, 1988) XOR problem resolved by backpropagation algorithm (Rumelhart at all, 1985) Neural Networks
  • 18. Deep Learning timeline 90's: Cyclical Connections Relaxed feedforward conditions and allow cyclical connections on sequences over the time (Graves, 2012) 90's: LSTM Brings the gates to address vanishing and explosion gradients problem (Hochreiter, 1997) 2014: Sequence to Sequence Model Applied LSTM layers to translation tasks between english and french with good results (Sutskever et all, 2014) Neural Networks
  • 19. Context From where this story has been started? 6
  • 22.
  • 23. “ But… in english! Does it works in portuguese?
  • 24. Research Have someone been made the same? Are there libraries? 7
  • 25. Research ● Most work was made based on AIML ● All related papers are for english ● Lack of portuguese dialog corpora ● Lack of libraries and frameworks ○ Just one in lua! (neuralconvo)
  • 26. Research - Corpora ● Cornell Movie-Dialogs Corpus (english) ○ 220,579 sentences ● OpenSubtitles (portuguese) ○ 2.6 billion of sentences! ○ Starwars Movie subtitles ■ 12,775 sentences ● Mobile App chat history (portuguese) ○ 30,684 sentences
  • 27. Research - Bot Architecture
  • 28. Research - Neural Unit ● Input tensors: ○ one hot encoding ● Output tensors ○ one hot encoding ○ Negative log-likelihood
  • 29. ● Encoder ○ 1 layer LSTM ● Decoder ○ 1 layer LSTM ○ LogSoftMax layer ● Adam gradient descendent ○ Mini batches Research - Neural Topology
  • 30. Recurrent Neural Networks and LSTM block Recurrent Neural Network Unfold Recurrent Neural Network LSTM block
  • 31. Research - Processing - Oi, como vai você? - Bem, obrigado! - Onde você está? - Em casa [ { ["5","4","3","2","1","0","10"], ["6","1","7","8","10","11","11"] }, { ["11","11","8","7","1","6","10"], ["9","4","11","5","10","11","11"] }, { ["9","4","11","5","10","11","11"] ["11","11","10","11","11","11","11"] } ] { "0": "Oi", "1": ",", "2": "como", "3": "vai", "4": "voce", "5": "?", "6": "Bem", "7": "obrigado", "8": "!", "9": "Onde", "10": "<EOS>" "11": "<UNK>" } [[ [0,0,0,0,0,1,0,0,0,0,0,0], [0,0,0,0,1,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0,0,0], [0,0,1,0,0,0,0,0,0,0,0,0], [0,1,0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,1,0] ], [ [0,0,0,0,0,0,1,0,0,0,0,0], [0,1,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,1,0,0,0,0], [0,0,0,0,0,0,0,0,1,0,0,0], [0,0,0,0,0,0,0,0,0,0,1,0], [0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,0,0,0,0,1] ]] Dictionary Dialog Pairs Tensors
  • 35. ● Corpus: 10,000 sentences ● Autoencoder: 1,000 units per layer Research - English Corpus Tests
  • 36. Research - Portuguese Corpus Tests ● Corpus: 10,000 sentences ● Autoencoder: 1,000 units per layer
  • 37. Research - StarWars Corpus (TecnoPUC tests) ● Corpus: 12,775 sentences ● Autoencoder: 400 units per layer ○ - 600 units to reduce costs
  • 38. Research - Mobile App Chat Tests ● Corpus: 30,684 sentences ● Autoencoder: 1,000 units per layer ● Personality!
  • 39. Research - Turn taking ● Since turn taking is not clearly identified, mainly at subtitles, we trained our model to predict the next sentence given the previous one (Sutskever at all, 2015) ● Word generation stop at 20 words length
  • 41. Results ● 90 users exchange has been used the bot ● 1,502 conversation pairs ● Users from: ○ Facebook ○ Software Engineering Classes ○ Coworkers ● 1 week test ● Users age between 17 and 62 years old
  • 42. Users age range and their job area
  • 43. Users profile and knowledge about chatbots
  • 44. Users knowledge about StarWars and chatbots
  • 45. Sample of User Dialog using StarWars tokens
  • 46. Sample of User Dialog without StarWars tokens
  • 47. Users age by group and individually
  • 48. Users impression after chatting with bot
  • 50. Final Considerations ● The results using movie subtitles, considering the computational capacity used for and lack of other AI techniques, were satisfactory. ● We have made an experiment using chat app history and results was similar to Sutskever and Vinyals results ○ Personality traits!
  • 52. Future Work ● Try to use more AI techniques like ○ Dimensionality reduction ○ Applying some NPL preprocess ○ More hidden layers and so on.. ● Try another turn taking heuristic ● Experiment new frameworks like PyTorch ● Evaluate it with other corpora in portuguese
  • 53. Any questions ? You can find me at ◉ @maedabr ◉ maeda.br@gmail.com ◉ amaeda@thoughtworks.com ◉ andherson.maeda@acad.pucrs.br Thanks! http://bagu.al/1Bn Paper published at KDMiLe