monsoon-nlp commited on
Commit
de3a998
1 Parent(s): 9e844f4
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: ar
3
+ ---
4
+
5
+ # ar-seq2seq-gender (decoder)
6
+
7
+ This is a seq2seq model (decoder half) to "flip" gender in **first-person** Arabic sentences.
8
+ The model can augment your existing Arabic data, or generate counterfactuals
9
+ to test a model's decisions (would changing the gender of the subject or speaker change output?).
10
+
11
+ Intended Examples:
12
+ - 'أنا سعيد' <=> 'انا سعيدة'
13
+ - 'ركض إلى المتجر' <=> 'ركضت إلى المتجر'
14
+
15
+ 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.
16
+
17
+ ## Training
18
+
19
+ I originally developed
20
+ <a href="https://github.com/MonsoonNLP/el-la">a gender flip Python script</a>
21
+ for Spanish sentences, using
22
+ <a href="https://huggingface.co/dccuchile/bert-base-spanish-wwm-uncased">BETO</a>,
23
+ and spaCy. More about this project: https://medium.com/ai-in-plain-english/gender-bias-in-spanish-bert-1f4d76780617
24
+
25
+ The Arabic model encoder and decoder started with weights and vocabulary from
26
+ <a href="https://github.com/UBC-NLP/marbert">MARBERT from UBC-NLP</a>,
27
+ and was trained on the
28
+ <a href="https://camel.abudhabi.nyu.edu/arabic-parallel-gender-corpus/">Arabic Parallel Gender Corpus</a>
29
+ from NYU Abu Dhabi. The text is first-person sentences from OpenSubtitles, with parallel
30
+ gender-reinflected sentences generated by Arabic speakers.
31
+
32
+ Training notebook: https://colab.research.google.com/drive/1TuDfnV2gQ-WsDtHkF52jbn699bk6vJZV
33
+
34
+ ## Non-binary gender
35
+
36
+ This model is useful to generate male and female text samples, but falls
37
+ short of capturing gender diversity in the world and in the Arabic
38
+ language. This subject is discussed in the bias statement of the
39
+ <a href="https://www.aclweb.org/anthology/2020.gebnlp-1.12/">Gender Reinflection paper</a>.
config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": true,
3
+ "architectures": [
4
+ "BertLMHeadModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "directionality": "bidi",
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "is_decoder": true,
15
+ "layer_norm_eps": 1e-12,
16
+ "max_position_embeddings": 512,
17
+ "model_type": "bert",
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 12,
20
+ "pad_token_id": 0,
21
+ "pooler_fc_size": 768,
22
+ "pooler_num_attention_heads": 12,
23
+ "pooler_num_fc_layers": 3,
24
+ "pooler_size_per_head": 128,
25
+ "pooler_type": "first_token_transform",
26
+ "position_embedding_type": "absolute",
27
+ "transformers_version": "4.2.1",
28
+ "type_vocab_size": 2,
29
+ "use_cache": true,
30
+ "vocab_size": 100000
31
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:493bb39caee87c25b442cd17d0e09ec25ce40b046dfde12c706495d1c5e38077
3
+ size 765378057
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"do_lower_case": true, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "do_basic_tokenize": true, "never_split": null, "special_tokens_map_file": null}
vocab.txt ADDED
The diff for this file is too large to render. See raw diff