|
|
--- |
|
|
language: |
|
|
- en |
|
|
license: apache-2.0 |
|
|
tags: |
|
|
- deberta |
|
|
- text-classification |
|
|
- microaggression |
|
|
- detection |
|
|
- bias |
|
|
pipeline_tag: text-classification |
|
|
widget: |
|
|
- text: "You speak good English for someone from there." |
|
|
- text: "Where are you really from?" |
|
|
- text: "You're so articulate." |
|
|
datasets: |
|
|
- custom |
|
|
metrics: |
|
|
- accuracy |
|
|
- f1 |
|
|
model-index: |
|
|
- name: CI_MA_Detect |
|
|
results: |
|
|
- task: |
|
|
type: text-classification |
|
|
name: Microaggression Detection |
|
|
metrics: |
|
|
- type: accuracy |
|
|
value: 0.85 |
|
|
name: Accuracy |
|
|
--- |
|
|
|
|
|
# CI_MA_Detect - Microaggression Detection Model |
|
|
|
|
|
This model detects microaggressions in text using a fine-tuned DeBERTa architecture. |
|
|
|
|
|
## Model Description |
|
|
|
|
|
- **Model type:** DeBERTa for sequence classification |
|
|
- **Task:** Binary text classification (microaggression detection) |
|
|
- **Labels:** |
|
|
- LABEL_0: Not a microaggression |
|
|
- LABEL_1: Microaggression detected |
|
|
|
|
|
## Usage |
|
|
|
|
|
```python |
|
|
from transformers import DebertaTokenizer, DebertaForSequenceClassification |
|
|
import torch |
|
|
|
|
|
tokenizer = DebertaTokenizer.from_pretrained("jokugeorgin/CI_MA_Detect") |
|
|
model = DebertaForSequenceClassification.from_pretrained("jokugeorgin/CI_MA_Detect") |
|
|
|
|
|
text = "You speak good English for someone from there." |
|
|
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128) |
|
|
outputs = model(**inputs) |
|
|
prediction = torch.argmax(outputs.logits, dim=1) |
|
|
``` |
|
|
|
|
|
## API Usage |
|
|
|
|
|
```bash |
|
|
curl https://api-inference.huggingface.co/models/jokugeorgin/CI_MA_Detect \ |
|
|
-H "Authorization: Bearer YOUR_HF_TOKEN" \ |
|
|
-H "Content-Type: application/json" \ |
|
|
-d '{"inputs": "You speak good English for someone from there."}' |
|
|
``` |
|
|
|
|
|
## Training Data |
|
|
|
|
|
Custom dataset of microaggression examples and neutral text. |
|
|
|
|
|
## Limitations |
|
|
|
|
|
- Works best with English text |
|
|
- May require context for ambiguous statements |
|
|
- Performance varies with text length and complexity |