nlp module: learning models - data-x · 2020. 7. 27. · nlp module: learning models. text...

14
NLP Module: Learning Models

Upload: others

Post on 08-May-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

NLP Module: Learning Models

Page 2: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Text Processing

NLP Process

Feature Engineering & Text RepresentationLearn how to extract information from text and represent it numerically

Learning Models

Use learning models to identify parts of speech, entities, sentiment, and other aspects of the text.

Clean up the text to make it easier to use and more consistent to increase prediction accuracy later on

Page 3: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Spam Ham Classification

NLP Examples using Learning Models

Generative Chatbot

Creating a generative based medical chatbot

Classifying emails into spam or ham

Sentiment Analysis

Classifying tweets as negative or positive

Page 4: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Spam Ham Classification

Page 5: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Classify emails as spam (1) or ham (0)

*text processing: stemming, removed stopwords, removing special characters

*feature engineering & text representation: bag of words model

*learning model: multinomial naive bayes

Link to full project: https://www.kaggle.com/balakishan77/spam-or-ham-email-classification

Spam Ham Classification - Emails

Page 6: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Fake news detection

Text messages classification

Flower type

Really anything that can be categorized based on features

Other Applications

Page 7: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Sentiment Analysis

Page 8: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Classify Tweets as having positive, negative, or no sentiment

*text processing: regex (remove hyperlinks, twitter handles, hashtags, retweets)

Sentiment Analysis - Tweets

Page 9: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

*feature engineering & text representation: get subjectivity & polarity scores

*classification: based on subjectivity and polarity

Sentiment Analysis - Tweets

Link to full project: https://www.digitalocean.com/community/tutorials/how-to-perform-sentiment-analysis-in-python-3-using-the-natural-language-toolkit-nltk

Page 10: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Any classification having to do with sentiment/emotions

Exp:

Yelp Reviews

Movie Reviews

Emails

Other Applications

Page 11: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Generative Chatbot

Page 12: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Generative models are not based on predefined responses but are based on seq 2 seq neural networks

Dataset:

Generative Based Chatbot - Medical

Page 13: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Generative Based Chatbot - Medical

*text processing: lemmatizing, lower each word, and remove duplicates

*feature engineering & text representation: bag of words model

*learning model: Sequential model (seq 2 seq) with 3 layers

Link to full project: https://drive.google.com/file/d/1763Y5zy7HmRYsOoBLQgUxQRGY6xCgQiN/view

Page 14: NLP Module: Learning Models - Data-X · 2020. 7. 27. · NLP Module: Learning Models. Text Processing NLP Process Feature Engineering & Text Representation Learn how to extract information

Other Chatbots

Email word recommendation

Anything that has text output based off on text input

Other Applications