This project implements sentiment analysis using two different approaches:
- VADER Algorithm: A rule-based sentiment analysis tool particularly suited for social media and short text.
- RoBERTa Model: A pre-trained transformer-based model fine-tuned for sentiment classification.
The repository demonstrates how to use these tools for analyzing the sentiment (positive, negative, or neutral) of text data and comparing their performance.
- Perform sentiment analysis using VADER and RoBERTa.
- Preprocess text data for analysis.
- Visualize sentiment distribution and compare results between the two methods.
- Easily extendable to other datasets and models.
Ensure you have Python 3.8 or higher installed. You also need the following Python packages:
numpypandasmatplotlibseaborntransformerstorchnltk
- Clone the repository:
git clone https://github.com/Fujelhrx/Sentiment-Analysis.git cd Sentiment-Analysis - Install the required packages:
pip install -r requirement.txt
sentiment_analysis.py: Script for sentiment analysis using VADER and RoBERTa Model.requirements.txt: List of required Python packages.README.md: Project documentation.
VADER (Valence Aware Dictionary and sEntiment Reasoner) uses a lexicon and rule-based approach to analyze sentiment. It provides:
- Positive, Negative, Neutral scores.
- A Compound score (overall sentiment).
RoBERTa (A Robustly Optimized BERT Approach) is a transformer model fine-tuned for text classification tasks. It provides:
- Sentiment probabilities for each class (positive, negative, neutral).
Below is an example comparison of VADER and RoBERTa sentiment scores:
| Text | VADER Sentiment | RoBERTa Sentiment |
|---|---|---|
| "I love this movie!" | Positive | Positive |
| "This is terrible." | Negative | Negative |
| "It's okay." | Neutral | Neutral |
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed explanation.
For any questions or feedback, please contact Me.