CoolFace
Modelpublic

yehort/distilbert-gaming-chat-toxicity-en

sourceHugging Faceupdated 1y agoView on Hugging Face
1likes6downloads
Model Card

DistilBERT Gaming Chat Toxicity Detector (English)

A fine-tuned DistilBERT model for toxic message detection in English gaming chat. This model is designed for automated moderation, research, and safety applications in online gaming environments.


Model Details

  • —Architecture: DistilBERT (distilbert-base-uncased) for sequence classification
  • —Language: English
  • —Task: Binary classification (toxic / not toxic) of gaming chat messages
  • —Input: Raw chat message (string)
  • —Output: Toxicity label (0 = not toxic, 1 = toxic) and probability

Intended Use

  • —Automated moderation of gaming chat platforms
  • —Research on toxicity detection in online communities
  • —Safety tools for gaming and streaming platforms

How to Use

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("yehort/distilbert-gaming-chat-toxicity-en")
model = AutoModelForSequenceClassification.from_pretrained("yehort/distilbert-gaming-chat-toxicity-en")

text = "your chat message here"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)
with torch.no_grad():
    logits = model(**inputs).logits
    prob = torch.softmax(logits, dim=-1)[0, 1].item()
    pred = int(prob > 0.5)
print(f"Toxic: {bool(pred)}, Probability of text to be toxic: {prob:.2%}") # example Toxic: False, Probability: 0.42%;   Toxic: True, Probability: 99.71%

Training & Evaluation

  • —Base model: distilbert-base-uncased
  • —Fine-tuning: 3 epochs, batch size 8, learning rate 2e-5, AdamW optimizer, early stopping
  • —Hardware: CPU (Intel Core i7-10700K), 32GB RAM
  • —Training time: ~49 minutes

Performance (Test Set)

MetricValue
Accuracy94.3%
Precision95.4%
Recall91.8%
F1-score93.6%
  • —Inference speed: ~10 messages/second (CPU)
  • —Model size: ~256MB

Limitations & Ethical Considerations

  • —Language: English only; may not generalize to other languages.
  • —Domain: Optimized for gaming chat; may not perform as well on other domains.
  • —Bias: Model may reflect biases present in gaming chat data (e.g., slang, cultural context).
  • —Edge cases: May miss subtle or novel forms of toxicity, sarcasm, or context-dependent meaning.
  • —False positives/negatives: Not perfect; human review is recommended for critical applications.
  • —Intended for research and moderation support, not for punitive automation without oversight.

Citation

If you use this model, please cite our paper:

@inproceedings{tereshchenkoandhämäläinen2025efficient,
  title={Efficient Toxicity Detection in Gaming Chats: A Comparative Study of Embeddings, Fine-Tuned Transformers and LLMs},
  author={Yehor Tereshchenko and Mika Hämäläinen},
  year={2025}
}

Contacts and links

https://www.linkedin.com/in/yehor-tere/ https://github.com/Yegmina/ Yehor.Tereshchenko@metropolia.fi ---

This model was developed as part of a scientific study on automated moderation in gaming communities. See the associated paper for full methodology and results.