Skip to content

deepanshum0408/Tweet-Emotion-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Tweet-Emotion-Classifier

This project focuses on classifying emotions from tweets using various machine learning models, including fine-tuned BERT, custom BERT, Random Forest, SVM, Logistic Regression, and Naive Bayes. The project includes a Streamlit web application for easy interaction and visualization of the classification results.

Overview

The primary goal of this project is to classify emotions into categories such as sadness, joy, love, anger, and fear. The models have been trained and evaluated to provide accurate predictions based on the input text.

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/yourusername/emotion-classification.git
    cd emotion-classification
  2. Install the required packages:

    pip install -r requirements.txt
  3. Run the Streamlit app:

    streamlit run app.py

Models and Performance

Below is the table of performance metrics for each model evaluated on the validation dataset:

Model Train Accuracy Test Accuracy F1 Score (Test Data) Precision (Test) Data) Recall (Test Data)
Custom BERT Model + Fine-tuned 0.881 0.788 0.606148 0.820222 0.598914
Pretrained BERT Model + Fine-tuned 0.89 0.79 0.93 0.84 0.56
Naive Bayes 0.67 0.60 0.60 0.76 0.67
Random Forest 0.867 0.75 0.84 0.86 0.82
SVM 0.88 0.78 0.84 0.87 0.82
Logistic Regression 0.85 0.76 0.79 0.87 0.74

GUI Snapshot

Screenshot (444)

Screenshot (445)

Project Information

Fine-tuned BERT Model

The fine-tuned BERT model has been trained on the dataset to classify emotions. The model and tokenizer are loaded and used for prediction in the Streamlit app.

Custom BERT Model

The custom BERT model, which has been pre-trained on a different dataset, is also included in the project. This model is used as an alternative for emotion classification.

Random Forest Model

The Random Forest model uses a TF-IDF vectorizer for feature extraction. This model provides a simple yet effective way of classifying emotions.

SVM Model

The Support Vector Machine (SVM) model also uses a TF-IDF vectorizer. It is known for its robustness in handling high-dimensional data.

Logistic Regression Model

The Logistic Regression model, combined with a TF-IDF vectorizer, offers another method for classifying emotions from text.

Naive Bayes Model

The Naive Bayes model, using a TF-IDF vectorizer, provides a probabilistic approach to emotion classification.

Streamlit Application

The Streamlit app allows users to input a tweet and select a model for emotion classification. The app displays the predicted emotion and the confidence score.

Contact

For any inquiries or feedback, please contact:

  • Name: Deepanshu Miglani
  • Education: B.tech CSE(AIML) , UPES, Dehradun
  • Email: deepanshumiglani0408@gmail.com / Deepanshu.106264@stu.upes.ac.in
  • GitHub: deepanshum0408

Mentor

Dr. Sahinur Rahman Laskar
Assistant Professor
School of Computer Science, UPES, Dehradun, India
Email: sahinurlaskar.nits@gmail.com / sahinur.laskar@ddn.upes.ac.in

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors