Downloads · 30 days
9
5% of all-time downloads
Loule/egide-toxicity-model
egide-toxicity-model is a text classification model from Loule. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
Modele de detection de toxicite multilingue (francais/anglais) concu pour la moderation de chat Twitch.
Downloads · 30 days
9
5% of all-time downloads
All-time downloads
197
Public
Parameters
278M
77.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
Modele de detection de toxicite multilingue (francais/anglais) concu pour la moderation de chat Twitch.
Ce modele a ete entraine pour la classification multi-label de contenu toxique. Il a ete concu specifiquement pour le projet Egide, un bot de moderation Twitch alimente par l'IA.
Le modele detecte 6 categories de toxicite sans aucune regle codee en dur : tout repose sur l'inference IA.
| Label | Description |
|---|---|
toxicity | Contenu toxique general |
insult | Insultes directes ou indirectes |
hate | Discours de haine (racisme, xenophobie) |
sexual | Contenu sexiste / a caractere sexuel |
threat | Menaces de violence |
identity_attack | Attaques basees sur l'identite (homophobie, transphobie, etc.) |
Evalue sur un jeu de test de 243 exemples (15% du dataset) :
| Categorie | F1 Score |
|---|---|
| toxicity | 0.981 |
| insult | 0.974 |
| hate | 0.949 |
| sexual | 1.000 |
| threat | 0.966 |
| identity_attack | 0.945 |
| F1 Micro | 0.970 |
| F1 Macro | 0.969 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "Loule/egide-toxicity-model"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
model.eval()
LABELS = ["toxicity", "insult", "hate", "sexual", "threat", "identity_attack"]
def predict(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.sigmoid(logits).squeeze().tolist()
return {label: round(prob, 4) for label, prob in zip(LABELS, probs)}
# Exemples
print(predict("Tu es un connard"))
# -> toxicity: 0.98, insult: 0.95, ...
print(predict("ntm fdp"))
# -> toxicity: 0.97, insult: 0.93, ...
print(predict("GG bien joue le stream !"))
# -> toxicity: 0.01, insult: 0.01, ... (PAS toxique)
print(predict("Ca tue ce jeu"))
# -> toxicity: 0.03, insult: 0.02, ... (PAS flag comme toxique)
cd apps/ai-service
pip install -r requirements.txt
python main.py # Lance le service sur le port 8000
curl -X POST http://localhost:8000/analyze \
-H "Content-Type: application/json" \
-d '{"text": "ntm sale race"}'
Twitch Chat -> Node.js Bot (tmi.js) -> HTTP -> Python AI Service (FastAPI) -> Moderation
Le bot Node.js envoie les messages au service Python via HTTP. Le service charge ce modele et retourne les scores de toxicite. Aucun pattern n'est code en dur.
Apache 2.0
@misc{egide-toxicity-model,
author = {Loule},
title = {Egide Toxicity Model - Multilingual Toxicity Detection for Twitch Chat},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/Loule/egide-toxicity-model}
}