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

C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발흥배 최
 
MagicOnion~C#でゲームサーバを開発しよう~
MagicOnion~C#でゲームサーバを開発しよう~MagicOnion~C#でゲームサーバを開発しよう~
MagicOnion~C#でゲームサーバを開発しよう~torisoup
 
Unity C#と.NET Core(MagicOnion) C# そしてKotlinによるハーモニー
Unity C#と.NET Core(MagicOnion) C# そしてKotlinによるハーモニーUnity C#と.NET Core(MagicOnion) C# そしてKotlinによるハーモニー
Unity C#と.NET Core(MagicOnion) C# そしてKotlinによるハーモニーYoshifumi Kawai
 
Orange Cube 自社フレームワーク 2015/3
Orange Cube 自社フレームワーク 2015/3Orange Cube 自社フレームワーク 2015/3
Orange Cube 自社フレームワーク 2015/3信之 岩永
 
C# 継承フォームの作成
C# 継承フォームの作成C# 継承フォームの作成
C# 継承フォームの作成Hiroki Takahashi
 
Natural language processing: feature extraction
Natural language processing: feature extractionNatural language processing: feature extraction
Natural language processing: feature extractionGabriel Hamilton
 
Linuxにて複数のコマンドを並列実行(同時実行数の制限付き)
Linuxにて複数のコマンドを並列実行(同時実行数の制限付き)Linuxにて複数のコマンドを並列実行(同時実行数の制限付き)
Linuxにて複数のコマンドを並列実行(同時実行数の制限付き)Hiro H.
 
非同期処理の基礎
非同期処理の基礎非同期処理の基礎
非同期処理の基礎信之 岩永
 
Raspberry Piにdiskless modeのalpine linuxを導入してみる
Raspberry Piにdiskless modeのalpine linuxを導入してみるRaspberry Piにdiskless modeのalpine linuxを導入してみる
Raspberry Piにdiskless modeのalpine linuxを導入してみるKenichiro MATOHARA
 
PGroonga 2 - PostgreSQLでの全文検索の決定版
PGroonga 2 - PostgreSQLでの全文検索の決定版PGroonga 2 - PostgreSQLでの全文検索の決定版
PGroonga 2 - PostgreSQLでの全文検索の決定版Kouhei Sutou
 
C#や.NET Frameworkがやっていること
C#や.NET FrameworkがやっていることC#や.NET Frameworkがやっていること
C#や.NET Frameworkがやっていること信之 岩永
 
国際化時代の40カ国語言語判定
国際化時代の40カ国語言語判定国際化時代の40カ国語言語判定
国際化時代の40カ国語言語判定Shuyo Nakatani
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Pythonkwatch
 
Language Detection Library for Java
Language Detection Library for Java Language Detection Library for Java
Language Detection Library for Java Shuyo Nakatani
 
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭するCEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭するYoshifumi Kawai
 
いまさら聞けないselectあれこれ
いまさら聞けないselectあれこれいまさら聞けないselectあれこれ
いまさら聞けないselectあれこれlestrrat
 
Webアプリでパスワード保護はどこまでやればいいか
Webアプリでパスワード保護はどこまでやればいいかWebアプリでパスワード保護はどこまでやればいいか
Webアプリでパスワード保護はどこまでやればいいかHiroshi Tokumaru
 

What's hot (20)

C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발
 
MagicOnion~C#でゲームサーバを開発しよう~
MagicOnion~C#でゲームサーバを開発しよう~MagicOnion~C#でゲームサーバを開発しよう~
MagicOnion~C#でゲームサーバを開発しよう~
 
Unity C#と.NET Core(MagicOnion) C# そしてKotlinによるハーモニー
Unity C#と.NET Core(MagicOnion) C# そしてKotlinによるハーモニーUnity C#と.NET Core(MagicOnion) C# そしてKotlinによるハーモニー
Unity C#と.NET Core(MagicOnion) C# そしてKotlinによるハーモニー
 
見積り入門
見積り入門見積り入門
見積り入門
 
Orange Cube 自社フレームワーク 2015/3
Orange Cube 自社フレームワーク 2015/3Orange Cube 自社フレームワーク 2015/3
Orange Cube 自社フレームワーク 2015/3
 
C# 継承フォームの作成
C# 継承フォームの作成C# 継承フォームの作成
C# 継承フォームの作成
 
Natural language processing: feature extraction
Natural language processing: feature extractionNatural language processing: feature extraction
Natural language processing: feature extraction
 
C#で速度を極めるいろは
C#で速度を極めるいろはC#で速度を極めるいろは
C#で速度を極めるいろは
 
Linuxにて複数のコマンドを並列実行(同時実行数の制限付き)
Linuxにて複数のコマンドを並列実行(同時実行数の制限付き)Linuxにて複数のコマンドを並列実行(同時実行数の制限付き)
Linuxにて複数のコマンドを並列実行(同時実行数の制限付き)
 
非同期処理の基礎
非同期処理の基礎非同期処理の基礎
非同期処理の基礎
 
Raspberry Piにdiskless modeのalpine linuxを導入してみる
Raspberry Piにdiskless modeのalpine linuxを導入してみるRaspberry Piにdiskless modeのalpine linuxを導入してみる
Raspberry Piにdiskless modeのalpine linuxを導入してみる
 
PGroonga 2 - PostgreSQLでの全文検索の決定版
PGroonga 2 - PostgreSQLでの全文検索の決定版PGroonga 2 - PostgreSQLでの全文検索の決定版
PGroonga 2 - PostgreSQLでの全文検索の決定版
 
C#や.NET Frameworkがやっていること
C#や.NET FrameworkがやっていることC#や.NET Frameworkがやっていること
C#や.NET Frameworkがやっていること
 
国際化時代の40カ国語言語判定
国際化時代の40カ国語言語判定国際化時代の40カ国語言語判定
国際化時代の40カ国語言語判定
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Python
 
Binary Reading in C#
Binary Reading in C#Binary Reading in C#
Binary Reading in C#
 
Language Detection Library for Java
Language Detection Library for Java Language Detection Library for Java
Language Detection Library for Java
 
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭するCEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
 
いまさら聞けないselectあれこれ
いまさら聞けないselectあれこれいまさら聞けないselectあれこれ
いまさら聞けないselectあれこれ
 
Webアプリでパスワード保護はどこまでやればいいか
Webアプリでパスワード保護はどこまでやればいいかWebアプリでパスワード保護はどこまでやればいいか
Webアプリでパスワード保護はどこまでやればいいか
 

Similar to Building Conversational AI with Rasa Stack

Conversational AI with Rasa - PyData Workshop
Conversational AI with Rasa - PyData WorkshopConversational AI with Rasa - PyData Workshop
Conversational AI with Rasa - PyData WorkshopTom Bocklisch
 
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ė
 
Rasa AI: Building clever chatbots
Rasa AI: Building clever chatbotsRasa AI: Building clever chatbots
Rasa AI: Building clever chatbotsTom Bocklisch
 
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
 

Similar to Building Conversational AI with Rasa Stack (20)

Conversational AI with Rasa - PyData Workshop
Conversational AI with Rasa - PyData WorkshopConversational AI with Rasa - PyData Workshop
Conversational AI with Rasa - PyData Workshop
 
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...
 
Rasa AI: Building clever chatbots
Rasa AI: Building clever chatbotsRasa AI: Building clever chatbots
Rasa AI: Building clever chatbots
 
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...
 

Recently uploaded

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

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.