IsGarrido/flan-t5-gender-rewriter
021
Gender Rewriter (FLAN-T5 Base)
This model is a fine-tuned version of google/flan-t5-base specialized in gender rewriting. It can translate a sentence from a Male context to a Female context (and vice versa) while preserving the original meaning and structure.
- Repository: IsGarrido/flan-t5-gender-rewriter
- Experiment: gendertranslatorv1
- Architecture: Encoder-Decoder (Seq2Seq)
Usage
You MUST use the specific prefixes trained into the model:
rewrite male to female: [sentence]rewrite female to male: [sentence]
Python Example
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("IsGarrido/flan-t5-gender-rewriter")
model = AutoModelForSeq2SeqLM.from_pretrained("IsGarrido/flan-t5-gender-rewriter")
input_text = "rewrite male to female: He is a bachelor living in the city."
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
outputs = model.generate(input_ids, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# Output: "She is a bachelorette living in the city."Bias & Limitations
This model was trained on synthetic data filtered by a BERT classifier. While it attempts to handle reflexives (himself/herself) and some professional titles, it may still struggle with:
- Rare gendered nouns (e.g., Duke/Duchess).
- Complex ambiguous pronouns in long paragraphs.
