This repository contains self-contained NLP examples.
-
This example is an implementation of Word to Vector concept using Spacy Library. [Source Code]
-
This example is an implementation of Word to Vector concept using Gensim Library. [Source Code]
-
This example illustrates various processes involved during Text Cleaning. [Source Code]
- Install Spacy on Anaconda Refer Above
- Convert sentence into Lemma
- Removal of Pronoun
- Removal of Stop Words
- Removal of Punctuations
- Selecting Nouns
- Word count and Frequency
- Converting into Text -> List of Sentences -> List of Clean Sentences
- BagOfWords/CountVectorizer/Sparse on Sentences
- BagOfWords/CountVectorizer/Sparse on File
- TF-IDF (Vectorizer) on Sentences
- TF-IDF (Vectorizer) on File
-
This example exemplify Text Classification using TF-IDF. [Source Code]
-
This example is an analysis on SMS Spam Predction. [Source Code]
- Load the data [spam.csv]
- Removal of unwanted columns
- Break the complete dataset into data(for training and validation) + untouched data
- Replacing Categorical Feature into Numerical Feature
- Split Dataframe as (Train+Test) Refer above for (Train+Test) pictorial representation
- Apply CountVectorizer/Sparse on train_X
- Apply CountVectorizer/Sparse on test_X
- Apply ML Modeling with MultinomialNB
- Make Predictions
-
This example demonstrates Sentiment Analysis by Text Classification using Spacy Library. [Source Code]
- Install Spacy on Anaconda Refer Above
- Load the data-Yelp+IMDB+Amazon[sentimentdataset.csv]
- Clean Sentences
- Tokenize
- Vectorize
- Classify
- Predict the Sentiments.
-
This example demonstrates Sentiment Analysis using VADER Library. [Source Code]
VADER(Valence Aware Dictionary and sEntiment Reasoner) is a Lexicon and rule-based sentiment analysis library. It includes sentiment from emoticons (e.g, :-)), sentiment-related acronyms (e.g, LOL) and slang (e.g, meh).
- Install VADER on Anaconda
- VADER Sentiment Scale:
- Effect of Punctuations on Sentiments.
- Effect of Spaces on Sentiments.
- Effect of TypeCases on Sentiments.
- Effect of TypeCases + Punctuations on Sentiments.
- Effect of Degree Modifiers (Adjectives) on Sentiments.
- Effect of Conjunctions on Sentiments.
- Effect of Emojis and Emoticons on Sentiments.
- Effect of Slangs on Sentiments.
-
This example demonstrates Sentiment Analysis using TextBlob Library. [Source Code]
- Install TextBlob on Anaconda
- For each sentence, Textblobs returns Polarity and Subjectivity.
- Polarity is a float value within the range [-1.0 to 1.0] where 0 indicates neutral, +1 indicates a very positive sentiment and -1 represents a very negative sentiment.
- Subjectivity is a float value within the range [0.0 to 1.0] where 0.0 is very objective and 1.0 is very subjective. Subjective sentence expresses some personal feelings, views, beliefs, opinions, allegations, desires, beliefs, suspicions, and speculations where as Objective sentences are factual.
-
This example in JAVA demonstrates Sentiment Analysis using Microsoft Azure Cognitive Services. [Source Code]
-
This example encapsulates ChatBot implementation using ChatterBot Library. [Source Code]