SlideShare a Scribd company logo
1 of 33
Download to read offline
Justina Petraityte, Developer Advocate
Deprecating the state machine: building
conversational AI with Rasa stack
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
An open source, highly scalable ML framework to
build
conversational software
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)
Alternatives:
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
What we are focusing on today
Introduction
Goal:
build & understand a bot based on machine learning
Roadmap:
1. Natural Language Understanding
i. Theory
ii. Let’s Code
2. Dialogue Handling
i. Theory
ii. Let’s Code
3. Research
4. Questions
Setup
Introduction
1. Jupyter notebook in python 3.6 (2.7 should work as well)
2. Download:
Repository: https://github.com/RasaHQ/rasa-workshop-pydata-berlin
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-berlin
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-berlin
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-berlin
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-berlin
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-berlin
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
Why Machine Learning?
Under The Hood
State Machines are infeasible
Under The Hood
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
Let’s code!
Rasa Core: Dialogue Training
Under The Hood
Issue: How to get started? Online 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
Research
Training NLU models without initial word vectors
Research
Goal: Learn an embedding for the intent labels based on the user messages
https://medium.com/rasa-blog/supervised-word-vectors-from-scratch-in-rasa-nlu-6daf794efcd8
https://medium.com/rasa-blog/how-to-handle-multiple-intents-per-input-using-rasa-nlu-tensorflow-pipeline
-75698b49c383
● Learns joined embeddings for intents & words at the same time
● Allows multi-intent labels
● Knows about similarity between intent labels
● Based on Starspace Paper
Training NLU models without initial word vectors
Research
Goal: Learn an embedding for the intent labels based on the user messages
Evaluation:
Multi-Intent:
Generalisation across dialogue tasks
Research
Why do we need this complex architecture? For generalisation between domains!
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
We’re constantly working on improving our models!
For those that are curious:
Current Research
Final Thoughts
Good reads for a rainy day:
● Last Words: Computational Linguistics and Deep Learning (blog)
https://goo.gl/lGSRuj
● Starspace Embeddings (paper)
https://arxiv.org/abs/1709.03856
● End-to-End dialogue system using RNN (paper)
https://arxiv.org/pdf/1604.04562.pdf
● MemN2N in python (github)
https://github.com/vinhkhuc/MemN2N-babi-python
● Sentence Embeddings (blog)
https://medium.com/huggingface/universal-word-sentence-embeddings-ce48ddc8fc3a
● 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.ai
@juste_petr
We are hiring!
ML Product
Success Engineer
Help the teams who are
using Rasa Platform
succeed.
ML Engineer
Help us push the limits of
the conversational AI
software.

More Related Content

What's hot

Introduction to natural language processing (NLP)
Introduction to natural language processing (NLP)Introduction to natural language processing (NLP)
Introduction to natural language processing (NLP)Alia Hamwi
 
BERT - Part 1 Learning Notes of Senthil Kumar
BERT - Part 1 Learning Notes of Senthil KumarBERT - Part 1 Learning Notes of Senthil Kumar
BERT - Part 1 Learning Notes of Senthil KumarSenthil Kumar M
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolMasud Rahman
 
Conversational AI with Transformer Models
Conversational AI with Transformer ModelsConversational AI with Transformer Models
Conversational AI with Transformer ModelsDatabricks
 
Progressive Web APP ( PWA )
Progressive Web APP ( PWA ) Progressive Web APP ( PWA )
Progressive Web APP ( PWA ) Bijaya Oli
 
Natural Language Toolkit (NLTK), Basics
Natural Language Toolkit (NLTK), Basics Natural Language Toolkit (NLTK), Basics
Natural Language Toolkit (NLTK), Basics Prakash Pimpale
 
Natural language processing (NLP) introduction
Natural language processing (NLP) introductionNatural language processing (NLP) introduction
Natural language processing (NLP) introductionRobert Lujo
 
Natural lanaguage processing
Natural lanaguage processingNatural lanaguage processing
Natural lanaguage processinggulshan kumar
 
Natural language processing
Natural language processingNatural language processing
Natural language processingKarenVacca
 
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)Deep Learning Italia
 
Introduction to Firebase with Android and Beyond...
Introduction to Firebase with Android and Beyond...Introduction to Firebase with Android and Beyond...
Introduction to Firebase with Android and Beyond...Kasper Loevborg Jensen
 
Lecture: Question Answering
Lecture: Question AnsweringLecture: Question Answering
Lecture: Question AnsweringMarina Santini
 
Language Empowering Intelligent Assistants (CHT)
Language Empowering Intelligent Assistants (CHT)Language Empowering Intelligent Assistants (CHT)
Language Empowering Intelligent Assistants (CHT)Yun-Nung (Vivian) Chen
 

What's hot (20)

Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Introduction to natural language processing (NLP)
Introduction to natural language processing (NLP)Introduction to natural language processing (NLP)
Introduction to natural language processing (NLP)
 
Nltk
NltkNltk
Nltk
 
BERT - Part 1 Learning Notes of Senthil Kumar
BERT - Part 1 Learning Notes of Senthil KumarBERT - Part 1 Learning Notes of Senthil Kumar
BERT - Part 1 Learning Notes of Senthil Kumar
 
Group duplex
Group duplexGroup duplex
Group duplex
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access Protocol
 
Google Duplex AI
Google Duplex AIGoogle Duplex AI
Google Duplex AI
 
Conversational AI with Transformer Models
Conversational AI with Transformer ModelsConversational AI with Transformer Models
Conversational AI with Transformer Models
 
BERT
BERTBERT
BERT
 
Progressive Web APP ( PWA )
Progressive Web APP ( PWA ) Progressive Web APP ( PWA )
Progressive Web APP ( PWA )
 
Natural Language Toolkit (NLTK), Basics
Natural Language Toolkit (NLTK), Basics Natural Language Toolkit (NLTK), Basics
Natural Language Toolkit (NLTK), Basics
 
Natural language processing (NLP) introduction
Natural language processing (NLP) introductionNatural language processing (NLP) introduction
Natural language processing (NLP) introduction
 
Natural lanaguage processing
Natural lanaguage processingNatural lanaguage processing
Natural lanaguage processing
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)
 
Introduction to Firebase with Android and Beyond...
Introduction to Firebase with Android and Beyond...Introduction to Firebase with Android and Beyond...
Introduction to Firebase with Android and Beyond...
 
Lecture: Question Answering
Lecture: Question AnsweringLecture: Question Answering
Lecture: Question Answering
 
Language Empowering Intelligent Assistants (CHT)
Language Empowering Intelligent Assistants (CHT)Language Empowering Intelligent Assistants (CHT)
Language Empowering Intelligent Assistants (CHT)
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 

Similar to Building Conversational AI with Rasa Stack

Going beyond ‘Sorry, I didn’t get that’: building AI assistants that scale us...
Going beyond ‘Sorry, I didn’t get that’: building AI assistants that scale us...Going beyond ‘Sorry, I didn’t get that’: building AI assistants that scale us...
Going beyond ‘Sorry, I didn’t get that’: building AI assistants that scale us...Justina Petraitytė
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven DesignNicolò Pignatelli
 
Kaz Sato, Evangelist, Google at MLconf ATL 2016
Kaz Sato, Evangelist, Google at MLconf ATL 2016Kaz Sato, Evangelist, Google at MLconf ATL 2016
Kaz Sato, Evangelist, Google at MLconf ATL 2016MLconf
 
ExperTwin: An Alter Ego in Cyberspace for Knowledge Workers
ExperTwin: An Alter Ego in Cyberspace for Knowledge WorkersExperTwin: An Alter Ego in Cyberspace for Knowledge Workers
ExperTwin: An Alter Ego in Cyberspace for Knowledge WorkersCarlos Toxtli
 
Open source ml systems that need to be built
Open source ml systems that need to be builtOpen source ml systems that need to be built
Open source ml systems that need to be builtNikhil Garg
 
Fast App development with SwellRT
Fast App development  with SwellRTFast App development  with SwellRT
Fast App development with SwellRTSamer Hassan
 
Nautral Langauge Processing - Basics / Non Technical
Nautral Langauge Processing - Basics / Non Technical Nautral Langauge Processing - Basics / Non Technical
Nautral Langauge Processing - Basics / Non Technical Dhruv Gohil
 
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...Justina Petraitytė
 
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...Justina Petraitytė
 
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdfITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdfOrtus Solutions, Corp
 
JAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav SrivastavJAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav SrivastavVaibhav Srivastav
 
Gdsc IIIT Surat Orientation 2022.pdf
Gdsc IIIT Surat Orientation 2022.pdfGdsc IIIT Surat Orientation 2022.pdf
Gdsc IIIT Surat Orientation 2022.pdfSparshJhariya2
 
Cloud Study Jam[1st OCT] gdscgtbit.pptx
Cloud Study Jam[1st OCT] gdscgtbit.pptxCloud Study Jam[1st OCT] gdscgtbit.pptx
Cloud Study Jam[1st OCT] gdscgtbit.pptxGDSCGTBIT
 
The Semantic Knowledge Graph
The Semantic Knowledge GraphThe Semantic Knowledge Graph
The Semantic Knowledge GraphTrey Grainger
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...Daniel Zivkovic
 
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchrohitcse52
 
Info Session : University Institute of engineering and technology , Kurukshet...
Info Session : University Institute of engineering and technology , Kurukshet...Info Session : University Institute of engineering and technology , Kurukshet...
Info Session : University Institute of engineering and technology , Kurukshet...HRITIKKHURANA1
 
JAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav SrivastavJAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav SrivastavVaibhav Srivastav
 
Building an Open Source, Real-Time, Billion Object Spatio-Temporal Search Pla...
Building an Open Source, Real-Time, Billion Object Spatio-Temporal Search Pla...Building an Open Source, Real-Time, Billion Object Spatio-Temporal Search Pla...
Building an Open Source, Real-Time, Billion Object Spatio-Temporal Search Pla...Paolo Corti
 

Similar to Building Conversational AI with Rasa Stack (20)

Going beyond ‘Sorry, I didn’t get that’: building AI assistants that scale us...
Going beyond ‘Sorry, I didn’t get that’: building AI assistants that scale us...Going beyond ‘Sorry, I didn’t get that’: building AI assistants that scale us...
Going beyond ‘Sorry, I didn’t get that’: building AI assistants that scale us...
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven Design
 
Kaz Sato, Evangelist, Google at MLconf ATL 2016
Kaz Sato, Evangelist, Google at MLconf ATL 2016Kaz Sato, Evangelist, Google at MLconf ATL 2016
Kaz Sato, Evangelist, Google at MLconf ATL 2016
 
ExperTwin: An Alter Ego in Cyberspace for Knowledge Workers
ExperTwin: An Alter Ego in Cyberspace for Knowledge WorkersExperTwin: An Alter Ego in Cyberspace for Knowledge Workers
ExperTwin: An Alter Ego in Cyberspace for Knowledge Workers
 
Open source ml systems that need to be built
Open source ml systems that need to be builtOpen source ml systems that need to be built
Open source ml systems that need to be built
 
Fast App development with SwellRT
Fast App development  with SwellRTFast App development  with SwellRT
Fast App development with SwellRT
 
Nautral Langauge Processing - Basics / Non Technical
Nautral Langauge Processing - Basics / Non Technical Nautral Langauge Processing - Basics / Non Technical
Nautral Langauge Processing - Basics / Non Technical
 
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
 
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
 
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdfITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
 
JAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav SrivastavJAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav Srivastav
 
Gdsc IIIT Surat Orientation 2022.pdf
Gdsc IIIT Surat Orientation 2022.pdfGdsc IIIT Surat Orientation 2022.pdf
Gdsc IIIT Surat Orientation 2022.pdf
 
Cloud Study Jam[1st OCT] gdscgtbit.pptx
Cloud Study Jam[1st OCT] gdscgtbit.pptxCloud Study Jam[1st OCT] gdscgtbit.pptx
Cloud Study Jam[1st OCT] gdscgtbit.pptx
 
The Semantic Knowledge Graph
The Semantic Knowledge GraphThe Semantic Knowledge Graph
The Semantic Knowledge Graph
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
 
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
 
Ai/ML services
Ai/ML servicesAi/ML services
Ai/ML services
 
Info Session : University Institute of engineering and technology , Kurukshet...
Info Session : University Institute of engineering and technology , Kurukshet...Info Session : University Institute of engineering and technology , Kurukshet...
Info Session : University Institute of engineering and technology , Kurukshet...
 
JAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav SrivastavJAVA Developer_Resume_Vaibhav Srivastav
JAVA Developer_Resume_Vaibhav Srivastav
 
Building an Open Source, Real-Time, Billion Object Spatio-Temporal Search Pla...
Building an Open Source, Real-Time, Billion Object Spatio-Temporal Search Pla...Building an Open Source, Real-Time, Billion Object Spatio-Temporal Search Pla...
Building an Open Source, Real-Time, Billion Object Spatio-Temporal Search Pla...
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Building Conversational AI with Rasa Stack

  • 1. Justina Petraityte, Developer Advocate Deprecating the state machine: building conversational AI with Rasa stack
  • 2. 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
  • 3. An open source, highly scalable ML framework to build conversational software
  • 4. 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) Alternatives:
  • 5. 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
  • 6. What we are focusing on today Introduction Goal: build & understand a bot based on machine learning Roadmap: 1. Natural Language Understanding i. Theory ii. Let’s Code 2. Dialogue Handling i. Theory ii. Let’s Code 3. Research 4. Questions
  • 7. Setup Introduction 1. Jupyter notebook in python 3.6 (2.7 should work as well) 2. Download: Repository: https://github.com/RasaHQ/rasa-workshop-pydata-berlin
  • 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-berlin
  • 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-berlin
  • 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-berlin
  • 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-berlin
  • 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-berlin
  • 16. 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
  • 18. State Machines are infeasible Under The Hood
  • 19. 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 ...
  • 20. 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
  • 22. Rasa Core: Dialogue Training Under The Hood Issue: How to get started? Online Learning→ What’s the weather like tomorrow? How did you like it? Correct wrong behaviour Retrain model It will be sunny and 20°C.
  • 25. Training NLU models without initial word vectors Research Goal: Learn an embedding for the intent labels based on the user messages https://medium.com/rasa-blog/supervised-word-vectors-from-scratch-in-rasa-nlu-6daf794efcd8 https://medium.com/rasa-blog/how-to-handle-multiple-intents-per-input-using-rasa-nlu-tensorflow-pipeline -75698b49c383 ● Learns joined embeddings for intents & words at the same time ● Allows multi-intent labels ● Knows about similarity between intent labels ● Based on Starspace Paper
  • 26. Training NLU models without initial word vectors Research Goal: Learn an embedding for the intent labels based on the user messages Evaluation: Multi-Intent:
  • 27. Generalisation across dialogue tasks Research Why do we need this complex architecture? For generalisation between domains!
  • 29. 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
  • 30. Open challenges Final Thoughts ● Handling OOV words ● Multi language entity recognition ● Combination of dialogue models We’re constantly working on improving our models! For those that are curious:
  • 31. Current Research Final Thoughts Good reads for a rainy day: ● Last Words: Computational Linguistics and Deep Learning (blog) https://goo.gl/lGSRuj ● Starspace Embeddings (paper) https://arxiv.org/abs/1709.03856 ● End-to-End dialogue system using RNN (paper) https://arxiv.org/pdf/1604.04562.pdf ● MemN2N in python (github) https://github.com/vinhkhuc/MemN2N-babi-python ● Sentence Embeddings (blog) https://medium.com/huggingface/universal-word-sentence-embeddings-ce48ddc8fc3a
  • 32. ● 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:
  • 33. Get in touch! Justina Petraityte Developer Advocate juste@rasa.ai @juste_petr We are hiring! ML Product Success Engineer Help the teams who are using Rasa Platform succeed. ML Engineer Help us push the limits of the conversational AI software.