SlideShare a Scribd company logo
Justina Petraityte, Developer Advocate @ Rasa
Going beyond ‘Sorry, I didn’t get that’: building
AI assistants that scale using machine learning
What are we focusing on during this workshop
Introduction
Goal:
Build a machine learning - powered assistant
Roadmap:
1. Natural Language Understanding
i. Introduction and theory
ii. Coding
2. Dialogue Handling
i. Introduction and theory
ii. Coding
3. Closing the feedback loop
4. Questions
Setup
Introduction
1. Jupyter notebook in python 3.6
2. Download:
Repository: https://github.com/RasaHQ/rasa-workshop-pydata-dc
Alternative:
1. Google Colab: https://pydata.org/dc2018/proposals/43/
Conversational AI will
dramatically change how
your customers interact
with you.
Example of a live Skill:
A customer can change her
address via Facebook Messenger
MACHINE LEARNING-BASED DIALOGUE MANAGEMENT
https://github.com/RasaHQ/rasa-workshop-pydata-dc
Rasa the OSS to build conversational software with ML
Introduction
Backend,
database,
API, etc.
Dialogue
Management
“Brain”
Input Modules
“Ears”
NLU, GUI elements,
context, personal
info
Output
Modules
“Mouth”
NLG, GUI elements
Connector
Modules
Connector to any
conversational
platforms
“What’s the weather
like tomorrow?”
(User Request via
text or voice)
“It will be sunny and
20°C.”
(AI response via
text or voice)
https://github.com/RasaHQ/rasa-workshop-pydata-dc
Why Rasa?
Introduction
Runs Locally
● No Network
Overhead
● Control QoS
● Deploy anywhere
Hackable
● Tune models for your
use case
Own Your Data
● Don’t hand data over
to big tech co’s
● Avoid vendor lock-in
7https://github.com/RasaHQ/rasa-workshop-pydata-dc
Under the hood
Natural Language Understanding
Rasa NLU: Natural Language Understanding
Under the Hood
Goal: create structured data
I have a new address, it’s
709 King St, San Francisco
https://github.com/RasaHQ/rasa-workshop-pydata-dc
Natural Language Understanding
Natural Language
Understanding
What’s the
weather like
tomorrow?
Example Intent Classification Pipeline
”What’s the weather like tomorrow?” { “intent”: “request_weather” }
Vectorization Intent Classification
Under The Hood
https://github.com/RasaHQ/rasa-workshop-pydata-dc
Rasa NLU: Natural Language Understanding
Under the Hood
Bags are your friend
Bag
of
words
SVM
greet
goodbye
thank_you
request_weather
confirm
What’s the
weather like
tomorrow?
https://github.com/RasaHQ/rasa-workshop-pydata-dc
Rasa NLU: Natural Language Understanding
Under the Hood
Natural Language
Understanding
What’s the
weather like
tomorrow?
Example Entity Extraction Pipeline
”What’s the weather like tomorrow?” { “date”: “tomorrow” }
Tokenizer
Part of Speech
Tagger
Chunker
Named Entity
Recognition
Entity Extraction
Example Intent Classification Pipeline
”What’s the weather like tomorrow?” { “intent”: “request_weather” }
Vectorization Intent Classification
https://github.com/RasaHQ/rasa-workshop-pydata-dc
Rasa NLU: Entity Extraction
Under the Hood
Where can I get a burrito in the 2nd arrondissement ?
cuisine location
1. Binary classifier is_entity & then entity_classifier
2. Direct structured prediction
averaged perceptron
https://github.com/RasaHQ/rasa-workshop-pydata-dc
Limitation: Classifier with a single ‘correct’ label
https://github.com/RasaHQ/rasa-workshop-pydata-dc
Supervised Word Vectors (the new way)
Text Classification beyond word2vec
References:
WSABIE (Weston, Bengio, Usunier)
StarSpace (Wu et al)
https://github.com/RasaHQ/rasa-workshop-pydata-dc
Let’s code!
Under the hood
Dialogue Management
Why Dialogue Handling with Rasa Core?
Under The Hood
● No more state machines!
● Reinforcement Learning: too much
data, reward functions...
● Need a simple solution for everyone
Learn from real data instead of writing more rules
Rasa Core: Dialogue Handling
Under The Hood
“What’s the weather
like tomorrow?”
Intent
Entities
next
ActionState
previous
Action
“Thanks.”
after next
Action
updated
State
“It will be sunny
and 20°C.”
SVM
Recurrent NN
...
Rasa Core: Dialogue Handling
Under The Hood
“What’s the weather
like tomorrow?”
“It will be sunny and
20°C.”
Entity
Input
Action Mask
Renormal-
ization
Sample
action
Action
type?
Response
API Call
Recurrent
NN
API Call
Entity
Output
Intent
Classification
Entity
Extraction
Similar to LSTM-dialogue prediction paper: https://arxiv.org/abs/1606.01269
21
Let’s code!
Rasa Core: Dialogue Training
Under The Hood
Issue: How to get started? Interactive Learning→
What’s the weather
like tomorrow?
How did you like it?
Correct wrong
behaviour
Retrain model
It will be sunny and
20°C.
Let’s Code
Interactive Learning
Final Thoughts
Closing The Loop
Final Thoughts
“What’s the weather
like tomorrow?”
(User Request via
text or voice)
New Training
Data
Retrain ML
Models
Correct Training
Data
Relabel
Collected Data
Use Improved
Model
Open challenges
Final Thoughts
● Handling OOV words
● Multi language entity recognition
● Combination of dialogue models
● Negation
We’re constantly working on improving our models!
For those that are curious:
● Techniques to handle small data sets are key to get started with
conversational AI
● Deep ML techniques help advance state of the art NLU and
conversational AI
● Combine ML with traditional Programming and Rules where
appropriate
● Abandon flow charts
Summary
Final Thoughts
4 take home thoughts:
Get in
touch!
Justina Petraityte
Developer Advocate
juste@rasa.com
@juste_petr
Join Rasa
Community!

More Related Content

Similar to Going beyond “Sorry, I didn’t get that”: building AI assistants that scale using machine learning (PyData DC 2018)

Mining Social Web APIs with IPython Notebook (Data Day Texas 2015)
Mining Social Web APIs with IPython Notebook (Data Day Texas 2015)Mining Social Web APIs with IPython Notebook (Data Day Texas 2015)
Mining Social Web APIs with IPython Notebook (Data Day Texas 2015)
Matthew Russell
 
ShruthiNayak
ShruthiNayakShruthiNayak
ShruthiNayak
Shruthi Nayak
 
Lambda architecture for real time big data
Lambda architecture for real time big dataLambda architecture for real time big data
Lambda architecture for real time big data
Trieu Nguyen
 
Neurodb Engr245 2021 Lessons Learned
Neurodb Engr245 2021 Lessons LearnedNeurodb Engr245 2021 Lessons Learned
Neurodb Engr245 2021 Lessons Learned
Stanford University
 
Rasa AI: Building clever chatbots
Rasa AI: Building clever chatbotsRasa AI: Building clever chatbots
Rasa AI: Building clever chatbots
Tom Bocklisch
 
Resume
ResumeResume
Resume
Qamar Ali
 
Saloni jaiswal mba-2nd semester_miniproject
Saloni jaiswal mba-2nd semester_miniprojectSaloni jaiswal mba-2nd semester_miniproject
Saloni jaiswal mba-2nd semester_miniproject
RohanSilvenia
 
Kono.IntelCraft.Weekly.AI.LLM.Landscape.2024.02.28.pdf
Kono.IntelCraft.Weekly.AI.LLM.Landscape.2024.02.28.pdfKono.IntelCraft.Weekly.AI.LLM.Landscape.2024.02.28.pdf
Kono.IntelCraft.Weekly.AI.LLM.Landscape.2024.02.28.pdf
Anant Corporation
 
GSoC 2017 Proposal - Chatbot for DBpedia
GSoC 2017 Proposal - Chatbot for DBpedia GSoC 2017 Proposal - Chatbot for DBpedia
GSoC 2017 Proposal - Chatbot for DBpedia
Ram G Athreya
 
LangChain Intro by KeyMate.AI
LangChain Intro by KeyMate.AILangChain Intro by KeyMate.AI
LangChain Intro by KeyMate.AI
OzgurOscarOzkan
 
LanGCHAIN Framework
LanGCHAIN FrameworkLanGCHAIN Framework
LanGCHAIN Framework
Keymate.AI
 
Improving ad hoc and production workflows at Stitch Fix
Improving ad hoc and production workflows at Stitch FixImproving ad hoc and production workflows at Stitch Fix
Improving ad hoc and production workflows at Stitch Fix
Stitch Fix Algorithms
 
Big Data and Hadoop Training in Bangalore by myTectra
Big Data and Hadoop Training in Bangalore by myTectraBig Data and Hadoop Training in Bangalore by myTectra
Big Data and Hadoop Training in Bangalore by myTectra
myTectra Learning Solutions Private Ltd
 
Atlassian User Group NYC April 27 2017 Presentations
Atlassian User Group NYC April 27 2017 PresentationsAtlassian User Group NYC April 27 2017 Presentations
Atlassian User Group NYC April 27 2017 Presentations
Marlon Palha
 
Walter api
Walter apiWalter api
Walter api
Nicholas Schiller
 
Dl applicationlandscape-mar2018-180405144127
Dl applicationlandscape-mar2018-180405144127Dl applicationlandscape-mar2018-180405144127
Dl applicationlandscape-mar2018-180405144127
Aravindharamanan S
 
Deep Learning: Application Landscape - March 2018
Deep Learning: Application Landscape - March 2018Deep Learning: Application Landscape - March 2018
Deep Learning: Application Landscape - March 2018
Grigory Sapunov
 
Six Months Industrial Training In Mohali
Six Months Industrial Training In MohaliSix Months Industrial Training In Mohali
Six Months Industrial Training In Mohali
Ammy Patrix
 
Industrial training on a live projects
Industrial training on a live projectsIndustrial training on a live projects
Industrial training on a live projects
hrabhyaas
 
Achieving Technical Excellence in Your Software Teams - from Devternity
Achieving Technical Excellence in Your Software Teams - from Devternity Achieving Technical Excellence in Your Software Teams - from Devternity
Achieving Technical Excellence in Your Software Teams - from Devternity
Peter Gfader
 

Similar to Going beyond “Sorry, I didn’t get that”: building AI assistants that scale using machine learning (PyData DC 2018) (20)

Mining Social Web APIs with IPython Notebook (Data Day Texas 2015)
Mining Social Web APIs with IPython Notebook (Data Day Texas 2015)Mining Social Web APIs with IPython Notebook (Data Day Texas 2015)
Mining Social Web APIs with IPython Notebook (Data Day Texas 2015)
 
ShruthiNayak
ShruthiNayakShruthiNayak
ShruthiNayak
 
Lambda architecture for real time big data
Lambda architecture for real time big dataLambda architecture for real time big data
Lambda architecture for real time big data
 
Neurodb Engr245 2021 Lessons Learned
Neurodb Engr245 2021 Lessons LearnedNeurodb Engr245 2021 Lessons Learned
Neurodb Engr245 2021 Lessons Learned
 
Rasa AI: Building clever chatbots
Rasa AI: Building clever chatbotsRasa AI: Building clever chatbots
Rasa AI: Building clever chatbots
 
Resume
ResumeResume
Resume
 
Saloni jaiswal mba-2nd semester_miniproject
Saloni jaiswal mba-2nd semester_miniprojectSaloni jaiswal mba-2nd semester_miniproject
Saloni jaiswal mba-2nd semester_miniproject
 
Kono.IntelCraft.Weekly.AI.LLM.Landscape.2024.02.28.pdf
Kono.IntelCraft.Weekly.AI.LLM.Landscape.2024.02.28.pdfKono.IntelCraft.Weekly.AI.LLM.Landscape.2024.02.28.pdf
Kono.IntelCraft.Weekly.AI.LLM.Landscape.2024.02.28.pdf
 
GSoC 2017 Proposal - Chatbot for DBpedia
GSoC 2017 Proposal - Chatbot for DBpedia GSoC 2017 Proposal - Chatbot for DBpedia
GSoC 2017 Proposal - Chatbot for DBpedia
 
LangChain Intro by KeyMate.AI
LangChain Intro by KeyMate.AILangChain Intro by KeyMate.AI
LangChain Intro by KeyMate.AI
 
LanGCHAIN Framework
LanGCHAIN FrameworkLanGCHAIN Framework
LanGCHAIN Framework
 
Improving ad hoc and production workflows at Stitch Fix
Improving ad hoc and production workflows at Stitch FixImproving ad hoc and production workflows at Stitch Fix
Improving ad hoc and production workflows at Stitch Fix
 
Big Data and Hadoop Training in Bangalore by myTectra
Big Data and Hadoop Training in Bangalore by myTectraBig Data and Hadoop Training in Bangalore by myTectra
Big Data and Hadoop Training in Bangalore by myTectra
 
Atlassian User Group NYC April 27 2017 Presentations
Atlassian User Group NYC April 27 2017 PresentationsAtlassian User Group NYC April 27 2017 Presentations
Atlassian User Group NYC April 27 2017 Presentations
 
Walter api
Walter apiWalter api
Walter api
 
Dl applicationlandscape-mar2018-180405144127
Dl applicationlandscape-mar2018-180405144127Dl applicationlandscape-mar2018-180405144127
Dl applicationlandscape-mar2018-180405144127
 
Deep Learning: Application Landscape - March 2018
Deep Learning: Application Landscape - March 2018Deep Learning: Application Landscape - March 2018
Deep Learning: Application Landscape - March 2018
 
Six Months Industrial Training In Mohali
Six Months Industrial Training In MohaliSix Months Industrial Training In Mohali
Six Months Industrial Training In Mohali
 
Industrial training on a live projects
Industrial training on a live projectsIndustrial training on a live projects
Industrial training on a live projects
 
Achieving Technical Excellence in Your Software Teams - from Devternity
Achieving Technical Excellence in Your Software Teams - from Devternity Achieving Technical Excellence in Your Software Teams - from Devternity
Achieving Technical Excellence in Your Software Teams - from Devternity
 

Recently uploaded

What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
aisafed42
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 

Recently uploaded (20)

What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 

Going beyond “Sorry, I didn’t get that”: building AI assistants that scale using machine learning (PyData DC 2018)

  • 1. Justina Petraityte, Developer Advocate @ Rasa Going beyond ‘Sorry, I didn’t get that’: building AI assistants that scale using machine learning
  • 2. What are we focusing on during this workshop Introduction Goal: Build a machine learning - powered assistant Roadmap: 1. Natural Language Understanding i. Introduction and theory ii. Coding 2. Dialogue Handling i. Introduction and theory ii. Coding 3. Closing the feedback loop 4. Questions
  • 3. Setup Introduction 1. Jupyter notebook in python 3.6 2. Download: Repository: https://github.com/RasaHQ/rasa-workshop-pydata-dc Alternative: 1. Google Colab: https://pydata.org/dc2018/proposals/43/
  • 4. Conversational AI will dramatically change how your customers interact with you. Example of a live Skill: A customer can change her address via Facebook Messenger
  • 5. MACHINE LEARNING-BASED DIALOGUE MANAGEMENT https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 6. Rasa the OSS to build conversational software with ML Introduction Backend, database, API, etc. Dialogue Management “Brain” Input Modules “Ears” NLU, GUI elements, context, personal info Output Modules “Mouth” NLG, GUI elements Connector Modules Connector to any conversational platforms “What’s the weather like tomorrow?” (User Request via text or voice) “It will be sunny and 20°C.” (AI response via text or voice) https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 7. Why Rasa? Introduction Runs Locally ● No Network Overhead ● Control QoS ● Deploy anywhere Hackable ● Tune models for your use case Own Your Data ● Don’t hand data over to big tech co’s ● Avoid vendor lock-in 7https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 8. Under the hood Natural Language Understanding
  • 9. Rasa NLU: Natural Language Understanding Under the Hood Goal: create structured data I have a new address, it’s 709 King St, San Francisco https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 10. Natural Language Understanding Natural Language Understanding What’s the weather like tomorrow? Example Intent Classification Pipeline ”What’s the weather like tomorrow?” { “intent”: “request_weather” } Vectorization Intent Classification Under The Hood https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 11. Rasa NLU: Natural Language Understanding Under the Hood Bags are your friend Bag of words SVM greet goodbye thank_you request_weather confirm What’s the weather like tomorrow? https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 12. Rasa NLU: Natural Language Understanding Under the Hood Natural Language Understanding What’s the weather like tomorrow? Example Entity Extraction Pipeline ”What’s the weather like tomorrow?” { “date”: “tomorrow” } Tokenizer Part of Speech Tagger Chunker Named Entity Recognition Entity Extraction Example Intent Classification Pipeline ”What’s the weather like tomorrow?” { “intent”: “request_weather” } Vectorization Intent Classification https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 13. Rasa NLU: Entity Extraction Under the Hood Where can I get a burrito in the 2nd arrondissement ? cuisine location 1. Binary classifier is_entity & then entity_classifier 2. Direct structured prediction averaged perceptron https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 14. Limitation: Classifier with a single ‘correct’ label https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 15. Supervised Word Vectors (the new way) Text Classification beyond word2vec References: WSABIE (Weston, Bengio, Usunier) StarSpace (Wu et al) https://github.com/RasaHQ/rasa-workshop-pydata-dc
  • 18. Why Dialogue Handling with Rasa Core? Under The Hood ● No more state machines! ● Reinforcement Learning: too much data, reward functions... ● Need a simple solution for everyone
  • 19. Learn from real data instead of writing more rules
  • 20. Rasa Core: Dialogue Handling Under The Hood “What’s the weather like tomorrow?” Intent Entities next ActionState previous Action “Thanks.” after next Action updated State “It will be sunny and 20°C.” SVM Recurrent NN ...
  • 21. Rasa Core: Dialogue Handling Under The Hood “What’s the weather like tomorrow?” “It will be sunny and 20°C.” Entity Input Action Mask Renormal- ization Sample action Action type? Response API Call Recurrent NN API Call Entity Output Intent Classification Entity Extraction Similar to LSTM-dialogue prediction paper: https://arxiv.org/abs/1606.01269 21
  • 23. Rasa Core: Dialogue Training Under The Hood Issue: How to get started? Interactive Learning→ What’s the weather like tomorrow? How did you like it? Correct wrong behaviour Retrain model It will be sunny and 20°C.
  • 26. Closing The Loop Final Thoughts “What’s the weather like tomorrow?” (User Request via text or voice) New Training Data Retrain ML Models Correct Training Data Relabel Collected Data Use Improved Model
  • 27. Open challenges Final Thoughts ● Handling OOV words ● Multi language entity recognition ● Combination of dialogue models ● Negation We’re constantly working on improving our models! For those that are curious:
  • 28. ● Techniques to handle small data sets are key to get started with conversational AI ● Deep ML techniques help advance state of the art NLU and conversational AI ● Combine ML with traditional Programming and Rules where appropriate ● Abandon flow charts Summary Final Thoughts 4 take home thoughts:
  • 29. Get in touch! Justina Petraityte Developer Advocate juste@rasa.com @juste_petr Join Rasa Community!