SlideShare a Scribd company logo
NLP 101 + ChatBots
HELLO!
Chris Shei
Tech Evangelist @ Jet.com
What will you learn today?
● NLP 101 (What it is / Difficulties)
● Turing Test
● Language Modeling / Feature Learning Techniques
(word2vec)
● Dialog Flow Demo (Intents, Entities, etc.)
What is NLP?
1
What is Natural Language Processing?
Subfield of AI + Linguistics focused
on the interaction between
computers and human natural
languages
Source: Bill MacCartney 2014
Why is NLP difficult?
2
Ambiguity in Language
Miscommunication happens even when it’s just two humans
communicating…
Humans can learn and clarify
Examples of ambiguity in just
the English Language
Ambiguity in Speech Recognition
“Recognize Speech” vs “Wreck a Nice Beach”
We ‘mishear’ lyrics all the time…
Ambiguity in Pronunciation (Heteronyms)
Heteronyms - Words spelled identically, but have different
meanings when pronounced differently.
Lead me to the lead (metal).
My next project is to learn how to project my voice.
Syntactic Ambiguity (ambiguous sentence structure)
“I saw a man on the hill
with a telescope”
Source: Deniz Yuret
Lexical Ambiguity
Polysemy - more than one meaning
“Picture (verb) a high mountain”
“That’s a nice picture (noun)”
Homonomy - same pronunciation + spelling, different in
meaning
Lie - making an untrue statement
Lie - to lay down
Lexical Ambiguity
Will, will Will will Will Will's will?
Will(1) Will (3)
Future
tense
Bequeath (to)Will (2) Will (2) Document
Someone asked Will 1 directly if Will 2 plans to bequeath his own
will, the document, to Will 3.
So why is NLP cool?
“There’s no way you can have an AI
system that’s humanlike that doesn’t
have language at the heart of it
- Josh Tenenbaum
Turing Test
3
Test of a machine's ability to exhibit
intelligent behavior equivalent to, or
indistinguishable from, that of a human.
Source: Wikipedia
“
Can Machines Think?
“Are there imaginable digital
computers which would do well in the
imitation game?
- Alan Turing
The Original Imitation Game
The Modern Turing Test
Judge to determine if they’re speaking to a human or computer
Source: Wikipedia
‘Passing’ the Turing Test
Established by tricking the judges:
- Building a ‘forgiving’ persona (young or ESL)
- Evading questions
- Deflecting questions back to the user
Eugene Goostman ‘passes’ the Turing Test
Scott: Which is bigger, a shoebox or Mount Everest?
Eugene: I can’t make a choice right now. I should think it out later. And I forgot to ask
you where you are from…
Scott: How many legs does a camel have?
Eugene: Something between 2 and 4. Maybe, three? :-))) By the way, I still don’t know
your specialty – or, possibly, I’ve missed it?
Source: Scott Aaronson
Imitation Game Criticisms
What is 12345*54321? (Intelligent or unintelligent behavior?)
Naivete + training of interrogators (What if judges think a human
is a machine?)
Impracticality + Irrelevance (better and more valuable tests of
intelligence)
Approaches to NLP
4
Early NLP Systems: Rule-based
- Hard If-Then rules (e.g. Decision Trees)
Later NLP Systems: Statistical models
- Soft, probabilistic decisions
Benefits of later NLP systems:
- Automatic focus on the most ‘common’ cases (instead of deciding
where to focus)
- Robust to unfamiliar input (e.g. misspelled or accidentally omitted
words)
- Accuracy can be improved by providing more input data (easier than
increasing the complexity of a system)
How do we encode words?
One-hot encoding | Disadvantages?
Source: Marco Bonzanini
Word Embeddings
By encoding them as a vector, we can apply
mathematical rules to them
Let’s do some word math:
King - Man + Woman = ?
Queen
Source: Loren Shure
Word Vectors
Source: Jayesh Bapu Ahire
Source: Jayesh Bapu Ahire
So how do we get these
vectors?
Word Embedding (e.g. word2vec)
Given an ‘input’ word, tell us the probability of these other
words showing up nearby
Source: Jayesh Bapu Ahire
Word Embedding (e.g. word2vec)
Source: Chris McCormick
“
You shall know a word by the
company it keeps - J.R. Firth
Distributional Hypothesis
Standard NLP Workflow
Resources:
Ultimate guide to understand & implement NLP
A practitioners guide to NLP
How to solve 90% of NLP Problems
Source: Dipanjan Sarkar
DialogFlow
5
DialogFlow
Build engaging voice + text based conversational
interfaces supported by a powerful NLU engine
What are we going to build today
Ask for the address
Order a T-Shirt
- Color
- Size
Asks if you want a receipt
- Asks for an email if yes
- Gives a confirmation # if no
Intent - a specific action the user is trying to achieve
What are we going to build today
Ask for the address
Order a T-Shirt
- Color
- Size
Asks if you want a receipt
- Asks for an email if yes
- Gives a confirmation # if no
Intents
- Intent Name
- Training Phrases
- Response
Default Intents | Fallback Intent + Welcome Intent
What are we going to build today
Ask for the address
Order a T-Shirt
- Size
- Color
Asks if you want a receipt
- Asks for an email if yes
- Gives a confirmation # if no
What are we going to build today
Ask for the address
Order a T-Shirt
- Size (Required)
- Color (Required)
Asks if you want a receipt
- Asks for an email if yes
- Gives a confirmation # if no
Actions + Parameters
Extracts relevant information from user
utterances (e.g. dates, times, names, etc)
Entities
Entities are Dialogflow's mechanism for
identifying and extracting useful data from natural
language inputs.
What are we going to build today
Ask for the address
Order a T-Shirt
- Size (Required)
- Color (Required)
Asks if you want a receipt
- Asks for an email if yes
- Gives a confirmation # if no
What are we going to build today
Ask for the address
Order a T-Shirt
- Size (Required)
- Color (Required)
Asks if you want a receipt
- Asks for an email if yes
- Gives a confirmation # if no
Follow Up Intents + Context
Advanced Concepts:
Integration
Analytics
Troubleshooting
The docs are fantastic!
https://dialogflow.com/docs
THANKS!
Any questions?
You can find me at
chris.shei@jet.com
@ckshei
www.bespokelife.co

More Related Content

PPTX
Retrofitting Word Vectors to Semantic Lexicons
PDF
Recent Trends in Personalization at Netflix
PDF
Introduction to Transformers for NLP - Olga Petrova
PPTX
Natural Language Processing (NLP) - Introduction
PDF
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)
PDF
RealTime Recommendations @Netflix - Spark
PDF
Deep Learning for Personalized Search and Recommender Systems
PDF
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix Scale
Retrofitting Word Vectors to Semantic Lexicons
Recent Trends in Personalization at Netflix
Introduction to Transformers for NLP - Olga Petrova
Natural Language Processing (NLP) - Introduction
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)
RealTime Recommendations @Netflix - Spark
Deep Learning for Personalized Search and Recommender Systems
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix Scale

What's hot (20)

PPTX
NLP Bootcamp
PDF
Wide&Deep Learning for Recommender Systems
PDF
RoFormer: Enhanced Transformer with Rotary Position Embedding
PDF
Unified Approach to Interpret Machine Learning Model: SHAP + LIME
PDF
딥러닝 자연어처리 - RNN에서 BERT까지
PDF
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
PDF
NDC 2016 김정주 - 기계학습을 활용한 게임어뷰징 검출
PDF
Transformerを多層にする際の勾配消失問題と解決法について
PPTX
Natural language processing and transformer models
PPT
Introduction to Natural Language Processing
PPTX
Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1 나무기술(주) 최유석 20170912
PPTX
Introduction to natural language processing, history and origin
PPTX
[Paper Reading] Attention is All You Need
PDF
딥러닝 기반의 자연어처리 최근 연구 동향
PPTX
Notes on attention mechanism
PDF
GANの概要とDCGANのアーキテクチャ/アルゴリズム
ODP
Geri Yayılım Algoritması
PDF
Starring sakila my sql university 2009
PDF
Using Large Language Models in 10 Lines of Code
PPTX
머신러닝의 자연어 처리기술(I)
NLP Bootcamp
Wide&Deep Learning for Recommender Systems
RoFormer: Enhanced Transformer with Rotary Position Embedding
Unified Approach to Interpret Machine Learning Model: SHAP + LIME
딥러닝 자연어처리 - RNN에서 BERT까지
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
NDC 2016 김정주 - 기계학습을 활용한 게임어뷰징 검출
Transformerを多層にする際の勾配消失問題と解決法について
Natural language processing and transformer models
Introduction to Natural Language Processing
Bigquery와 airflow를 이용한 데이터 분석 시스템 구축 v1 나무기술(주) 최유석 20170912
Introduction to natural language processing, history and origin
[Paper Reading] Attention is All You Need
딥러닝 기반의 자연어처리 최근 연구 동향
Notes on attention mechanism
GANの概要とDCGANのアーキテクチャ/アルゴリズム
Geri Yayılım Algoritması
Starring sakila my sql university 2009
Using Large Language Models in 10 Lines of Code
머신러닝의 자연어 처리기술(I)
Ad

Similar to NLP 101 + Chatbots (20)

PDF
Natural Language Processing
PDF
Module 8: Natural language processing Pt 1
PPTX
IA definitions dans tous les secteurs confondus.pptx
PPTX
the rain in spain falls mainly in the plains (test)
PPT
Big Data and Natural Language Processing
PPTX
From Natural Language Processing to Artificial Intelligence
PPT
intro.ppt
PPT
intro.ppt
PPT
PPT
intro.ppt
PPT
Introduction to AI and explain the magic of the magic of Nosql and explain in...
PPT
intro.ppt
PPT
AI unit-1a.ppt
PPT
intro_to_DL.ppt
PPT
AI iNTRO content on fundamentals all.ppt
PPT
intro.ppt
PPT
intro.ppt
PPT
$RGK1H9G.ppt
PPT
intro.ppt
Natural Language Processing
Module 8: Natural language processing Pt 1
IA definitions dans tous les secteurs confondus.pptx
the rain in spain falls mainly in the plains (test)
Big Data and Natural Language Processing
From Natural Language Processing to Artificial Intelligence
intro.ppt
intro.ppt
intro.ppt
Introduction to AI and explain the magic of the magic of Nosql and explain in...
intro.ppt
AI unit-1a.ppt
intro_to_DL.ppt
AI iNTRO content on fundamentals all.ppt
intro.ppt
intro.ppt
$RGK1H9G.ppt
intro.ppt
Ad

Recently uploaded (20)

PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPT
Module 1.ppt Iot fundamentals and Architecture
PPT
What is a Computer? Input Devices /output devices
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Modernising the Digital Integration Hub
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Hybrid model detection and classification of lung cancer
PPTX
The various Industrial Revolutions .pptx
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Getting started with AI Agents and Multi-Agent Systems
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Hindi spoken digit analysis for native and non-native speakers
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
observCloud-Native Containerability and monitoring.pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
A comparative study of natural language inference in Swahili using monolingua...
NewMind AI Weekly Chronicles – August ’25 Week III
Module 1.ppt Iot fundamentals and Architecture
What is a Computer? Input Devices /output devices
1 - Historical Antecedents, Social Consideration.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Modernising the Digital Integration Hub
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Enhancing emotion recognition model for a student engagement use case through...
Univ-Connecticut-ChatGPT-Presentaion.pdf
Hybrid model detection and classification of lung cancer
The various Industrial Revolutions .pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Getting started with AI Agents and Multi-Agent Systems

NLP 101 + Chatbots

  • 1. NLP 101 + ChatBots
  • 3. What will you learn today? ● NLP 101 (What it is / Difficulties) ● Turing Test ● Language Modeling / Feature Learning Techniques (word2vec) ● Dialog Flow Demo (Intents, Entities, etc.)
  • 5. What is Natural Language Processing? Subfield of AI + Linguistics focused on the interaction between computers and human natural languages
  • 7. Why is NLP difficult? 2
  • 8. Ambiguity in Language Miscommunication happens even when it’s just two humans communicating… Humans can learn and clarify
  • 9. Examples of ambiguity in just the English Language
  • 10. Ambiguity in Speech Recognition “Recognize Speech” vs “Wreck a Nice Beach” We ‘mishear’ lyrics all the time…
  • 11. Ambiguity in Pronunciation (Heteronyms) Heteronyms - Words spelled identically, but have different meanings when pronounced differently. Lead me to the lead (metal). My next project is to learn how to project my voice.
  • 12. Syntactic Ambiguity (ambiguous sentence structure) “I saw a man on the hill with a telescope” Source: Deniz Yuret
  • 13. Lexical Ambiguity Polysemy - more than one meaning “Picture (verb) a high mountain” “That’s a nice picture (noun)” Homonomy - same pronunciation + spelling, different in meaning Lie - making an untrue statement Lie - to lay down
  • 14. Lexical Ambiguity Will, will Will will Will Will's will? Will(1) Will (3) Future tense Bequeath (to)Will (2) Will (2) Document Someone asked Will 1 directly if Will 2 plans to bequeath his own will, the document, to Will 3.
  • 15. So why is NLP cool?
  • 16. “There’s no way you can have an AI system that’s humanlike that doesn’t have language at the heart of it - Josh Tenenbaum
  • 18. Test of a machine's ability to exhibit intelligent behavior equivalent to, or indistinguishable from, that of a human. Source: Wikipedia
  • 20. “Are there imaginable digital computers which would do well in the imitation game? - Alan Turing
  • 22. The Modern Turing Test Judge to determine if they’re speaking to a human or computer Source: Wikipedia
  • 23. ‘Passing’ the Turing Test Established by tricking the judges: - Building a ‘forgiving’ persona (young or ESL) - Evading questions - Deflecting questions back to the user
  • 24. Eugene Goostman ‘passes’ the Turing Test Scott: Which is bigger, a shoebox or Mount Everest? Eugene: I can’t make a choice right now. I should think it out later. And I forgot to ask you where you are from… Scott: How many legs does a camel have? Eugene: Something between 2 and 4. Maybe, three? :-))) By the way, I still don’t know your specialty – or, possibly, I’ve missed it? Source: Scott Aaronson
  • 25. Imitation Game Criticisms What is 12345*54321? (Intelligent or unintelligent behavior?) Naivete + training of interrogators (What if judges think a human is a machine?) Impracticality + Irrelevance (better and more valuable tests of intelligence)
  • 27. Early NLP Systems: Rule-based - Hard If-Then rules (e.g. Decision Trees) Later NLP Systems: Statistical models - Soft, probabilistic decisions Benefits of later NLP systems: - Automatic focus on the most ‘common’ cases (instead of deciding where to focus) - Robust to unfamiliar input (e.g. misspelled or accidentally omitted words) - Accuracy can be improved by providing more input data (easier than increasing the complexity of a system)
  • 28. How do we encode words?
  • 29. One-hot encoding | Disadvantages? Source: Marco Bonzanini
  • 30. Word Embeddings By encoding them as a vector, we can apply mathematical rules to them
  • 31. Let’s do some word math: King - Man + Woman = ? Queen
  • 35. So how do we get these vectors?
  • 36. Word Embedding (e.g. word2vec) Given an ‘input’ word, tell us the probability of these other words showing up nearby Source: Jayesh Bapu Ahire
  • 37. Word Embedding (e.g. word2vec) Source: Chris McCormick
  • 38. “ You shall know a word by the company it keeps - J.R. Firth Distributional Hypothesis
  • 39. Standard NLP Workflow Resources: Ultimate guide to understand & implement NLP A practitioners guide to NLP How to solve 90% of NLP Problems Source: Dipanjan Sarkar
  • 41. DialogFlow Build engaging voice + text based conversational interfaces supported by a powerful NLU engine
  • 42. What are we going to build today Ask for the address Order a T-Shirt - Color - Size Asks if you want a receipt - Asks for an email if yes - Gives a confirmation # if no
  • 43. Intent - a specific action the user is trying to achieve
  • 44. What are we going to build today Ask for the address Order a T-Shirt - Color - Size Asks if you want a receipt - Asks for an email if yes - Gives a confirmation # if no
  • 45. Intents - Intent Name - Training Phrases - Response
  • 46. Default Intents | Fallback Intent + Welcome Intent
  • 47. What are we going to build today Ask for the address Order a T-Shirt - Size - Color Asks if you want a receipt - Asks for an email if yes - Gives a confirmation # if no
  • 48. What are we going to build today Ask for the address Order a T-Shirt - Size (Required) - Color (Required) Asks if you want a receipt - Asks for an email if yes - Gives a confirmation # if no
  • 49. Actions + Parameters Extracts relevant information from user utterances (e.g. dates, times, names, etc)
  • 50. Entities Entities are Dialogflow's mechanism for identifying and extracting useful data from natural language inputs.
  • 51. What are we going to build today Ask for the address Order a T-Shirt - Size (Required) - Color (Required) Asks if you want a receipt - Asks for an email if yes - Gives a confirmation # if no
  • 52. What are we going to build today Ask for the address Order a T-Shirt - Size (Required) - Color (Required) Asks if you want a receipt - Asks for an email if yes - Gives a confirmation # if no
  • 53. Follow Up Intents + Context
  • 55. The docs are fantastic! https://dialogflow.com/docs
  • 56. THANKS! Any questions? You can find me at chris.shei@jet.com @ckshei www.bespokelife.co

Editor's Notes

  • #7: Source: https://nlp.stanford.edu/~wcmac/papers/20140716-UNLU.pdf
  • #11: Read More: https://www.slideshare.net/zareen/challenges-in-nlp
  • #13: Source: http://www.denizyuret.com/2010/12/research-focus.html
  • #17: Josh Tenenbaum Professor of cognitive science and computation at MIT
  • #18: https://www.csee.umbc.edu/courses/471/papers/turing.pdf https://www.youtube.com/watch?v=3wLqsRLvV-c http://www.psych.utoronto.ca/users/reingold/courses/ai/turing.html https://en.wikipedia.org/wiki/Turing_test
  • #19: https://en.wikipedia.org/wiki/Turing_test
  • #20: Question is too vague… ‘thinking’ is difficult to define https://en.wikipedia.org/wiki/Turing_test#Imitation_game_vs._standard_Turing_test
  • #21: Exhibit intelligent behavior equivalent to, or indistinguishable from, that of a human
  • #23: https://en.wikipedia.org/wiki/Turing_test
  • #25: Source: https://www.scottaaronson.com/blog/?p=1858
  • #26: https://en.wikipedia.org/wiki/Turing_test
  • #28: Source: https://en.wikipedia.org/wiki/Natural_language_processing
  • #30: Source: https://www.pycon.it/media/conference/slides/word-embeddings-for-natural-language-processing-in-python.pdf
  • #33: https://blogs.mathworks.com/loren/2017/09/21/math-with-words-word-embeddings-with-matlab-and-text-analytics-toolbox/
  • #34: Source: https://medium.com/@jayeshbahire/introduction
  • #35: Source: https://medium.com/@jayeshbahire/introduction
  • #40: https://www.analyticsvidhya.com/blog/2017/01/ultimate-guide-to-understand-implement-natural-language-processing-codes-in-python/ https://towardsdatascience.com/a-practitioners-guide-to-natural-language-processing-part-i-processing-understanding-text-9f4abfd13e72 https://blog.insightdatascience.com/how-to-solve-90-of-nlp-problems-a-step-by-step-guide-fda605278e4e