Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- bias-detection
|
| 6 |
+
- safety
|
| 7 |
+
- multi-label-classification
|
| 8 |
+
- distilbert
|
| 9 |
+
datasets:
|
| 10 |
+
- social_bias_frames
|
| 11 |
+
- google/civil_comments
|
| 12 |
+
metrics:
|
| 13 |
+
- f1
|
| 14 |
+
- roc_auc
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# DistilBERT Bias Classifier
|
| 18 |
+
**Safety Sensitiveness Service — Tier 2 Bias Head**
|
| 19 |
+
|
| 20 |
+
Detects 5 types of bias in short text (search queries, social posts):
|
| 21 |
+
|
| 22 |
+
| Label | Description |
|
| 23 |
+
|---|---|
|
| 24 |
+
| `racial` | Racial / ethnic bias |
|
| 25 |
+
| `gender` | Gender stereotyping |
|
| 26 |
+
| `religious` | Religious discrimination |
|
| 27 |
+
| `age` | Ageism |
|
| 28 |
+
| `sexual_orientation` | Sexual orientation bias |
|
| 29 |
+
|
| 30 |
+
## Performance
|
| 31 |
+
|
| 32 |
+
| Metric | Score |
|
| 33 |
+
|---|---|
|
| 34 |
+
| F1 Macro | 0.2678 |
|
| 35 |
+
| F1 Micro | 0.6810 |
|
| 36 |
+
| ROC-AUC Macro | 0.0000 |
|
| 37 |
+
| CrowS-Pairs Accuracy | 0.0000 |
|
| 38 |
+
| StereoSet Score | 0.4900 |
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from transformers import pipeline
|
| 44 |
+
classifier = pipeline("text-classification",
|
| 45 |
+
model="guisalim/distilbert-bias-classifier",
|
| 46 |
+
top_k=None)
|
| 47 |
+
print(classifier("Search query here"))
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Training details
|
| 51 |
+
- Base: `distilbert-base-uncased`
|
| 52 |
+
- Data: Social Bias Frames + Google Civil Comments
|
| 53 |
+
- Device: mps
|
| 54 |
+
- Threshold: 0.4
|