A modern full-stack Sentiment Analysis application built using React, Flask, and Hugging Face Transformers. The application allows users to analyze individual sentences or batches of text, visualize sentiment distribution through interactive charts, and generate AI-enhanced summary reports.
This project combines a responsive React frontend with a Flask backend powered by a Transformer-based sentiment analysis model. Users can classify text in real time, analyze large collections of feedback, and explore insights through interactive visualizations.
- Analyze individual sentences instantly.
- Predicts:
- Positive
- Negative
- Displays confidence score.
Upload or paste multiple sentences to:
- Analyze each sentence individually.
- Group results into categories.
- Count positive and negative sentiments.
- View category-wise statistics.
Generate a comprehensive report including:
- Overall sentiment summary
- Positive vs Negative percentages
- Category-wise insights
- Automatically generated narrative
Includes:
- Responsive interface
- Category filters
- Interactive Bar Charts
- Interactive Pie Charts
- Sentence-wise result table
- Loading animations
- Theme selection
- Axis/Grid visibility toggle
- Flask WSGI support
- CORS enabled
- Easily deployable on:
- Render
- Railway
- Heroku
- Docker
- VPS
| Layer | Technology |
|---|---|
| Frontend | React 19 |
| Build Tool | Vite 6 |
| Styling | Tailwind CSS |
| Animation | Framer Motion |
| Charts | Chart.js |
| Backend | Flask |
| ML Framework | Hugging Face Transformers |
| Deep Learning | PyTorch |
| API | REST |
| Deployment | Gunicorn (WSGI) |
Sentiment-Analysis/
│
├── README.md
├── package.json
├── vite.config.js
├── tailwind.config.js
├── eslint.config.js
├── index.html
├── wsgi.py
│
├── public/
│ └── vite.svg
│
├── src/
│ ├── main.jsx
│ ├── App.jsx
│ ├── App.css
│ ├── index.css
│ │
│ ├── Components/
│ │ ├── InputForm.jsx
│ │ ├── BarChart.jsx
│ │ ├── PieChart.jsx
│ │ ├── Report.jsx
│ │ ├── FilterDropdown.jsx
│ │ └── SentenceItem.jsx
│ │
│ ├── backend/
│ │ ├── app.py
│ │ ├── model.py
│ │ └── requirements.txt
│ │
│ └── assets/
│ └── react.svg
│
└── .gitignore
POST /classify
{
"text": "The product is amazing!"
}{
"label": "Positive",
"confidence": 0.998
}POST /analyze
{
"sentences": [
"Great service",
"Very disappointing",
"Loved it"
]
}{
"results":[...],
"summary":{
"Positive":2,
"Negative":1
}
}POST /generate-full-report
Returns an AI-generated narrative report summarizing:
- Overall sentiment
- Positive percentage
- Negative percentage
- Category-wise observations
- Final conclusion
git clone https://github.com/AdityaPanda0506/Sentimental-Analysis.git
cd Sentimental-AnalysisInstall dependencies
npm installStart development server
npm run devFrontend runs at
http://localhost:5173
Create virtual environment (optional)
python -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activateInstall Python dependencies
pip install -r src/backend/requirements.txtRun Flask server
python src/backend/app.pyBackend runs at
http://localhost:5000
Build React
npm run buildRun using Gunicorn
gunicorn wsgi:appUser
│
▼
React Frontend
│
▼
Flask REST API
│
▼
Transformer Model
(Hugging Face)
│
▼
Prediction
│
▼
JSON Response
│
▼
Charts + Reports
The user enters a sentence or multiple feedback entries.
↓
The React frontend sends a request to the Flask API.
↓
The backend loads a pretrained Hugging Face Transformer model.
↓
The model predicts:
- Sentiment
- Confidence Score
↓
Results are returned as JSON.
↓
React renders:
- Bar Chart
- Pie Chart
- Sentence Table
- AI Summary Report
- Flask-CORS enabled for local development.
- Configure allowed origins before production deployment.
- Store API keys using environment variables.
- Never commit secrets to the repository.
- User authentication
- PDF report export
- CSV upload support
- Dark mode
- Model selection
- Multi-language sentiment analysis
- Emotion detection
- Aspect-based sentiment analysis
- Historical analytics dashboard
This application can be deployed using:
- Docker
- Render
- Railway
- Heroku
- AWS EC2
- DigitalOcean
- Azure App Service
- Fork the repository.
- Create a new branch.
git checkout -b feature/new-feature- Commit your changes.
git commit -m "Add new feature"- Push your branch.
git push origin feature/new-feature- Open a Pull Request.
This project is released for educational and research purposes.
Feel free to modify, extend, and use it with proper attribution.
Aditya Panda
Built with
- React
- Flask
- Hugging Face Transformers
- PyTorch
- Chart.js
- Tailwind CSS