Skip to content

This project classifies tweets as positive πŸ˜ƒ or negative 😞 using the Sentiment140 dataset, displaying results with bar graphs and pie charts. πŸ“Š

Notifications You must be signed in to change notification settings

Devanshi-Bavaria/TWITTER-SENTIMENTAL-ANAYLSIS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TWITTER-SENTIMENTAL-ANAYLSIS

This project focuses on classifying tweets into positive or negative sentiments. We use the Sentiment140 dataset for training and testing our model, displaying the results using bar graphs and pie charts.

Table of Contents

Overview

The goal of this project is to classify tweets into positive or negative sentiments using the Sentiment140 dataset. It contains 1,600,000 tweets extracted using the twitter api. We perform data visualization to understand the distribution of sentiments and apply machine learning techniques to build a classification model.

Dataset

The Sentiment140 dataset includes the following fields:

  • target: Polarity of the tweet (0 = negative 😞, 1 = positive πŸ˜ƒ)
  • ids: Unique id of the tweet
  • date: Date of the tweet
  • flag: Query (if no query, it's NO_QUERY)
  • user: Name of the user who tweeted
  • text: Text of the tweet

Dependencies

To run this project, you'll need the following Python packages:

import pandas as pd
import matplotlib.pyplot as plt
import nltk
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import BernoulliNB
import tweepy
import warnings

Exploratory Data Analysis

We start by loading and exploring the dataset to understand the distribution of sentiments and other features.

Data Preprocessing

We clean and preprocess the data to prepare it for model training.

Model Training and Evaluation

We train a Bernaulli Naive Bayes model and evaluate its performance.

Results

We visualize the results using bar graphs and pie charts.

Conclusion

Our model achieves good accuracy in classifying tweets into positive and negative sentiments. Further improvements can be made by exploring other machine learning algorithms and fine-tuning the preprocessing steps.

Usage

To run the project:

  1. Clone the repository:
    git clone <[repository-url](https://github.com/Devubavariaa/TWITTER-SENTIMENTAL-ANAYLSIS)>
  2. Navigate to the project directory:
    cd twitter-sentiment-analysis
  3. Install dependencies:
    pip install -r requirements.txt
  4. Run the analysis:
    python analysis.py

About

This project classifies tweets as positive πŸ˜ƒ or negative 😞 using the Sentiment140 dataset, displaying results with bar graphs and pie charts. πŸ“Š

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published