A Django web application that performs sentiment analysis and emotion detection on text reviews using TextBlob and Text2Emotion libraries.
- Real-time sentiment analysis (Positive, Negative, Neutral)
- Detailed emotion detection (Happy, Sad, Angry, Fear, Surprise)
- User-friendly interface with example reviews
- Responsive design using Tailwind CSS
- Visual feedback with color-coded results
- Python 3.x
- Django 5.1.4
- TextBlob 0.17.1
- Text2Emotion 0.0.5
- Tailwind CSS (via CDN)
- NLTK
- Clone the repository:
git clone https://github.com/HasanAbdelhady/Sentiment-Analysis-And-Emotions-Detection.git
cd sentiment_analysis
- Create and activate a virtual environment:
On Windows:
python -m venv venv
venv\Scripts\activate
On Mac & Linux:
python3 -m venv venv
source venv/bin/activate
- Install required packages:
pip install -r requirements.txt
- Run migrations:
python manage.py migrate
- Start the development server:
python manage.py runserver
The application will be available at http://127.0.0.1:8000/
- Open the application in your web browser
- Enter your text review in the textarea or use one of the example reviews
- Click "Analyze" to get sentiment and emotion analysis results
- View the color-coded sentiment result and emotion breakdown
sentiment_analysis/
├── manage.py
├── requirements.txt
├── reviews/
│ ├── templates/
│ │ └── reviews/
│ │ └── classify_review.html
│ ├── views.py
│ ├── urls.py
│ └── models.py
└── sentiment_analysis/
├── settings.py
└── urls.py
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.