Available for a 6-month NLP / LLM end-of-studies internship from March 2027 Contact me
Projects / Hate speech detection in French

Hate speech detection in French

A CamemBERT classifier that flags hateful messages online, and above all an honest evaluation: corpus audit, separate validation set, decision threshold chosen on dedicated data.

Period
2026
Type
Personal project
Model
CamemBERT (camembert-base)
Data
FrenchHateSpeechSuperset
Hate speech detector demo: a message classified as hateful at 87%
The online demo (in French): the message is classified as hateful with a probability of 0.87, above the 0.23 threshold.

The problem

Detect hateful messages automatically to support moderation. Two classic traps: an imbalanced corpus, where a naive model learns to always answer “not hateful”, and an overly optimistic evaluation.

What a data audit revealed

The dataset has 42,660 rows but only 7,499 distinct texts: over 80% of the rows are duplicates. In a first version, the same sentences ended up in both the training and the test sets, and the results could not be trusted (precision of 0.20 on the “hateful” class). So I started again from scratch.

The method (v2)

Deduplication→70 / 15 / 15 split stratified→CamemBERT weighted loss→Threshold chosen on validation→Test used once

Test results

0.83F1, “hateful” class
0.79precision
0.88recall
0.90PR-AUC

On 1,125 unseen messages: 489 hateful messages detected, 66 missed, 129 false alarms.

Limitations

Python · Transformers · CamemBERT · PyTorch · scikit-learn · Google Colab (T4 GPU)