File size: 2,257 Bytes
76a8715
3dce1b9
 
76a8715
3dce1b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76a8715
11a718a
3dce1b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
language:
- en
license: apache-2.0
tags:
- t5
- text2text-generation
- microaggression
- reframing
- paraphrase
pipeline_tag: text2text-generation
widget:
- text: "rephrase: You speak good English for someone from there."
- text: "rephrase: Where are you really from?"
- text: "rephrase: You're so articulate for your background."
datasets:
- custom
metrics:
- bleu
- rouge
base_model: t5-base
model-index:
- name: CI_MA_Reframe
  results:
  - task:
      type: text2text-generation
      name: Microaggression Reframing
    metrics:
    - type: bleu
      value: 0.75
      name: BLEU
---

# CI_MA_Reframe - Microaggression Reframing Model

This model reframes potentially problematic text into more inclusive language using a fine-tuned T5 architecture.

## Model Description

- **Model type:** T5 for text-to-text generation
- **Task:** Text reframing/paraphrasing
- **Base model:** t5-base

## Usage

**Important:** Always prefix your input with `"rephrase: "` for proper generation.

```python
from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("jokugeorgin/CI_MA_Reframe")
model = T5ForConditionalGeneration.from_pretrained("jokugeorgin/CI_MA_Reframe")

text = "rephrase: You speak good English for someone from there."
inputs = tokenizer(text, return_tensors="pt", max_length=256, truncation=True)

outputs = model.generate(
    **inputs,
    max_length=256,
    num_beams=5,
    num_return_sequences=3,
    temperature=0.8,
    do_sample=True,
    no_repeat_ngram_size=2
)

for output in outputs:
    print(tokenizer.decode(output, skip_special_tokens=True))
```

## API Usage

```bash
curl https://api-inference.huggingface.co/models/jokugeorgin/CI_MA_Reframe \
  -H "Authorization: Bearer YOUR_HF_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": "rephrase: You speak good English for someone from there.",
    "parameters": {
      "max_new_tokens": 96,
      "num_return_sequences": 3,
      "temperature": 0.8
    }
  }'
```

## Training Data

Custom dataset of microaggression examples and their reframed alternatives.

## Limitations

- Requires "rephrase: " prefix for optimal results
- Works best with English text
- May occasionally produce generic reframings