Downloads · 30 days
5.1K
1% of all-time downloads
d4data/bias-detection-model
bias-detection-model is a text classification model from d4data. Use it when you need a label for a piece of text. It is set up for transformers.
An English sequence classification model, trained on MBAD Dataset to detect bias and fairness in sentences (news articles). This model was built on top of distilbert-base-uncased model and trained for 30 epochs with a…
Downloads · 30 days
5.1K
1% of all-time downloads
All-time downloads
766K
Public
Repo size
268 MB
Likes
54
Public
Click a slice to open those files.
.h5268 MB · 100%
From the Hugging Face model README
An English sequence classification model, trained on MBAD Dataset to detect bias and fairness in sentences (news articles). This model was built on top of distilbert-base-uncased model and trained for 30 epochs with a batch size of 16, a learning rate of 5e-5, and a maximum sequence length of 512.
| Train Accuracy | Validation Accuracy | Train loss | Test loss |
|---|---|---|---|
| 76.97 | 62.00 | 0.45 | 0.96 |
The easiest way is to load the inference api from huggingface and second method is through the pipeline object offered by transformers library.
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
from transformers import pipeline
tokenizer = AutoTokenizer.from_pretrained("d4data/bias-detection-model")
model = TFAutoModelForSequenceClassification.from_pretrained("d4data/bias-detection-model")
classifier = pipeline('text-classification', model=model, tokenizer=tokenizer) # cuda = 0,1 based on gpu availability
classifier("The irony, of course, is that the exhibit that invites people to throw trash at vacuuming Ivanka Trump lookalike reflects every stereotype feminists claim to stand against, oversexualizing Ivanka’s body and ignoring her hard work.")
This model is part of the Research topic "Bias and Fairness in AI" conducted by Deepak John Reji, Shaina Raza. If you use this work (code, model or dataset), please star at:
Bias & Fairness in AI, (2022), GitHub repository, https://github.com/dreji18/Fairness-in-AI