Skip to content

amansethhh/ReviewSense-Analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

143 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ReviewSense Analytics

Production-ready multilingual sentiment intelligence platform

Hybrid Transformer Routing โ€ข Confidence-Aware Decisions โ€ข Explainable AI


โญ If you like this project, consider giving it a star!


๐ŸŽฌ Live Demo

ReviewSense Demo

Real-time multilingual sentiment analysis โ€ข Bulk CSV processing โ€ข Explainability โ€ข Interactive dashboard


๐ŸŒ Why This Matters

  • Businesses receive multilingual, mixed-language feedback daily
  • Traditional models fail on code-switched (Hinglish) inputs
  • Translation errors silently degrade prediction quality
  • Incorrect sentiment โ†’ wrong business decisions

ReviewSense solves this with reliable, explainable, multilingual intelligence


โšก Key Highlights

  • Hybrid transformer routing (RoBERTa + XLM-R + NLLB)
  • Hinglish normalization for real-world inputs
  • Translation trust validation (fail-safe fallback)
  • Margin-based decision layer (ambiguity control)
  • Entropy-based confidence calibration
  • Explainability via LIME + ABSA
  • Real-time + bulk processing pipeline

๐Ÿงฉ Use Cases

  • E-commerce product review analysis
  • Social media sentiment monitoring
  • Multilingual customer feedback systems
  • Market research & brand intelligence

๐ŸŽฏ Problem

  • Multilingual input breaks traditional models
  • Translation introduces hidden errors
  • Confidence scores are misleading
  • Ambiguous predictions are mishandled
  • Lack of explainability

๐Ÿ’ก Solution Overview

Layer Purpose
Language Routing Detect English / Hinglish / Multilingual
Hinglish Normalization Clean code-mixed input
Translation (NLLB) Convert multilingual โ†’ English
Validation Layer Verify translation quality
Model Layer RoBERTa / XLM-R inference
Decision Layer Margin-based ambiguity handling
Confidence Layer Entropy calibration
Explainability LIME + ABSA

๐Ÿง  Core Innovations

  • Model-first architecture (no heuristics)
  • Margin-based ambiguity detection
  • Entropy-based confidence (not softmax)
  • Translation trust gating system

๐Ÿงฉ Architecture Diagram


๐Ÿ“Š Performance

MetricValue
Accuracy~91%
Precision~0.92
Recall~0.91
F1 Score~0.90

Evaluated on mixed multilingual dataset (real-world inputs)


๐Ÿ–ผ๏ธ UI Preview


Home

Live Prediction

Model Dashboard

Multilingual Analysis

๐Ÿ—๏ธ Tech Stack

Layer Technology
Backend FastAPI, Uvicorn
Frontend React, TypeScript
Models RoBERTa, XLM-R
Translation Meta NLLB
Explainability LIME, ABSA
ML Stack PyTorch, Transformers
Data Pandas, NumPy

๐Ÿ“‚ Project Structure (Engineering-Level)

ReviewSense-Analytics/
โ”‚
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”œโ”€โ”€ schemas/
โ”‚   โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ””โ”€โ”€ utils/
โ”‚   โ””โ”€โ”€ tests/
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/
โ”‚   โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ””โ”€โ”€ styles/
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”œโ”€โ”€ pipeline/
โ”‚   โ”œโ”€โ”€ preprocessing/
โ”‚   โ”œโ”€โ”€ translation/
โ”‚   โ”œโ”€โ”€ decision/
โ”‚   โ””โ”€โ”€ predict.py
โ”‚
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ images/
โ”‚
โ”œโ”€โ”€ scripts/
โ”œโ”€โ”€ reports/
โ”œโ”€โ”€ data/
โ””โ”€โ”€ start.ps1

๐Ÿ”Œ API Overview

Method Endpoint Description
GET /health Health check
POST /predict Real-time sentiment
POST /bulk Bulk CSV processing
GET /metrics Model metrics
POST /feedback Feedback logging

๐Ÿ›  Setup Instructions

๐Ÿ”ง Prerequisites

Ensure your system has:

  • Python 3.10+
  • Node.js 18+ (with npm)
  • Git

๐Ÿ“ฅ Clone & Install

git clone https://github.com/amansethhh/ReviewSense-Analytics.git
cd ReviewSense-Analytics

1. Python Virtual Environment (at the project root)

# Create virtual environment
python -m venv venv

# Activate it
# Windows (PowerShell)
.\venv\Scripts\Activate.ps1

# macOS / Linux
source venv/bin/activate

# Install backend dependencies
pip install -r backend/requirements.txt

2. Node.js Dependencies

# Install root orchestration tools (concurrently, wait-on)
npm install

# Install frontend dependencies
cd frontend
npm install
cd ..

Tip: You can also run npm run install:all from the project root to install both root and frontend dependencies in one command.


๐Ÿš€ Running the Application

โšก One-Click Start (Recommended)

From the project root, run one of these:

# Option A โ€” npm (starts backend + frontend together)
npm start
# Option B โ€” PowerShell script (Windows)
.\start.ps1

Both methods will:

  • Kill any existing processes on ports 8000, 5173, 5174
  • Start the FastAPI backend on http://localhost:8000
  • Wait for the backend to become healthy
  • Start the Vite React frontend on http://localhost:5173

๐Ÿ”ง Manual Start (Step-by-Step)

If you prefer to start services individually:

Terminal 1 โ€” Backend (FastAPI)

# From the project root (with venv activated)
python backend/start_backend.py

Or directly with uvicorn:

cd backend
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Terminal 2 โ€” Frontend (Vite + React)

cd frontend
npm run dev

๐ŸŒ Access Points

Service URL
Frontend http://localhost:5173
Backend API http://localhost:8000
API Docs (Swagger) http://localhost:8000/docs
Health Check http://localhost:8000/health

๐Ÿ”— Environment Configuration

The .env files are pre-configured. If you need to customize them:

File Key Variable Default
.env (root) BACKEND_URL http://localhost:8000
frontend/.env VITE_API_URL http://localhost:8000

๐Ÿงช How to Use

  • ๐Ÿ” Live Prediction
    Enter multilingual or Hinglish text โ†’ get sentiment, confidence, explanation

  • ๐Ÿ“ฆ Bulk Analysis
    Upload CSV file โ†’ process batch sentiment predictions

  • ๐Ÿ“Š Dashboard
    View analytics, insights, and model outputs


๐Ÿ“ System Flow

Input โ†’ API โ†’ NLP Pipeline โ†’ Model โ†’ Decision Layer โ†’ Output โ†’ Dashboard


๐Ÿ“ Notes

First run may take time due to model loading Ensure internet connection for translation models (NLLB) Use small datasets initially for faster testing


โš ๏ธ Design Principles

  • No heuristics
  • Model-first decisions
  • Deterministic outputs
  • Translation-aware routing
  • Fully traceable pipeline

๐Ÿ”ฎ Future Work

  • Domain-specific fine-tuning
  • Advanced translation scoring
  • Sarcasm detection upgrade
  • CI/CD + deployment pipeline

๐Ÿ“œ License

MIT License


Built with โค๏ธ by amansethhh