Skip to content

Raed-7/App-Fake-Review-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🕵️ Bilingual Fake Review Detector

English & Arabic · Real-time Detection · Powered by Transformers

Live Demo Python FastAPI Hugging Face Render

A FastAPI web application that classifies product reviews as Fake or Real in both English and Arabic, using fine-tuned transformer models.

🌐 Try the Live App · 📖 Documentation · 🚀 Quick Start


✨ Features

  • 🌍 Bilingual support — automatic English / Arabic routing via Unicode-script heuristic
  • 🎯 High accuracy — DistilBERT for English, CamelBERT-Mix for Arabic
  • Real-time inference — models loaded once at startup for low latency
  • 📊 Confidence scoring — every prediction includes a transparent confidence value
  • 🎨 Clean UI — minimal static HTML frontend, no build step required
  • 🔍 Health endpoint/health for deployment monitoring
  • ☁️ Cloud-ready — deployed on Render with models hosted on Hugging Face Hub

🧠 Models

Language Model Hugging Face
🇬🇧 English DistilBERT (fine-tuned) raed-7/fake-review-distilbert-en
🇸🇦 Arabic CamelBERT-Mix (fine-tuned) raed-7/fake-review-camelbert-ar

Models are loaded remotely at application startup and cached for reuse.


📁 Project Structure

App-Fake-Review-Detection/
├── app/
│   ├── main.py              # FastAPI entrypoint
│   ├── predictor.py         # Inference logic & language routing
│   ├── schemas.py           # Pydantic request/response models
│   └── static/
│       └── index.html       # Frontend UI
├── requirements.txt          # Python dependencies
├── render.yaml               # Render deployment config
├── runtime.txt               # Python version pin
└── README.md

🚀 Run Locally

1. Clone the repository

git clone https://github.com/Raed-7/App-Fake-Review-Detection.git
cd App-Fake-Review-Detection

2. Install dependencies

pip install -r requirements.txt

3. Start the server

uvicorn app.main:app --reload

4. Open the app

Navigate to http://127.0.0.1:8000 in your browser.


🔌 API

POST /predict

Submit a review and receive a classification.

Request body:

{
  "text": "Best product ever!!! Amazing quality, fast shipping, 5 stars!!!"
}

Response:

{
  "label": "Fake",
  "confidence": 99.9,
  "language": "English",
  "model": "DistilBERT",
  "processing_time_ms": 1247
}

GET /health

Returns model-load status for deployment health checks.

{
  "status": "ok",
  "models_loaded": true
}

🌐 Live Demo

Try the deployed application here:


🛠️ Tech Stack

Layer Technology
Backend FastAPI, Uvicorn
ML / NLP Transformers, PyTorch, scikit-learn
Frontend Static HTML / CSS / JS
Deployment Render
Model Hosting Hugging Face Hub

📚 Research Context

This application is the deployment artefact of a final-year BSc dissertation at the University of Leeds:

Detecting Fake E-Commerce Reviews in English and Arabic Using Classical and Transformer Models (2025/26)

The accompanying research compares classical TF-IDF baselines (Logistic Regression, Linear SVM, Random Forest) against fine-tuned transformer models (BERT, DistilBERT, CamelBERT, AraBERT) on bilingual fake review detection.

Key results:

  • DistilBERT (English): macro-F1 = 0.9813
  • CamelBERT (Arabic): macro-F1 = 0.8582

👤 Author

Raed Alshammari BSc Computer Science with Artificial Intelligence University of Leeds, 2025/26


If you found this useful, please consider starring the repository!

About

Bilingual (English + Arabic) fake review detector built with fine-tuned transformer models (DistilBERT + CamelBERT) and deployed as a FastAPI web app.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors