CoolFace
Modelpublic

d4data/bias-detection-model

sourceHugging Faceupdated 4y agoView on Hugging Face
54likes4kdownloads
README.md46 linesDownload Raw Back to root
1---2language:3- en4tags:5- Text Classification6co2_eq_emissions: 0.3193557widget:8- text: "Nevertheless, Trump and other Republicans have tarred the protests as havens for terrorists intent on destroying property."9  example_title: "Biased example 1"10- text: "Billie Eilish issues apology for mouthing an anti-Asian derogatory term in a resurfaced video."11  example_title: "Biased example 2"12- text: "Christians should make clear that the perpetuation of objectionable vaccines and the lack of alternatives is a kind of coercion."13  example_title: "Biased example 3"14- text: "There have been a protest by a group of people"15  example_title: "Non-Biased example 1"16- text: "While emphasizing he’s not singling out either party, Cohen warned about the danger of normalizing white supremacist ideology."17  example_title: "Non-Biased example 2"18---19 20## About the Model21An 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.22 23- Dataset : MBAD Data24- Carbon emission 0.319355 Kg25 26| Train Accuracy | Validation Accuracy | Train loss | Test loss |27|---------------:| -------------------:| ----------:|----------:|28|          76.97 |               62.00 |       0.45 |      0.96 |29 30## Usage31The easiest way is to load the inference api from huggingface and second method is through the pipeline object offered by transformers library.32```python33from transformers import AutoTokenizer, TFAutoModelForSequenceClassification34from transformers import pipeline35tokenizer = AutoTokenizer.from_pretrained("d4data/bias-detection-model")36model = TFAutoModelForSequenceClassification.from_pretrained("d4data/bias-detection-model")37 38classifier = pipeline('text-classification', model=model, tokenizer=tokenizer) # cuda = 0,1 based on gpu availability39classifier("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.")40```41 42## Author43This 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:44> Bias & Fairness in AI, (2022), GitHub repository, <https://github.com/dreji18/Fairness-in-AI>45 46