Skip to content

Nikunj113437/Twitter-Sentiment-Analysis

Repository files navigation

Twitter-Sentiment-Analysis

This project analyzes the sentiment of tweets using natural language processing techniques. The goal of this project is to classify tweets as positive, negative, or neutral, based on their content. The model was trained using a dataset of over 11,000 labeled tweets, and has an accuracy of 80%.

Take two different Datasets, one is Training Dataset which consists of Tweets along with Airline Sentiment and other one is Testing Dataset which consists of Tweets but not Airline Sentiment, and by applying NLP(Natural Language Processing) ,i.e NLTK And Sklearn Classifier, we Predict Airline Sentiment of Testing Dataset.

Performed NLP Based Tokenization, Lemmatization, Vectorization and processed Data in Machine Understandable Language.

Used 4 pre-trained Machine Learning Algorithms in order to classify Tweets:

  1. Support Vector Classifier (SVC)
  2. Multinomial Naive Bayes Classifier
  3. Random Forest Classifier
  4. Decision Tree Classifier

Support Vector Classifier (SVC) outperformed other algorithms with an accuracy score of 80% making it the most effective classifier in the study.

ScreenShots:

1.Spliiting the Tweet text into words using NLTK

image

2.Cleaning the Words using WordNetLemmatizer available in NLTK

image

3.Analysing Count Vectorizer and Prepare a Frequency matrix

image

4.Normalize the matrix obtained from Count Vectorizer through TF-IDF Transformer

image

5.Using TF-IDF Vectorizer to get X train Features

image

6.Splitting Training Dataset in order to find Accuracy Score image

7.SVC (Support Vector Classifier)

image

8.Random Forest Classifier

image

9.Multinomial Naive Bayes Classifier

image

10.Decision Tree Classifier

image

Accuracy of each Classifier:

  • Support Vector Classifier --> 79.052 %
  • Multinomial Naive Bayes --> 76.183 %
  • Random Forest Classifier --> 73.72 %
  • Decision Tree Classifier --> 68.306 %

Among all the 4 Classifiers, which are applied SVC predicts Result with higher Accuracy Score

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published