A modern, full-stack web application for analyzing sentiment in customer reviews and feedback
- π¨ Complete UI/UX Redesign - Modern, premium interface with glassmorphism effects
- π Enhanced Analytics - Beautiful visualizations with progress bars and stat cards
- π Improved Performance - Optimized file handling and processing
- π± Fully Responsive - Perfect experience on desktop, tablet, and mobile
- π Better UX - File selection display, error handling, and smooth animations
- π Enhanced Security - 10MB file size limits and improved validation
- β CSV File Upload - Drag & drop or click to upload review datasets
- π Sentiment Analysis - Powered by TextBlob and NLTK for accurate results
- π Visual Analytics - Interactive charts and word clouds
- π¬ Example Reviews - See most positive and negative reviews
- π― Real-time Processing - Fast analysis with progress indicators
- Overall sentiment score and classification
- Sentiment distribution (Positive/Negative/Neutral)
- Word clouds for positive and negative reviews
- Subjectivity vs polarity analysis
- Detailed sentiment breakdown with percentages
- Clean, intuitive interface with gradient themes
- Smooth animations and micro-interactions
- Glassmorphism design elements
- Responsive grid layouts
- Dark accents with vibrant colors
Sentiment-Analysis/
βββ π server/ # Node.js/Express backend
β βββ controllers/ # Request handlers
β βββ middleware/ # Upload & validation middleware
β βββ routes.js # API routes
β βββ server.js # Main server file
β
βββ π¨ public/ # Frontend files
β βββ index.html # Main application page
β βββ data.html # Sample datasets page
β βββ docs.html # Documentation page
β βββ style.css # Modern CSS with design system
β βββ script.js # Client-side JavaScript
β βββ images/ # Generated analysis visualizations
β
βββ π seti.py # Python ML analysis script
βββ π data/ # Sample CSV datasets
β βββ Reviews.csv # Restaurant reviews (1000+)
β βββ hotel_reviews.csv # Hotel reviews
β βββ movie_reviews.csv # Movie reviews
β βββ tech_reviews.csv # Tech product reviews
β
βββ π§ͺ tests/ # Test files
β βββ server.test.js # Node.js tests
β βββ test_seti.py # Python tests
β
βββ π requirements.txt # Python dependencies
βββ π¦ package.json # Node.js dependencies
βββ βοΈ nodemon.json # Development server config
βββ π README.md # This file
- Node.js >= 18.0.0
- Python >= 3.8
-
Clone the repository
git clone https://github.com/Hritikraj8804/Sentiment-Analysis.git cd Sentiment-Analysis -
Install Node.js dependencies
npm install
-
Install Python dependencies
pip install -r requirements.txt
-
Download NLTK data (first time only)
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')"
Development mode:
npm run devProduction mode:
npm startThe application will be available at http://localhost:3000
- Click "Choose CSV File" button
- Select a CSV file with reviews (max 10MB)
- See the selected filename and size displayed
- Click "Analyze" to start processing
Your CSV file should have at least one column with text data:
Review,Liked
"Great product, highly recommend!",1
"Poor quality, disappointed.",0
"It's okay, nothing special.",2Supported sentiment values:
1- Positive0- Negative2- Neutral (optional)
The analysis provides:
- Overall Sentiment - Classified as Positive, Negative, or Neutral
- Statistics - Total reviews, sentiment breakdown with percentages
- Visualizations - Distribution charts, pie charts, word clouds
- Example Reviews - Most positive and most negative examples
- Node.js - Runtime environment
- Express.js - Web framework
- Multer - File upload handling
- CORS - Cross-origin resource sharing
- HTML5 - Semantic structure
- CSS3 - Modern styling with custom properties
- Vanilla JavaScript - ES6+ features
- Font Awesome - Icons
- Google Fonts - Inter & Poppins typography
- Python 3 - Analysis engine
- TextBlob - Sentiment analysis
- NLTK - Natural language processing
- pandas - Data manipulation
- matplotlib - Visualization generation
- WordCloud - Word cloud creation
- nodemon - Auto-restart development server
- Jest - JavaScript testing
- pytest - Python testing
- ESLint - Code linting
Upload and analyze a CSV file
Request:
- Content-Type:
multipart/form-data - Body:
csv_file(file)
Response:
{
"success": true,
"message": "Analysis completed successfully"
}Download sample dataset files
- Primary: Purple/Blue gradient (
#6366f1to#a855f7) - Success: Green (
#22c55e) - Error: Red (
#ef4444) - Warning: Amber (
#f59e0b)
- Body: Inter (400, 500, 600, 700)
- Headings: Poppins (600, 700, 800)
- Glassmorphism cards with backdrop blur
- Smooth animations (200-300ms cubic-bezier)
- Rounded corners (0.5rem to 1.5rem)
- Elevated shadows with multiple layers
npm testpytestnpm run lintContributions are welcome! Here's how:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m "feat: add amazing feature" - Push to your branch
git push origin feature/amazing-feature
- Open a Pull Request
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changesrefactor:- Code refactoringtest:- Test updateschore:- Maintenance tasks
- Ensure file is
.csvformat - Check file size is under 10MB
- Verify CSV has proper column headers
- Use UTF-8 encoding for special characters
- Ensure at least one text column exists
- Check for malformed CSV data
- Kill existing Node processes:
killall node(Mac/Linux) orStop-Process -Name node -Force(Windows) - Clear uploads folder if needed
- Restart with
npm run dev
This project is licensed under the MIT License - see the LICENSE file for details.
Hritikraj
- GitHub: @Hritikraj8804
- Project: Sentiment-Analysis
- TextBlob for sentiment analysis capabilities
- The open-source community for amazing tools and libraries
- All contributors who have helped improve this project
Beautiful visualizations with:
- Sentiment distribution charts
- Category breakdown pie charts
- Positive & negative word clouds
- Subjectivity analysis
- Example reviews with badges
β Star this repo if you found it helpful!
Made with β€οΈ by Hritikraj | Report Bug | Request Feature
