A FastAPI web application that classifies product reviews as Fake or Real in both English and Arabic, using fine-tuned transformer models.
- 🌍 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 —
/healthfor deployment monitoring - ☁️ Cloud-ready — deployed on Render with models hosted on Hugging Face Hub
| 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.
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
git clone https://github.com/Raed-7/App-Fake-Review-Detection.git
cd App-Fake-Review-Detectionpip install -r requirements.txtuvicorn app.main:app --reloadNavigate to http://127.0.0.1:8000 in your browser.
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
}Returns model-load status for deployment health checks.
{
"status": "ok",
"models_loaded": true
}Try the deployed application here:
| Layer | Technology |
|---|---|
| Backend | FastAPI, Uvicorn |
| ML / NLP | Transformers, PyTorch, scikit-learn |
| Frontend | Static HTML / CSS / JS |
| Deployment | Render |
| Model Hosting | Hugging Face Hub |
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
Raed Alshammari BSc Computer Science with Artificial Intelligence University of Leeds, 2025/26
⭐ If you found this useful, please consider starring the repository!