Downloads · 30 days
11
2% of all-time downloads
shainaraza/toxity_classify_debiaser
toxity_classify_debiaser is a text classification model from shainaraza. Use it when you need a label for a piece of text. It is set up for transformers.
Downloads · 30 days
11
2% of all-time downloads
All-time downloads
618
Public
Repo size
804 MB
Likes
0
Public
Click a slice to open those files.
.bin268 MB · 100%
From the Hugging Face model README
Toxicity Classifier with Debiaser
This model is a text classification model trained on a large dataset of comments to predict whether a given comment contains biased language or not. The model is based on DistilBERT architecture and fine-tuned on a labeled dataset of toxic and non-toxic comments.
This model is intended to be used to automatically detect biased language in user-generated comments in various online platforms. It can also be used as a component in a larger pipeline for text classification, sentiment analysis, or bias detection tasks.
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("shainaraza/toxity_classify_debiaser")
model = AutoModelForSequenceClassification.from_pretrained("shainaraza/toxity_classify_debiaser")
# Test the model with a sample comment
comment = "you are a dumb person."
inputs = tokenizer(comment, return_tensors="pt")
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=1).item()
print(f"Comment: {comment}")
print(f"Prediction: {'biased' if prediction == 1 else 'not biased'}")
The model was trained on a labeled dataset of comments from various online platforms, which were annotated as toxic or non-toxic by human annotators.
The model was evaluated on a separate test set of comments and achieved the following performance metrics:
This model has been trained and tested on comments from various online platforms, but its performance may be limited when applied to comments from different domains or languages.
The Toxicity Classifier is a powerful tool for automatically detecting and flagging potentially biased language in user-generated comments. While there are some limitations to its performance and potential biases in the training data, the model's high accuracy and robustness make it a valuable asset for any online platform looking to improve the quality and inclusivity of its user-generated content.