This project implements a sentiment analysis system using various machine learning models. It processes textual data, extracts features, trains multiple classification models, and evaluates their performance in predicting sentiment.
- Data processing and feature extraction from raw text
- Implementation of multiple machine learning models:
- Logistic Regression
- Random Forest
- Support Vector Machine (SVM)
- Naive Bayes
- Model evaluation with various performance metrics
- Visualization of results including confusion matrices
- Clone this repository:
git clone https://github.com/reetmitra/Twitter-Sentiment-Analysis.git cd Twitter-Sentiment-Analysis - Create a venv (Optional):
python -m venv venv source venv/bin/activate - Install the required packages:
pip install -r requirements.txt
- Data Processing:
- Place your raw data in the
data/raw/directory - Run the data processing script:
python src/data_processing.py
- Feature Extraction:
- After data processing, run the feature extraction:
python src/feature_extraction.py
- Model Training:
- Train the models using:
python src/model_training.py
- Evaluation:
- Evaluate the trained models:
python src/evaluation.py
The performance of each model is evaluated using the following metrics:
- Accuracy
- Precision
- Recall
- F1-score
Confusion matrices for each model are saved in the figures/ directory.
- Logistic Regression: A linear model for binary classification.
- Random Forest: An ensemble learning method using multiple decision trees.
- Support Vector Machine (SVM): A powerful algorithm for both linear and non-linear classification.
- Naive Bayes: A probabilistic classifier based on applying Bayes' theorem.
- Implement deep learning models (e.g., LSTM, BERT)
- Experiment with different feature extraction techniques
- Develop a web interface for real-time sentiment analysis
- Explore multi-class sentiment classification
Contributions to this project are welcome! Please fork the repository and submit a pull request with your proposed changes.
Project Link: https://github.com/reetmitra/Twitter-Sentiment-Analysis