This project builds a moderation pipeline for Google-style reviews. Goal: automatically flag reviews that violate policy categories:
- advertisement: promotional content, referral links, sales pitches.
- irrelevant: unrelated to the business (random stories, off-topic text).
- no_visit_rant: rants/complaints where reviewer admits no visit.
- none: all other legitimate, on-topic reviews.
We compare multiple approaches:
- Baseline (TF-IDF + Logistic Regression)
- Zero-Shot Classification (Hugging Face NLI models)
- Few-Shot Prompting (LLMs guided by
src/prompts/policy.md)
The pipeline produces labeled datasets, model predictions, evaluation metrics, and prompt artifacts for analysis.
git clone cd review-moderation-ml
python3 -m venv .venv source .venv/bin/activate
pip install -U pip pip install pandas scikit-learn transformers torch accelerate datasets evaluate matplotlib rich joblib python-dotenv jupyter
Place raw Google Reviews dataset into data/raw/ For JSON data: python src/data/ingest_json.py
python src/models/hf_batch_infer.py
python src/models/baseline.py
python src/eval/visualise.py
Instructions and few-shot examples are in src/prompts/policy.md. Optionally, run a few-shot demo with a small instruction-tuned LLM.
- Sean See — Data ingestion, JSON/CSV cleaning pipeline, repository setup.
- Cyril Pedrina — Zero-shot classification pipeline (Hugging Face), pseudo-label generation.
- Jade Ng — Baseline model (TF-IDF + Logistic Regression), training, and evaluation metrics.
- Eleanor Cheak — Prompt engineering (
policy.md), few-shot examples, and LLM experimentation. - Zelda Seow — Documentation, and final presentation delivery.