đ Offensive Speech Detector
"Offensive Speech Detector" is a Deberta-based text classification model that predicts whether a text contains offensive language.
This model is fine - tuned on the tweet_eval dataset, which includes seven heterogeneous Twitter tasks framed as multi - class tweet classification. The 'offensive' subset is used for this task.
This model is part of our moderation model series, which also includes the following models that might interest you:
We believe these models can work together to build a more robust moderation tool.
đ Quick Start
The Offensive Speech Detector can be accessed using cURL or the Python API.
Basic Usage
$ curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"inputs": "I love AutoTrain"}' https://api-inference.huggingface.co/models/KoalaAI/OffensiveSpeechDetector
Advanced Usage
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model = AutoModelForSequenceClassification.from_pretrained("KoalaAI/OffensiveSpeechDetector", use_auth_token=True)
tokenizer = AutoTokenizer.from_pretrained("KoalaAI/OffensiveSpeechDetector", use_auth_token=True)
inputs = tokenizer("I love AutoTrain", return_tensors="pt")
outputs = model(**inputs)
⨠Features
- Predicts whether a text contains offensive language.
- Fine - tuned on the tweet_eval dataset's 'offensive' subset.
- Part of a series of moderation models that can be used in tandem.
đ Documentation
Intended uses & limitations
The Offensive Speech Detector is designed to detect offensive language in texts, useful for content moderation, sentiment analysis, or social media analysis. However, it has limitations:
- Trained and evaluated only on tweets, so it may not perform well on other text types like news articles or books.
- Trained and evaluated only on English tweets, so it may not generalize well to other languages or dialects.
- Based on the tweet_eval dataset, which may have biases or errors in annotation.
- A statistical classifier that outputs probability scores without explanations, and may make mistakes or produce false positives/negatives.
Ethical Considerations
This model deals with sensitive and potentially harmful language. Users should consider ethical implications and potential risks:
- It may reinforce or amplify existing biases or stereotypes in data or society.
Users should carefully consider the purpose, context, and impact of using this model and take appropriate measures to prevent harm.
License
This model is licensed under the CodeML OpenRAIL - M 0.1 license, a variant of the BigCode OpenRAIL - M license. It allows free access, use, modification, and distribution for research, commercial, or non - commercial purposes, subject to the following conditions:
- Include a copy of the license and the original source in any copies or derivatives.
- Do not use for unlawful, harmful, abusive, discriminatory, or offensive purposes.
- Respect the privacy and consent of data subjects and adhere to relevant laws.
- Acknowledge that the model is provided "as is" without warranties, and the licensor is not liable for damages.
Model Training Info
Property |
Details |
Problem Type |
Multi - class Classification |
CO2 Emissions (in grams) |
0.0108 |
Validation Metrics
Metric |
Value |
Loss |
0.497 |
Accuracy |
0.747 |
Macro F1 |
0.709 |
Micro F1 |
0.747 |
Weighted F1 |
0.741 |
Macro Precision |
0.722 |
Micro Precision |
0.747 |
Weighted Precision |
0.740 |
Macro Recall |
0.702 |
Micro Recall |
0.747 |
Weighted Recall |
0.747 |
đ License
This model is licensed under the CodeML OpenRAIL - M 0.1 license.