A modern, professional Flask web application for comprehensive text analysis including sentiment analysis, fake review detection, and batch processing capabilities.
- 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
- 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
- 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
- Python 3.8 or higher
- pip package manager
- Clone the repository:
git clone <repository-url>
cd AI-PROJECT- Install dependencies:
pip install -r requirements.txt- Run the application:
python3 app.py- Access the application:
http://localhost:5001
flask>=3.0.0
flask-cors>=4.0.0
vaderSentiment>=3.3.2
pandas>=2.0.0
numpy>=1.21.0
transformers>=4.0.0
torch>=2.0.0
openpyxl>=3.1.0
- Select "Sentiment Analysis" tab
- Enter your text in the input field
- Choose analysis model (VADER, RoBERTa, or both)
- Click "Analyze Sentiment"
- View side-by-side results with detailed metrics
- Select "Fake Detection" tab
- Enter review text
- Provide rating (1-5 stars)
- Click "Detect Fake Review"
- Review authenticity assessment with reasoning
- Select "Batch Analysis" tab
- Choose "Text Input" method
- Enter multiple texts (one per line)
- Click "Analyze Batch"
- Review comprehensive statistics
- Select "Batch Analysis" tab
- Choose "File Upload" method
- Upload CSV, TXT, or Excel file
- System automatically extracts and analyzes text
- Review results with extracted text preview
- Auto-detects delimiters
- Intelligent column detection (text, review, comment, content)
- Handles various CSV formats
- Supports both .xls and .xlsx formats
- Automatic text column identification
- Multi-sheet support
- Line-by-line processing
- Automatic filtering of empty lines
- Clean text extraction
FLASK_ENV: Set to 'development' or 'production'FLASK_PORT: Server port (default: 5001)MAX_FILE_SIZE: Maximum upload file size (default: 16MB)
- Modify analysis algorithms in
app.py - Update UI styles in
static/style.css - Customize templates in
templates/
POST /api/analyze: Single text sentiment analysisPOST /api/fake-detection: Fake review detectionPOST /api/batch-analysis: Batch text analysisPOST /api/upload-file: File upload and analysisGET /api/sample-reviews: Get sample review dataGET /api/health: System health check
All endpoints return JSON responses with:
- Analysis results
- Confidence scores
- Error messages (when applicable)
- Processing metadata
- Set environment variables:
export FLASK_ENV=production
export FLASK_PORT=5001- Use WSGI server (recommended):
pip install gunicorn
gunicorn --bind 0.0.0.0:5001 app:appdocker build -t sentiment-analysis .
docker run -p 5001:5001 sentiment-analysis- 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
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
- Fork the repository
- Create feature branch
- Make your changes
- Add tests if applicable
- Submit pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Check existing GitHub issues
- Review documentation
- Contact development team