Skip to content

rahulvaish/NaturalLanguageProcessing-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 

Repository files navigation

This repository contains self-contained NLP examples.

Table of Contents


  • This example is an implementation of Word to Vector concept using Spacy Library. [Source Code]
    • Install Spacy on Anaconda[Administrator Mode]: image image image
    • Computes similarity among all tokens' combinations

  • This example is an implementation of Word to Vector concept using Gensim Library. [Source Code]
    • Install Gensim on Anaconda: image
    • Compute similarity between all tokens

  • 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]
    • Load the data [Consumer_Complaints.csv]
    • Select desired Columns
    • Removal of unwanted rows
    • Clean and Prepare Data
    • Split Dataframe as (Train+Test)
      image
    • Apply CountVectorizer
    • Apply TF-IDF (Transformer)
    • Apply ML Modeling with MultinomialNB
    • Make Predictions

  • 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: image
    • 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. image

  • This example in JAVA demonstrates Sentiment Analysis using Microsoft Azure Cognitive Services. [Source Code]
    • Login into Azure Account.
    • Navigate till All Resources -> Text Analytics -> Create a Resource.
      image
      image
      image
      image
      Now use the Endpoint and keys in your application for request and response :)
      image
      For positive 0.99 is the score
      image
      For negative 0.003 is the score.

  • This example encapsulates ChatBot implementation using ChatterBot Library. [Source Code]
    • Install chatterbot library on Anaconda.
    • Prepare Chatbot.
    • Start Training the Chatbot.
    • To Test the Chatbot's Learning and Responding capabilities, issue get_response method with your question. image