monsoon-nlp / ar-seq2seq-gender-encoder

huggingface.co
Total runs: 17
24-hour runs: 0
7-day runs: -3
30-day runs: 9
Model's Last Updated: May 20 2021
feature-extraction

Introduction of ar-seq2seq-gender-encoder

Model Details of ar-seq2seq-gender-encoder

ar-seq2seq-gender (encoder)

This is a seq2seq model (encoder half) to "flip" gender in first-person Arabic sentences. The model can augment your existing Arabic data, or generate counterfactuals to test a model's decisions (would changing the gender of the subject or speaker change output?).

Intended Examples:

  • 'أنا سعيد' <=> 'انا سعيدة'
  • 'ركض إلى المتجر' <=> 'ركضت إلى المتجر'

People's names, gender pronouns, gendered words (father, mother), and many other values are currently unchanged by this model. Future versions may be trained on more data.

Sample Code
import torch
from transformers import AutoTokenizer, EncoderDecoderModel

model = EncoderDecoderModel.from_encoder_decoder_pretrained(
  "monsoon-nlp/ar-seq2seq-gender-encoder",
  "monsoon-nlp/ar-seq2seq-gender-decoder",
  min_length=40
)
tokenizer = AutoTokenizer.from_pretrained('monsoon-nlp/ar-seq2seq-gender-decoder') # same as MARBERT original

input_ids = torch.tensor(tokenizer.encode("أنا سعيدة")).unsqueeze(0)
generated = model.generate(input_ids, decoder_start_token_id=model.config.decoder.pad_token_id)
tokenizer.decode(generated.tolist()[0][1 : len(input_ids[0]) - 1])
> 'انا سعيد'

https://colab.research.google.com/drive/1S0kE_2WiV82JkqKik_sBW-0TUtzUVmrV?usp=sharing

Training

I originally developed a gender flip Python script for Spanish sentences, using BETO , and spaCy. More about this project: https://medium.com/ai-in-plain-english/gender-bias-in-spanish-bert-1f4d76780617

The Arabic model encoder and decoder started with weights and vocabulary from MARBERT from UBC-NLP , and was trained on the Arabic Parallel Gender Corpus from NYU Abu Dhabi. The text is first-person sentences from OpenSubtitles, with parallel gender-reinflected sentences generated by Arabic speakers.

Training notebook: https://colab.research.google.com/drive/1TuDfnV2gQ-WsDtHkF52jbn699bk6vJZV

Non-binary gender

This model is useful to generate male and female text samples, but falls short of capturing gender diversity in the world and in the Arabic language. This subject is discussed in the bias statement of the Gender Reinflection paper .

Runs of monsoon-nlp ar-seq2seq-gender-encoder on huggingface.co

17
Total runs
0
24-hour runs
-2
3-day runs
-3
7-day runs
9
30-day runs

More Information About ar-seq2seq-gender-encoder huggingface.co Model

ar-seq2seq-gender-encoder huggingface.co

ar-seq2seq-gender-encoder huggingface.co is an AI model on huggingface.co that provides ar-seq2seq-gender-encoder's model effect (), which can be used instantly with this monsoon-nlp ar-seq2seq-gender-encoder model. huggingface.co supports a free trial of the ar-seq2seq-gender-encoder model, and also provides paid use of the ar-seq2seq-gender-encoder. Support call ar-seq2seq-gender-encoder model through api, including Node.js, Python, http.

ar-seq2seq-gender-encoder huggingface.co Url

https://huggingface.co/monsoon-nlp/ar-seq2seq-gender-encoder

monsoon-nlp ar-seq2seq-gender-encoder online free

ar-seq2seq-gender-encoder huggingface.co is an online trial and call api platform, which integrates ar-seq2seq-gender-encoder's modeling effects, including api services, and provides a free online trial of ar-seq2seq-gender-encoder, you can try ar-seq2seq-gender-encoder online for free by clicking the link below.

monsoon-nlp ar-seq2seq-gender-encoder online free url in huggingface.co:

https://huggingface.co/monsoon-nlp/ar-seq2seq-gender-encoder

ar-seq2seq-gender-encoder install

ar-seq2seq-gender-encoder is an open source model from GitHub that offers a free installation service, and any user can find ar-seq2seq-gender-encoder on GitHub to install. At the same time, huggingface.co provides the effect of ar-seq2seq-gender-encoder install, users can directly use ar-seq2seq-gender-encoder installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

ar-seq2seq-gender-encoder install url in huggingface.co:

https://huggingface.co/monsoon-nlp/ar-seq2seq-gender-encoder

Url of ar-seq2seq-gender-encoder

ar-seq2seq-gender-encoder huggingface.co Url

Provider of ar-seq2seq-gender-encoder huggingface.co

monsoon-nlp
ORGANIZATIONS

Other API from monsoon-nlp

huggingface.co

Total runs: 47
Run Growth: 31
Growth Rate: 63.27%
Updated:September 03 2023
huggingface.co

Total runs: 17
Run Growth: 8
Growth Rate: 47.06%
Updated:February 25 2025
huggingface.co

Total runs: 15
Run Growth: -1
Growth Rate: -6.67%
Updated:February 03 2025
huggingface.co

Total runs: 7
Run Growth: -8
Growth Rate: -114.29%
Updated:May 23 2021