SlideShare a Scribd company logo
1 of 22
Download to read offline
Meandering through the machine learning maze
NLP & Machine
Learning
Vijay Ganti
** I want to acknowledge full credit for the content of this deck to various sources including Stanford NLP & Deep Learning content, Machine Learning
Lectures by Andrew Ng, Natural Language Processing with Python and many more. This was purely an educational presentation with no monetary gains
for any parties
NLP powered by ML will change the way business gets done
❖ Conversational agents are becoming an important form of
human-computer communication (Customer support
interactions using chat-bots)
❖ Much of human-human communication is now mediated
by computers (Email, Social Media, Messaging)
❖ An enormous amount of knowledge is now available in
machine readable form as natural language text (web,
proprietary enterprise content)
What do I hope to achieve with this talk?
My 3 cents
Make it accessible & real
Get you excited
Give you a sense of what it takes
Make it real
Let’s start with a typical ML workflow
Training Data
Feature
Extractor
ML Algo
Prediction Data
Feature
Extractor
Classifier Model
Features
Features
Label
Input + Labels
Input Only
Let’s walk through the workflow
with an example
names_data = [(n,'male') for n in names.words('male.txt')]+
[(n,'female') for n in names.words('female.txt')]
Training Data
Input + Labels
Feature
Extractor
def gender_feature1(name):
return {'Last Letter': name[-1]}
def gender_feature2(name):
return {'last_letter': name[-1],'last_two_letters': name[-2:]}
Features
feature_set = [(gender_feature1(n), g) for n,g in names_data]
feature_set = [(gender_feature2(n), g) for n,g in names_data]
train, devtest, test = feature_set[1500:], feature_set[500:1500],
feature_set[:500]
Partition Data
classifier = nltk.NaiveBayesClassifier.train(train)
ML Algo
Classifier Model
Prediction_Accuracy = nltk.classify.accuracy(classifier, devtest)
Prediction = classifier.classify(gender_feature2(‘Kathryn’))
Prediction = (classifier.classify(gender_feature2(‘Vijay'))
Prediction = (classifier.classify(gender_feature2('Jenna'))
Classifier Model
Prediction
Exciting possibilities
Why is NLP hard?
Violinist Linked to JAL Crash Blossoms
Teacher Strikes Idle Kids
Red Tape Holds Up New Bridges
Hospitals Are Sued by 7 Foot Doctors
Juvenile Court to Try Shooting Defendant
Local High School Dropouts Cut in Half
Ambiguity
Tricky NEsInformal English
Why is NLP hard..er?
Segmentation issues
the New York-New Haven Railroad
the New York-New Haven Railroad
Idioms
Kodak moment
As cool as cucumber
Hold your horses
Kick the bucket
Neologisms
Gamify
Double-click
Bromance
Unfriend
Great job @justinbieber! Were SOO
PROUD of what youve accomplished! U
taught us 2 #neversaynever & you
yourself should never give up either♥
Where is A Bug’s Life playing …
Let It Be was recorded …
… a mutation on the for gene …
State of the language technology
Let’s go to Agra
Buy V1AGRA …
Spam Detection
Adj Noun Adv Noun Verb
big dog quickly China trump
Part of Speech Tagging (POS)
Person Company Place
Satya met with LinkedIn in Palo Alto
Named Entity Recognition (NER)
Sentiment Analysis
Vijay told Arnaud that he was wrong
Coreference Resolution
I need new batteries for my mouse
Word sense disambiguation
Information Extraction
MOSTLY SOLVED GOOD PROGRESS STILL VERY HARD
Questions and Answers
What kind of cable do I need to project from
my Mac ?
Paraphrasing
Dell acquired EMC last year
EMC was taken over by Dell 8 months back.
Summarization
Brexit vote shocked everyone
Financial markets are in turmoil
Young people are not happy
Brexit has been
disruptive
Chat/Dialog
What movie is
playing this
evening?
Casablanca. Do
you want to buy
tickets ?
Why is this a good time to solve hard problems in NLP?
❖ What has changed since 2006?
❖ New methods for unsupervised pre-training have been developed (Restricted
Boltzmann Machines, auto-encoders, contrastive estimation, etc.)
❖ More efficient parameter estimation methods
❖ Better understanding of model regularization
❖ Changes in computing technology favor deep learning
❖ In NLP, speed has traditionally come from exploiting sparsity
❖ But with modern machines, branches and widely spaced memory accesses are costly
❖ Uniform parallel operations on dense vectors are faster These trends are even
stronger with multi-core CPUs and GPUs
❖ Wide availability of ML implementations and computing infrastructure to run them
Come back to this slide
What does it take ?
What you need to learn to make machines learn ?
❖ Machine Learning Process & Concepts
❖ Feature engineering
❖ Bias / Variance (overfitting, underfitting)
❖ Performance testing (accuracy, precision, recall, f-score)
❖ regularization
❖ Parameter selection
❖ Algo selection ( Wait for next slide for a quick summary of algos used at Netflix)
❖ Probability
❖ Linear Algebra (vector & matrices)
❖ Some calculus
❖ Python
❖ Octave/Matlab
Why is this a good time to solve hard problems in NLP?
❖ What has changed since 2006?
❖ New methods for unsupervised pre-training have been developed (ex. Restricted
Boltzmann Machines, auto-encoders)
❖ More efficient parameter estimation methods
❖ Better understanding of model regularization
❖ Changes in computing technology favor deep learning
❖ In NLP, speed has traditionally come from exploiting sparsity
❖ But with modern machines, branches and widely spaced memory accesses are costly
❖ Uniform parallel operations on dense vectors are faster These trends are even
stronger with multi-core CPUs and GPUs
❖ Wide availability of ML implementations and computing infrastructure to run them
Now this old slide will make sense
ML Sequence model approach to NER
❖ Training
1. Collect a set of representative training documents
2. Label each token for its entity class or other (O)
3. Design feature extractors appropriate to the text and classes
4. Train a sequence classifier to predict the labels from the data
❖ Testing
1. Receive a set of testing documents
2. Run sequence model inference to label each token
3. Appropriately output the recognized entities
Old skills are still very relevant - Role of Reg Expression
the
Misses capitalized examples
[tT]he Incorrectly returns other or theology
[^a-zA-Z][tT]he[^a-zA-Z]
Find me all instances of the word “the” in a text.
❖ Regular expressions play a surprisingly large role
❖ Sophisticated sequences of regular expressions are often the first model for any
text processing
❖ For many hard tasks, we use machine learning classifiers
❖ But regular expressions are used as features in the classifiers
❖ Can be very useful in capturing generalizations
/^(?:(?:(?(?:00|+)([1-4]dd|[1-9]d?))?)?[-. /]?)?((?:(?d{1,})?[-. /]?){0,})(?:[-. /]?(?:#|ext.?|extension|x)[-. /]?(d+))?$/i
Algo Selection example - Logistic Regression vs SVM
❖ If n is large (relative to m), then use logistic regression,
or SVM without a kernel (the "linear kernel")
❖ If n is small and m is intermediate, then use SVM with a
Gaussian Kernel
❖ If n is small and m is large, then manually create/add
more features, then use logistic regression or SVM
without a kernel.
Machine Learning in NLP
Machine Learning in NLP

More Related Content

What's hot

Case study on machine learning
Case study on machine learningCase study on machine learning
Case study on machine learning
HarshitBarde
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
Yasir Khan
 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)
Kuppusamy P
 

What's hot (20)

Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"
 
Natural Language Processing seminar review
Natural Language Processing seminar review Natural Language Processing seminar review
Natural Language Processing seminar review
 
Natural language processing PPT presentation
Natural language processing PPT presentationNatural language processing PPT presentation
Natural language processing PPT presentation
 
Case study on machine learning
Case study on machine learningCase study on machine learning
Case study on machine learning
 
Natural Language Processing and Machine Learning
Natural Language Processing and Machine LearningNatural Language Processing and Machine Learning
Natural Language Processing and Machine Learning
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
NLP PPT.pptx
NLP PPT.pptxNLP PPT.pptx
NLP PPT.pptx
 
introduction to machine learning and nlp
introduction to machine learning and nlpintroduction to machine learning and nlp
introduction to machine learning and nlp
 
NLP with Deep Learning
NLP with Deep LearningNLP with Deep Learning
NLP with Deep Learning
 
Introduction to Natural Language Processing (NLP)
Introduction to Natural Language Processing (NLP)Introduction to Natural Language Processing (NLP)
Introduction to Natural Language Processing (NLP)
 
NLP
NLPNLP
NLP
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
NLP.pptx
NLP.pptxNLP.pptx
NLP.pptx
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Presentation on Sentiment Analysis
Presentation on Sentiment AnalysisPresentation on Sentiment Analysis
Presentation on Sentiment Analysis
 
NLP 101 + Chatbots
NLP 101 + ChatbotsNLP 101 + Chatbots
NLP 101 + Chatbots
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Machine learning with Big Data power point presentation
Machine learning with Big Data power point presentationMachine learning with Big Data power point presentation
Machine learning with Big Data power point presentation
 
Machine translation
Machine translationMachine translation
Machine translation
 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)
 

Viewers also liked

Machine Learning for NLP
Machine Learning for NLPMachine Learning for NLP
Machine Learning for NLP
butest
 
Machine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.pptMachine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.ppt
butest
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
Mariana Soffer
 
Un día hipotético
Un día hipotéticoUn día hipotético
Un día hipotético
Lucipaly
 
Strengthening the Institutional Capacity of the PVTD within the Vocational T...
Strengthening the Institutional Capacity of the PVTD within the Vocational T...Strengthening the Institutional Capacity of the PVTD within the Vocational T...
Strengthening the Institutional Capacity of the PVTD within the Vocational T...
Timo Rainio
 

Viewers also liked (20)

NLP & Machine Learning - An Introductory Talk
NLP & Machine Learning - An Introductory Talk NLP & Machine Learning - An Introductory Talk
NLP & Machine Learning - An Introductory Talk
 
Machine Learning for NLP
Machine Learning for NLPMachine Learning for NLP
Machine Learning for NLP
 
NLTK
NLTKNLTK
NLTK
 
Nltk
NltkNltk
Nltk
 
Machine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.pptMachine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.ppt
 
Python NLTK
Python NLTKPython NLTK
Python NLTK
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Statistical Learning and Text Classification with NLTK and scikit-learn
Statistical Learning and Text Classification with NLTK and scikit-learnStatistical Learning and Text Classification with NLTK and scikit-learn
Statistical Learning and Text Classification with NLTK and scikit-learn
 
Un día hipotético
Un día hipotéticoUn día hipotético
Un día hipotético
 
Natural language processing (Python)
Natural language processing (Python)Natural language processing (Python)
Natural language processing (Python)
 
NLP e Chatbots
NLP e ChatbotsNLP e Chatbots
NLP e Chatbots
 
Global Messaging Trends 2 - When are chatbots actually useful?
Global Messaging Trends 2 - When are chatbots actually useful?Global Messaging Trends 2 - When are chatbots actually useful?
Global Messaging Trends 2 - When are chatbots actually useful?
 
Weave-D - 2nd Progress Evaluation Presentation
Weave-D - 2nd Progress Evaluation PresentationWeave-D - 2nd Progress Evaluation Presentation
Weave-D - 2nd Progress Evaluation Presentation
 
Text to Speech for Mobile Voice
Text to Speech for Mobile Voice Text to Speech for Mobile Voice
Text to Speech for Mobile Voice
 
Sagt07 Online Rev Vle
Sagt07 Online Rev VleSagt07 Online Rev Vle
Sagt07 Online Rev Vle
 
Nlp
NlpNlp
Nlp
 
Strengthening the Institutional Capacity of the PVTD within the Vocational T...
Strengthening the Institutional Capacity of the PVTD within the Vocational T...Strengthening the Institutional Capacity of the PVTD within the Vocational T...
Strengthening the Institutional Capacity of the PVTD within the Vocational T...
 
Finance bots - The move toward conversational finance
Finance bots - The move toward conversational financeFinance bots - The move toward conversational finance
Finance bots - The move toward conversational finance
 
Text classification in scikit-learn
Text classification in scikit-learnText classification in scikit-learn
Text classification in scikit-learn
 
Text Classification in Python – using Pandas, scikit-learn, IPython Notebook ...
Text Classification in Python – using Pandas, scikit-learn, IPython Notebook ...Text Classification in Python – using Pandas, scikit-learn, IPython Notebook ...
Text Classification in Python – using Pandas, scikit-learn, IPython Notebook ...
 

Similar to Machine Learning in NLP

Deep Learning for NLP (without Magic) - Richard Socher and Christopher Manning
Deep Learning for NLP (without Magic) - Richard Socher and Christopher ManningDeep Learning for NLP (without Magic) - Richard Socher and Christopher Manning
Deep Learning for NLP (without Magic) - Richard Socher and Christopher Manning
BigDataCloud
 
EXPLORING NATURAL LANGUAGE PROCESSING (1).pptx
EXPLORING NATURAL LANGUAGE PROCESSING (1).pptxEXPLORING NATURAL LANGUAGE PROCESSING (1).pptx
EXPLORING NATURAL LANGUAGE PROCESSING (1).pptx
AtulKumarUpadhyay4
 
Frame-Script and Predicate logic.pptx
Frame-Script and Predicate logic.pptxFrame-Script and Predicate logic.pptx
Frame-Script and Predicate logic.pptx
nilesh405711
 
Natural Language Processing for development
Natural Language Processing for developmentNatural Language Processing for development
Natural Language Processing for development
Aravind Reddy
 
Natural Language Processing for development
Natural Language Processing for developmentNatural Language Processing for development
Natural Language Processing for development
Aravind Reddy
 

Similar to Machine Learning in NLP (20)

How do OpenAI GPT Models Work - Misconceptions and Tips for Developers
How do OpenAI GPT Models Work - Misconceptions and Tips for DevelopersHow do OpenAI GPT Models Work - Misconceptions and Tips for Developers
How do OpenAI GPT Models Work - Misconceptions and Tips for Developers
 
Module 8: Natural language processing Pt 1
Module 8:  Natural language processing Pt 1Module 8:  Natural language processing Pt 1
Module 8: Natural language processing Pt 1
 
Deep learning with tensorflow
Deep learning with tensorflowDeep learning with tensorflow
Deep learning with tensorflow
 
Deep learning short introduction
Deep learning short introductionDeep learning short introduction
Deep learning short introduction
 
Deep Learning for NLP (without Magic) - Richard Socher and Christopher Manning
Deep Learning for NLP (without Magic) - Richard Socher and Christopher ManningDeep Learning for NLP (without Magic) - Richard Socher and Christopher Manning
Deep Learning for NLP (without Magic) - Richard Socher and Christopher Manning
 
Deep learning for NLP
Deep learning for NLPDeep learning for NLP
Deep learning for NLP
 
Beyond the Symbols: A 30-minute Overview of NLP
Beyond the Symbols: A 30-minute Overview of NLPBeyond the Symbols: A 30-minute Overview of NLP
Beyond the Symbols: A 30-minute Overview of NLP
 
Learning to Translate with Joey NMT
Learning to Translate with Joey NMTLearning to Translate with Joey NMT
Learning to Translate with Joey NMT
 
Interpretable Machine Learning
Interpretable Machine LearningInterpretable Machine Learning
Interpretable Machine Learning
 
NLP & Machine Learning - An Introductory Talk
NLP & Machine Learning - An Introductory Talk NLP & Machine Learning - An Introductory Talk
NLP & Machine Learning - An Introductory Talk
 
OWF14 - Big Data : The State of Machine Learning in 2014
OWF14 - Big Data : The State of Machine  Learning in 2014OWF14 - Big Data : The State of Machine  Learning in 2014
OWF14 - Big Data : The State of Machine Learning in 2014
 
tensorflow.pptx
tensorflow.pptxtensorflow.pptx
tensorflow.pptx
 
EXPLORING NATURAL LANGUAGE PROCESSING (1).pptx
EXPLORING NATURAL LANGUAGE PROCESSING (1).pptxEXPLORING NATURAL LANGUAGE PROCESSING (1).pptx
EXPLORING NATURAL LANGUAGE PROCESSING (1).pptx
 
H2O World - Benchmarking Open Source ML Platforms - Szilard Pafka
H2O World - Benchmarking Open Source ML Platforms - Szilard PafkaH2O World - Benchmarking Open Source ML Platforms - Szilard Pafka
H2O World - Benchmarking Open Source ML Platforms - Szilard Pafka
 
State of NLP and Amazon Comprehend
State of NLP and Amazon ComprehendState of NLP and Amazon Comprehend
State of NLP and Amazon Comprehend
 
Frame-Script and Predicate logic.pptx
Frame-Script and Predicate logic.pptxFrame-Script and Predicate logic.pptx
Frame-Script and Predicate logic.pptx
 
Recurrent Neural Networks for Text Analysis
Recurrent Neural Networks for Text AnalysisRecurrent Neural Networks for Text Analysis
Recurrent Neural Networks for Text Analysis
 
Artificial inteIegence & Machine learning - Key Concepts
Artificial inteIegence & Machine learning - Key ConceptsArtificial inteIegence & Machine learning - Key Concepts
Artificial inteIegence & Machine learning - Key Concepts
 
Natural Language Processing for development
Natural Language Processing for developmentNatural Language Processing for development
Natural Language Processing for development
 
Natural Language Processing for development
Natural Language Processing for developmentNatural Language Processing for development
Natural Language Processing for development
 

Recently uploaded

怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
vexqp
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
nirzagarg
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
vexqp
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
vexqp
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
cnajjemba
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
vexqp
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 

Recently uploaded (20)

Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...
 
SR-101-01012024-EN.docx Federal Constitution of the Swiss Confederation
SR-101-01012024-EN.docx  Federal Constitution  of the Swiss ConfederationSR-101-01012024-EN.docx  Federal Constitution  of the Swiss Confederation
SR-101-01012024-EN.docx Federal Constitution of the Swiss Confederation
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 

Machine Learning in NLP

  • 1. Meandering through the machine learning maze NLP & Machine Learning Vijay Ganti ** I want to acknowledge full credit for the content of this deck to various sources including Stanford NLP & Deep Learning content, Machine Learning Lectures by Andrew Ng, Natural Language Processing with Python and many more. This was purely an educational presentation with no monetary gains for any parties
  • 2. NLP powered by ML will change the way business gets done ❖ Conversational agents are becoming an important form of human-computer communication (Customer support interactions using chat-bots) ❖ Much of human-human communication is now mediated by computers (Email, Social Media, Messaging) ❖ An enormous amount of knowledge is now available in machine readable form as natural language text (web, proprietary enterprise content)
  • 3. What do I hope to achieve with this talk? My 3 cents Make it accessible & real Get you excited Give you a sense of what it takes
  • 5. Let’s start with a typical ML workflow Training Data Feature Extractor ML Algo Prediction Data Feature Extractor Classifier Model Features Features Label Input + Labels Input Only
  • 6. Let’s walk through the workflow with an example
  • 7. names_data = [(n,'male') for n in names.words('male.txt')]+ [(n,'female') for n in names.words('female.txt')] Training Data Input + Labels Feature Extractor def gender_feature1(name): return {'Last Letter': name[-1]} def gender_feature2(name): return {'last_letter': name[-1],'last_two_letters': name[-2:]} Features feature_set = [(gender_feature1(n), g) for n,g in names_data] feature_set = [(gender_feature2(n), g) for n,g in names_data] train, devtest, test = feature_set[1500:], feature_set[500:1500], feature_set[:500] Partition Data
  • 8. classifier = nltk.NaiveBayesClassifier.train(train) ML Algo Classifier Model Prediction_Accuracy = nltk.classify.accuracy(classifier, devtest) Prediction = classifier.classify(gender_feature2(‘Kathryn’)) Prediction = (classifier.classify(gender_feature2(‘Vijay')) Prediction = (classifier.classify(gender_feature2('Jenna')) Classifier Model Prediction
  • 10. Why is NLP hard? Violinist Linked to JAL Crash Blossoms Teacher Strikes Idle Kids Red Tape Holds Up New Bridges Hospitals Are Sued by 7 Foot Doctors Juvenile Court to Try Shooting Defendant Local High School Dropouts Cut in Half Ambiguity
  • 11. Tricky NEsInformal English Why is NLP hard..er? Segmentation issues the New York-New Haven Railroad the New York-New Haven Railroad Idioms Kodak moment As cool as cucumber Hold your horses Kick the bucket Neologisms Gamify Double-click Bromance Unfriend Great job @justinbieber! Were SOO PROUD of what youve accomplished! U taught us 2 #neversaynever & you yourself should never give up either♥ Where is A Bug’s Life playing … Let It Be was recorded … … a mutation on the for gene …
  • 12. State of the language technology Let’s go to Agra Buy V1AGRA … Spam Detection Adj Noun Adv Noun Verb big dog quickly China trump Part of Speech Tagging (POS) Person Company Place Satya met with LinkedIn in Palo Alto Named Entity Recognition (NER) Sentiment Analysis Vijay told Arnaud that he was wrong Coreference Resolution I need new batteries for my mouse Word sense disambiguation Information Extraction MOSTLY SOLVED GOOD PROGRESS STILL VERY HARD Questions and Answers What kind of cable do I need to project from my Mac ? Paraphrasing Dell acquired EMC last year EMC was taken over by Dell 8 months back. Summarization Brexit vote shocked everyone Financial markets are in turmoil Young people are not happy Brexit has been disruptive Chat/Dialog What movie is playing this evening? Casablanca. Do you want to buy tickets ?
  • 13. Why is this a good time to solve hard problems in NLP? ❖ What has changed since 2006? ❖ New methods for unsupervised pre-training have been developed (Restricted Boltzmann Machines, auto-encoders, contrastive estimation, etc.) ❖ More efficient parameter estimation methods ❖ Better understanding of model regularization ❖ Changes in computing technology favor deep learning ❖ In NLP, speed has traditionally come from exploiting sparsity ❖ But with modern machines, branches and widely spaced memory accesses are costly ❖ Uniform parallel operations on dense vectors are faster These trends are even stronger with multi-core CPUs and GPUs ❖ Wide availability of ML implementations and computing infrastructure to run them Come back to this slide
  • 14. What does it take ?
  • 15. What you need to learn to make machines learn ? ❖ Machine Learning Process & Concepts ❖ Feature engineering ❖ Bias / Variance (overfitting, underfitting) ❖ Performance testing (accuracy, precision, recall, f-score) ❖ regularization ❖ Parameter selection ❖ Algo selection ( Wait for next slide for a quick summary of algos used at Netflix) ❖ Probability ❖ Linear Algebra (vector & matrices) ❖ Some calculus ❖ Python ❖ Octave/Matlab
  • 16. Why is this a good time to solve hard problems in NLP? ❖ What has changed since 2006? ❖ New methods for unsupervised pre-training have been developed (ex. Restricted Boltzmann Machines, auto-encoders) ❖ More efficient parameter estimation methods ❖ Better understanding of model regularization ❖ Changes in computing technology favor deep learning ❖ In NLP, speed has traditionally come from exploiting sparsity ❖ But with modern machines, branches and widely spaced memory accesses are costly ❖ Uniform parallel operations on dense vectors are faster These trends are even stronger with multi-core CPUs and GPUs ❖ Wide availability of ML implementations and computing infrastructure to run them Now this old slide will make sense
  • 17. ML Sequence model approach to NER ❖ Training 1. Collect a set of representative training documents 2. Label each token for its entity class or other (O) 3. Design feature extractors appropriate to the text and classes 4. Train a sequence classifier to predict the labels from the data ❖ Testing 1. Receive a set of testing documents 2. Run sequence model inference to label each token 3. Appropriately output the recognized entities
  • 18. Old skills are still very relevant - Role of Reg Expression the Misses capitalized examples [tT]he Incorrectly returns other or theology [^a-zA-Z][tT]he[^a-zA-Z] Find me all instances of the word “the” in a text. ❖ Regular expressions play a surprisingly large role ❖ Sophisticated sequences of regular expressions are often the first model for any text processing ❖ For many hard tasks, we use machine learning classifiers ❖ But regular expressions are used as features in the classifiers ❖ Can be very useful in capturing generalizations /^(?:(?:(?(?:00|+)([1-4]dd|[1-9]d?))?)?[-. /]?)?((?:(?d{1,})?[-. /]?){0,})(?:[-. /]?(?:#|ext.?|extension|x)[-. /]?(d+))?$/i
  • 19.
  • 20. Algo Selection example - Logistic Regression vs SVM ❖ If n is large (relative to m), then use logistic regression, or SVM without a kernel (the "linear kernel") ❖ If n is small and m is intermediate, then use SVM with a Gaussian Kernel ❖ If n is small and m is large, then manually create/add more features, then use logistic regression or SVM without a kernel.