CoolFace
Modelpublic

jokugeorgin/CI_MA_Reframe

sourceHugging Faceapache-2.0updated 11mo agoView on Hugging Face
0likes24downloads
Model Card

CIMAReframe - 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