SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingVeenaSKumar2
 
Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In P...
Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In P...Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In P...
Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In P...Edureka!
 
Natural language processing and transformer models
Natural language processing and transformer modelsNatural language processing and transformer models
Natural language processing and transformer modelsDing Li
 
Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)Yuriy Guts
 
Natural language processing (NLP) introduction
Natural language processing (NLP) introductionNatural language processing (NLP) introduction
Natural language processing (NLP) introductionRobert Lujo
 
Classifying Text using CNN
Classifying Text using CNNClassifying Text using CNN
Classifying Text using CNNSomnath Banerjee
 
Natural language processing
Natural language processingNatural language processing
Natural language processingYogendra Tamang
 
NLP Applications
NLP ApplicationsNLP Applications
NLP ApplicationsRepustate
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Mustafa Jarrar
 
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...Simplilearn
 
NLTK: Natural Language Processing made easy
NLTK: Natural Language Processing made easyNLTK: Natural Language Processing made easy
NLTK: Natural Language Processing made easyoutsider2
 
Lecture1 introduction to machine learning
Lecture1 introduction to machine learningLecture1 introduction to machine learning
Lecture1 introduction to machine learningUmmeSalmaM1
 
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...Simplilearn
 
Recurrent Neural Network : Multi-Class & Multi Label Text Classification
Recurrent Neural Network : Multi-Class & Multi Label Text ClassificationRecurrent Neural Network : Multi-Class & Multi Label Text Classification
Recurrent Neural Network : Multi-Class & Multi Label Text ClassificationAmit Agarwal
 
Deep Learning for Natural Language Processing
Deep Learning for Natural Language ProcessingDeep Learning for Natural Language Processing
Deep Learning for Natural Language ProcessingSangwoo Mo
 
Introduction to natural language processing, history and origin
Introduction to natural language processing, history and originIntroduction to natural language processing, history and origin
Introduction to natural language processing, history and originShubhankar Mohan
 
Machine translation from English to Hindi
Machine translation from English to HindiMachine translation from English to Hindi
Machine translation from English to HindiRajat Jain
 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language Processingrohitnayak
 

Tendances (20)

Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In P...
Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In P...Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In P...
Keras Tutorial For Beginners | Creating Deep Learning Models Using Keras In P...
 
Natural language processing and transformer models
Natural language processing and transformer modelsNatural language processing and transformer models
Natural language processing and transformer models
 
Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)
 
Natural language processing (NLP) introduction
Natural language processing (NLP) introductionNatural language processing (NLP) introduction
Natural language processing (NLP) introduction
 
Nlp
NlpNlp
Nlp
 
Classifying Text using CNN
Classifying Text using CNNClassifying Text using CNN
Classifying Text using CNN
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
NLP Applications
NLP ApplicationsNLP Applications
NLP Applications
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing
 
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
NLTK: Natural Language Processing made easy
NLTK: Natural Language Processing made easyNLTK: Natural Language Processing made easy
NLTK: Natural Language Processing made easy
 
Lecture1 introduction to machine learning
Lecture1 introduction to machine learningLecture1 introduction to machine learning
Lecture1 introduction to machine learning
 
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
 
Recurrent Neural Network : Multi-Class & Multi Label Text Classification
Recurrent Neural Network : Multi-Class & Multi Label Text ClassificationRecurrent Neural Network : Multi-Class & Multi Label Text Classification
Recurrent Neural Network : Multi-Class & Multi Label Text Classification
 
Deep Learning for Natural Language Processing
Deep Learning for Natural Language ProcessingDeep Learning for Natural Language Processing
Deep Learning for Natural Language Processing
 
Introduction to natural language processing, history and origin
Introduction to natural language processing, history and originIntroduction to natural language processing, history and origin
Introduction to natural language processing, history and origin
 
Machine translation from English to Hindi
Machine translation from English to HindiMachine translation from English to Hindi
Machine translation from English to Hindi
 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language Processing
 

En vedette

NLP & Machine Learning - An Introductory Talk
NLP & Machine Learning - An Introductory Talk NLP & Machine Learning - An Introductory Talk
NLP & Machine Learning - An Introductory Talk Vijay Ganti
 
Machine Learning for NLP
Machine Learning for NLPMachine Learning for NLP
Machine Learning for NLPbutest
 
Machine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.pptMachine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.pptbutest
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingMariana Soffer
 
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-learnOlivier Grisel
 
Un día hipotético
Un día hipotéticoUn día hipotético
Un día hipotéticoLucipaly
 
Natural language processing (Python)
Natural language processing (Python)Natural language processing (Python)
Natural language processing (Python)Sumit Raj
 
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?Andrew Schorr
 
Weave-D - 2nd Progress Evaluation Presentation
Weave-D - 2nd Progress Evaluation PresentationWeave-D - 2nd Progress Evaluation Presentation
Weave-D - 2nd Progress Evaluation Presentationlasinducharith
 
Text to Speech for Mobile Voice
Text to Speech for Mobile Voice Text to Speech for Mobile Voice
Text to Speech for Mobile Voice June Hostetter
 
Sagt07 Online Rev Vle
Sagt07 Online Rev VleSagt07 Online Rev Vle
Sagt07 Online Rev VleRCha
 
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
 
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 financeOrganic, Inc
 
Text classification in scikit-learn
Text classification in scikit-learnText classification in scikit-learn
Text classification in scikit-learnJimmy Lai
 
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 ...Jimmy Lai
 
Minds Lab Contact_Center_Solution_Using_ai_v1.0
Minds Lab Contact_Center_Solution_Using_ai_v1.0Minds Lab Contact_Center_Solution_Using_ai_v1.0
Minds Lab Contact_Center_Solution_Using_ai_v1.0Eunjee Lee
 

En vedette (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
 
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 ...
 
Minds Lab Contact_Center_Solution_Using_ai_v1.0
Minds Lab Contact_Center_Solution_Using_ai_v1.0Minds Lab Contact_Center_Solution_Using_ai_v1.0
Minds Lab Contact_Center_Solution_Using_ai_v1.0
 

Similaire à Machine Learning in NLP

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 DevelopersIvo Andreev
 
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 1Sara Hooker
 
Deep learning with tensorflow
Deep learning with tensorflowDeep learning with tensorflow
Deep learning with tensorflowCharmi Chokshi
 
Deep learning short introduction
Deep learning short introductionDeep learning short introduction
Deep learning short introductionAdwait Bhave
 
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 ManningBigDataCloud
 
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 NLPMENGSAYLOEM1
 
Learning to Translate with Joey NMT
Learning to Translate with Joey NMTLearning to Translate with Joey NMT
Learning to Translate with Joey NMTJulia Kreutzer
 
Interpretable Machine Learning
Interpretable Machine LearningInterpretable Machine Learning
Interpretable Machine LearningSri Ambati
 
NLP & Machine Learning - An Introductory Talk
NLP & Machine Learning - An Introductory Talk NLP & Machine Learning - An Introductory Talk
NLP & Machine Learning - An Introductory Talk Vijay Ganti
 
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 2014Paris Open Source Summit
 
EXPLORING NATURAL LANGUAGE PROCESSING (1).pptx
EXPLORING NATURAL LANGUAGE PROCESSING (1).pptxEXPLORING NATURAL LANGUAGE PROCESSING (1).pptx
EXPLORING NATURAL LANGUAGE PROCESSING (1).pptxAtulKumarUpadhyay4
 
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 PafkaSri Ambati
 
State of NLP and Amazon Comprehend
State of NLP and Amazon ComprehendState of NLP and Amazon Comprehend
State of NLP and Amazon ComprehendEgor Pushkin
 
Frame-Script and Predicate logic.pptx
Frame-Script and Predicate logic.pptxFrame-Script and Predicate logic.pptx
Frame-Script and Predicate logic.pptxnilesh405711
 
Recurrent Neural Networks for Text Analysis
Recurrent Neural Networks for Text AnalysisRecurrent Neural Networks for Text Analysis
Recurrent Neural Networks for Text Analysisodsc
 
Artificial inteIegence & Machine learning - Key Concepts
Artificial inteIegence & Machine learning - Key ConceptsArtificial inteIegence & Machine learning - Key Concepts
Artificial inteIegence & Machine learning - Key ConceptsHasibAhmadKhaliqi1
 
Natural Language Processing for development
Natural Language Processing for developmentNatural Language Processing for development
Natural Language Processing for developmentAravind Reddy
 
Natural Language Processing for development
Natural Language Processing for developmentNatural Language Processing for development
Natural Language Processing for developmentAravind Reddy
 

Similaire à 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
 

Dernier

ALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptxALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptxolyaivanovalion
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsJoseMangaJr1
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...amitlee9823
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 

Dernier (20)

Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
ALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptxALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptx
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 

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.