← Back to projects

ReTweetify

Classify, explain and rewrite Turkish hate-speech tweets.

Multilingual BERTLoRA / PEFTSHAPLLaMA 3Python
ReTweetify screenshot

The problem

Moderating hate speech in a lower-resource language needs more than a label. Moderators need to know why a tweet was flagged, and authors benefit from a respectful alternative.

Approach

  • Fine-tuned bert-base-multilingual-cased with LoRA on a 4-bit quantised model, which keeps training cheap.
  • Trained on about 16k Turkish tweets labelled hateful (nefret) or not hateful (hiçbiri).
  • Used SHAP to show which tokens drove each prediction.
  • Used LLaMA-3 to paraphrase hateful tweets, keeping the tone but removing offensive phrases.

Results

  • End-to-end pipeline: classification, token-level explanation and rewriting.
  • Reports accuracy, macro F1, precision and recall. See the repo for the figures.
  • Dataset published on Kaggle with EDA and visualisations.

At a glance

Pipeline
  1. Tweet

  2. Classifier

    mBERT + LoRA, 4-bit

  3. Explanation

    SHAP token scores

  4. Rewrite if hateful

    LLaMA-3

Trained on about 16k Turkish tweets labelled nefret (hateful) or hiçbiri (not hateful).