Downloads · 30 days
7
3% of all-time downloads
nayan90k/roberta-finetuned-cyberbullying-detection
roberta-finetuned-cyberbullying-detection is a machine learning model from nayan90k. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a roberta-base model fine-tuned for the specific task of detecting cyberbullying and toxic language in text. The model has been trained on a diverse and balanced dataset aggregated from multiple public sources…
Downloads · 30 days
7
3% of all-time downloads
All-time downloads
236
Public
Parameters
125M
499 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors499 MB · 99%
From the Hugging Face model README
This is a roberta-base model fine-tuned for the specific task of detecting cyberbullying and toxic language in text. The model has been trained on a diverse and balanced dataset aggregated from multiple public sources, making it robust for real-world chat and social media conversations.
This model is intended to be used as part of a privacy-first system where analysis is performed locally on a user's device.
roberta-baseThe easiest way to use this model is with a pipeline from the transformers library.
!pip install transformers
from transformers import pipeline
model_name = "nayan90k/roberta-finetuned-cyberbullying-detection"
classifier = pipeline("text-classification", model=model_name)
results = classifier([
"I love this project, it's so helpful!",
"You are a total loser and everyone knows it."
])
print(results)
# Expected Output:
# [
# {'label': 'LABEL_0', 'score': 0.99...}, # Not bullying
# {'label': 'LABEL_1', 'score': 0.98...} # Bullying
# ]
This model was trained on a custom, aggregated dataset compiled from several public sources to ensure diversity. The final, cleaned, and balanced dataset is available on the Hub:
The dataset contains 136,440 samples, perfectly balanced between two classes:
0: Not Cyberbullying1: CyberbullyingData was sourced from Twitter, Wikipedia talk pages, and YouTube comments, among others.
The model was fine-tuned for 1 epoch using the following hyperparameters with the transformers Trainer:
2e-5165000.01The full training script and environment setup can be found at the project's GitHub repository: github.com/Kamal-Nayan-Kumar/GuardianAI.
The model was evaluated on a held-out test set of 13,644 samples, achieving the following results:
| Metric | Score |
|---|---|
| Accuracy | 0.9000 |
| F1-Score | 0.9025 |
| Precision | 0.8803 |
| Recall | 0.9258 |
This model is designed to be a component in a larger system for monitoring online conversations for potential harm, particularly for the safety of younger users.