A modern, full-stack machine learning application designed to extract actionable insights from product reviews. The application automatically filters out deceptive spam reviews using a Random Forest classifier, performs VADER sentiment analysis, and visualizes insights across dual dashboards.
- 🧠 Machine Learning Spam Filter: Leverages a trained Random Forest Classifier with TF-IDF vectorization to identify and exclude fake/deceptive reviews (achieving 85.94% accuracy).
- 📈 Dual Dashboards:
- Streamlit Application: A serverless, database-driven dashboard connected to a local SQLite database, featuring interactive charts, word clouds, and key-phrase extractors.
- Static Web UI: A clean HTML5/CSS3/JavaScript frontend using Chart.js to visualize statistics directly from user-uploaded CSV/Excel datasets.
- ⚡ VADER Sentiment Engine: Analyzes review texts and classifies them as Positive, Neutral, or Negative on the fly.
- 💾 Serverless SQLite Storage: Fully migrated database backend requiring zero configuration or running server instances.
- 🔄 Automatic Data Fallback: Smart data ingestion that automatically sets up a default dataset if no custom CSV is provided.
app.py- Main Streamlit dashboard code.database_storage.py- Ingestion script that cleans data, predicts spam, and populates the SQLite database.load_data.py- Core helper to load CSV files with automatic fallback.train_spam_detector.py- Scikit-Learn script to train and save the Random Forest classifier.export_to_json.py- Exporter that pushes SQLite records into a JSON file for the static web dashboard.backend/- Flask API server providing endpoints for dataset upload, WordClouds, and sentiment summaries.website/- Clean frontend interface built with HTML, CSS, JavaScript, and Chart.js.
First, clone the repository, navigate into the directory, and set up a Python virtual environment:
# Create a virtual environment
python -m venv .venv
# Activate the virtual environment
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
# Install required packages
pip install -r requirements.txtTrain the Scikit-learn model and save the classifier files:
python train_spam_detector.pyInitialize the database table and ingest reviews (falls back to spam_data/deceptive-opinion.csv automatically if no custom dataset is in data/):
python database_storage.pyStart the Streamlit application:
streamlit run app.py👉 Open http://localhost:8501 in your browser.
Start the API server:
# Start Flask API
python backend/api_server.py👉 Double-click or open website/index.html in any web browser, and upload a CSV/Excel file of reviews to analyze them instantly!