Skip to content

rajanikhatri/Amazon_Review_Sentiment_Analysis

Repository files navigation

Sentiment Analysis Web Application

A modern, professional Flask web application for comprehensive text analysis including sentiment analysis, fake review detection, and batch processing capabilities.

πŸš€ Features

Core Analysis Tools

  • Sentiment Analysis: Compare VADER and RoBERTa models side-by-side
  • Fake Review Detection: Advanced algorithm to identify potentially fake reviews
  • Batch Processing: Analyze multiple texts at once with comprehensive statistics

Advanced Capabilities

  • File Upload Support: Process CSV, TXT, XLS, and XLSX files
  • Smart Text Extraction: Automatically detects and extracts text from structured files
  • Real-time Analysis: Instant feedback with professional visualizations
  • Responsive Design: Works seamlessly on desktop, tablet, and mobile devices

User Experience

  • Modern Interface: Clean, professional design without distractions
  • Tabbed Navigation: Organized workflow with separate analysis modes
  • Character Counters: Real-time feedback for text inputs
  • Loading States: Professional progress indicators
  • Error Handling: User-friendly error messages

πŸ› οΈ Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Quick Setup

  1. Clone the repository:
git clone <repository-url>
cd AI-PROJECT
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python3 app.py
  1. Access the application:
http://localhost:5001

πŸ“‹ Requirements

Basic Requirements

flask>=3.0.0
flask-cors>=4.0.0
vaderSentiment>=3.3.2
pandas>=2.0.0
numpy>=1.21.0

Optional for Advanced Features

transformers>=4.0.0
torch>=2.0.0
openpyxl>=3.1.0

🎯 Usage Guide

Sentiment Analysis

  1. Select "Sentiment Analysis" tab
  2. Enter your text in the input field
  3. Choose analysis model (VADER, RoBERTa, or both)
  4. Click "Analyze Sentiment"
  5. View side-by-side results with detailed metrics

Fake Review Detection

  1. Select "Fake Detection" tab
  2. Enter review text
  3. Provide rating (1-5 stars)
  4. Click "Detect Fake Review"
  5. Review authenticity assessment with reasoning

Batch Analysis

Method 1: Text Input

  1. Select "Batch Analysis" tab
  2. Choose "Text Input" method
  3. Enter multiple texts (one per line)
  4. Click "Analyze Batch"
  5. Review comprehensive statistics

Method 2: File Upload

  1. Select "Batch Analysis" tab
  2. Choose "File Upload" method
  3. Upload CSV, TXT, or Excel file
  4. System automatically extracts and analyzes text
  5. Review results with extracted text preview

πŸ“Š Supported File Formats

CSV Files

  • Auto-detects delimiters
  • Intelligent column detection (text, review, comment, content)
  • Handles various CSV formats

Excel Files

  • Supports both .xls and .xlsx formats
  • Automatic text column identification
  • Multi-sheet support

Text Files

  • Line-by-line processing
  • Automatic filtering of empty lines
  • Clean text extraction

πŸ”§ Configuration

Environment Variables

  • FLASK_ENV: Set to 'development' or 'production'
  • FLASK_PORT: Server port (default: 5001)
  • MAX_FILE_SIZE: Maximum upload file size (default: 16MB)

Customization

  • Modify analysis algorithms in app.py
  • Update UI styles in static/style.css
  • Customize templates in templates/

πŸ“ˆ API Endpoints

Analysis Endpoints

  • POST /api/analyze: Single text sentiment analysis
  • POST /api/fake-detection: Fake review detection
  • POST /api/batch-analysis: Batch text analysis
  • POST /api/upload-file: File upload and analysis
  • GET /api/sample-reviews: Get sample review data
  • GET /api/health: System health check

Response Format

All endpoints return JSON responses with:

  • Analysis results
  • Confidence scores
  • Error messages (when applicable)
  • Processing metadata

πŸš€ Deployment

Production Deployment

  1. Set environment variables:
export FLASK_ENV=production
export FLASK_PORT=5001
  1. Use WSGI server (recommended):
pip install gunicorn
gunicorn --bind 0.0.0.0:5001 app:app

Docker Deployment

docker build -t sentiment-analysis .
docker run -p 5001:5001 sentiment-analysis

🎨 Technical Stack

  • Backend: Flask (Python web framework)
  • Frontend: HTML5, CSS3, JavaScript (ES6+)
  • Machine Learning: VADER, RoBERTa (Transformers)
  • Data Processing: Pandas, NumPy
  • File Handling: CSV, Excel, Text parsers

πŸ“± Browser Compatibility

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

🀝 Contributing

  1. Fork the repository
  2. Create feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions:

  • Check existing GitHub issues
  • Review documentation
  • Contact development team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors