Elamur Research⌕
☰
home / papers / 2023 / The User-Aware Arabic Gender Rewriter

The User-Aware Arabic Gender Rewriter

Summary

Translation and other NLP tools usually return a single rendering of a sentence. In Arabic, nouns, adjectives and verbs carry grammatical gender, so such tools quietly choose genders for the speaker and the addressee, often along stereotyped lines such as a male doctor and a female nurse. The authors built a free web application where a user sets the grammatical gender wanted for the first person, the second person, or both, and receives matching Arabic variants. Input can be Arabic, or English that is first passed through Google Translate.

The back-end is the strongest model from Alhafni et al. (2022b), trained on APGC v2.1 with OpenSubtitles 2018 augmentation. It works in three steps:

  • a BERT tagger marks gendered words;
  • a cascade of three word-level generators proposes alternatives;
  • a masked language model ranks the full-sentence candidates.

The model reaches 88.4 M2 F0.5. Used as a post-editor, it improves Google Translate output by about 1.2 BLEU. The tool makes personalised, less biased Arabic output practical. It covers only binary grammatical gender.

Key points

  • The model is trained on the Arabic Parallel Gender Corpus (APGC v2.1) plus augmented data from OpenSubtitles 2018. In APGC, words that are candidates for rewriting make up about 10% of all tokens and 17% of tokens in gender-specific sentences.
  • Gender identification uses a word-level classifier fine-tuned from CAMeLBERT MSA.
  • Rewriting runs a backoff cascade: a bigram MLE corpus lookup, then the CAMeL Tools morphological analyzer/generator, then a character-level seq2seq model with side constraints. Pseudo-log-likelihood ranks the sentence candidates.
  • Results on the APGC v2.1 test set are 88.4 M2 F0.5, and post-editing Google Translate gains about 1.2 BLEU on average. Up to four outputs are produced, one per speaker/listener gender combination.
  • The interface uses Preact and Bulma, with a Flask API in Python. Gendered words are tagged ♂/♀, with speaker words shown in blue and listener words in orange. Planned work includes third-person rewriting and collecting user feedback.

Interesting ideas

  • I1. Detection is separated from editing: words are first labelled with the referent feature they encode, and a word is rewritten only if its label clashes with the requested target, so the rest of the sentence stays untouched. — For Mova (back): When regenerating text from the meaning graph, mark which surface tokens depend on an entity attribute and re-inflect only those when the attribute changes, keeping every edit traceable to one graph fact.
  • I2. A backoff cascade tries the cheap, precise source first (an observed-form lookup), then a rule-based morphological generator, and only then a neural fallback for unseen words. — For Mova (tokens): Crate en could inflect and lemmatize in the same order, using a treebank-derived form table, then explicit morphology rules, then a learned fallback, logging which tier answered.
  • I3. Candidates are over-generated locally without context and the choice is left to a whole-sentence scorer, which keeps the word-level generators simple. — For Mova (back): Generation could emit all agreement-compatible surface variants and pick one with a sentence-level score, while recording the rejected alternatives for explanation.
  • I4. Instead of silently defaulting an unknown attribute of a conversation participant, the system lists every combination the user allows and labels each output with its assumptions. — For Mova (frames): When the speaker's or addressee's attributes are underspecified, prag could keep labelled alternative frames rather than committing to a default reading.
  • I5. Quality is measured both with an edit-level metric and as the gain from post-editing a strong external system's output. — For Mova (learn): Self-induced repair rules could be scored by the LAS change they bring when applied to another witness parser's trees, with untouched trees serving as a control.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

Fields: Linguistics & languages · Machine translation

Topics: Semitic languages

Cite

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{alhafni2023user,
  title = {{The User-Aware Arabic Gender Rewriter}},
  author = {Alhafni, Bashar and Obeid, Ossama and Habash, Nizar},
  booktitle = {Proceedings of the First Workshop on Gender-Inclusive Translation Technologies},
  year = {2023},
  url = {https://aclanthology.org/2023.gitt-1.1/}
}

References

55 references, 22 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Ala’uldeen, Rola. 2022. Gender and Arabic (in Arabic). Kohl Journal Vol 8. https://kohljournal.press/node/346. ↗
  2. Alhafni, Bashar, Nizar Habash, and Houda Bouamor. 2020. Gender-aware reinflection using linguistically enhanced neural models. In Proceedings of the Second Workshop on Gender Bias in Natural Language Processing, pages 139–150, Barcelona, Spain (Online), December. Association for Computational Linguistics. find
  3. Alhafni, Bashar, Nizar Habash, and Houda Bouamor. 2022a. The Arabic parallel gender corpus 2.0: Extensions and analyses. In Proceedings of the Thirteenth Language Resources and Evaluation Conference, pages 1870–1884, Marseille, France, June. European Language Resources Association. find our card
  4. Alhafni, Bashar, Nizar Habash, and Houda Bouamor. 2022b. User-centric gender rewriting. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 618–631, Seattle, United States, July. Association for Computational Linguistics. find
  5. Blodgett, Su Lin, Solon Barocas, Hal Daumé III, and Hanna Wallach. 2020. Language (technology) is power: A critical survey of “bias” in NLP. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5454– 5476, Online, July. Association for Computational Linguistics. find our card
  6. Bolukbasi, Tolga, Kai-Wei Chang, James Y Zou, Venkatesh Saligrama, and Adam T Kalai. 2016. Man is to computer programmer as woman is to homemaker? debiasing word embeddings. In Lee, D., M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc. find our card
  7. Boyd, Danah and Kate Crawford. 2012. Critical questions for big data. Information, Communication & Society, 15(5):662–679. find
  8. Cercas Curry, Amanda, Judy Robertson, and Verena Rieser. 2020. Conversational assistants and gender stereotypes: Public perceptions and desiderata for voice personas. In Proceedings of the Second Workshop on Gender Bias in Natural Language Processing, pages 72–78, Barcelona, Spain (Online), December. Association for Computational Linguistics. find
  9. Ciora, Chloe, Nur Iren, and Malihe Alikhani. 2021. Examining covert gender bias: A case study in Turkish and English machine translation models. In Proceedings of the 14th International Conference on Natural Language Generation, pages 55–63, Aberdeen, Scotland, UK, August. Association for Computational Linguistics. find
  10. Costa-jussà, Marta R. and Adrià de Jorge. 2020. Fine-tuning neural machine translation on gender-balanced datasets. In Proceedings of the Second Workshop on Gender Bias in Natural Language Processing, pages 26–34, Barcelona, Spain (Online), December. Association for Computational Linguistics. find
  11. Dahlmeier, Daniel and Hwee Tou Ng. 2012. Better evaluation for grammatical error correction. In Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 568–572, Montréal, Canada, June. find
  12. Devlin, Jacob, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota, June. Association for Computational Linguistics. find
  13. Dinan, Emily, Angela Fan, Adina Williams, Jack Urbanek, Douwe Kiela, and Jason Weston. 2020. Queens are powerful too: Mitigating gender bias in dialogue generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8173–8188, Online, November. Association for Computational Linguistics. find our card
  14. Elaraby, Mostafa, Ahmed Y. Tawfik, Mahmoud Khaled, Hany Hassan, and Aly Osama. 2018. Gender aware spoken language translation applied to english-arabic. In 2018 2nd International Conference on Natural Language and Speech Processing (ICNLSP), pages 1–6. find
  15. Escudé Font, Joel and Marta R. Costa-jussà. 2019. Equalizing gender bias in neural machine translation with word embeddings techniques. In Proceedings of the First Workshop on Gender Bias in Natural Language Processing, pages 147–154, Florence, Italy, August. Association for Computational Linguistics. find
  16. Gonen, Hila and Kellie Webster. 2020. Automatically identifying gender issues in machine translation using perturbations. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1991–1995, Online, November. Association for Computational Linguistics. find
  17. Habash, Nizar, Abdelhadi Soudi, and Tim Buckwalter. 2007. On Arabic Transliteration. In van den Bosch, A. and A. Soudi, editors, Arabic Computational Morphology: Knowledge-based and Empirical Methods, pages 15–22. Springer, Netherlands. find
  18. Habash, Nizar, Houda Bouamor, and Christine Chung. 2019. Automatic gender identification and reinflection in Arabic. In Proceedings of the First Workshop on Gender Bias in Natural Language Processing, pages 155–165, Florence, Italy, August. find
  19. Habash, Nizar Y. 2010. Introduction to Arabic natural language processing, volume 3. Morgan & Claypool Publishers. find
  20. Hall Maudslay, Rowan, Hila Gonen, Ryan Cotterell, and Simone Teufel. 2019. It’s all in the name: Mitigating gender bias with name-based counterfactual data substitution. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 5267–5275, Hong Kong, China, November. find
  21. Inoue, Go, Bashar Alhafni, Nurpeiis Baimukan, Houda Bouamor, and Nizar Habash. 2021. The interplay of variant, size, and task type in Arabic pre-trained language models. In Proceedings of the Sixth Arabic Natural Language Processing Workshop, pages 92– 104, Kyiv, Ukraine (Virtual), April. Association for Computational Linguistics. find our card
  22. Johnson, Melvin. 2020. A scalable approach to reducing gender bias in google translate. Google AI Blog. find
  23. Kuczmarski, James. 2018. Reducing gender bias in google translate. Google Blog. find
  24. Lison, Pierre and Jörg Tiedemann. 2016. OpenSubtitles2016: Extracting large parallel corpora from movie and TV subtitles. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC’16), pages 923–929, Portorož, Slovenia, May. European Language Resources Association (ELRA). find our card
  25. Liu, Haochen, Jamell Dacon, Wenqi Fan, Hui Liu, Zitao Liu, and Jiliang Tang. 2020a. Does gender matter? towards fairness in dialogue systems. In Proceedings of the 28th International Conference on Computational Linguistics, pages 4403–4416, Barcelona, Spain (Online), December. International Committee on Computational Linguistics. find
  26. Liu, Haochen, Wentao Wang, Yiqi Wang, Hui Liu, Zitao Liu, and Jiliang Tang. 2020b. Mitigating gender bias for neural dialogue generation with adversarial learning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 893–903, Online, November. Association for Computational Linguistics. find
  27. Lu, Kaiji, Piotr Mardziel, Fangjing Wu, Preetam Amancharla, and Anupam Datta. 2018. Gender bias in neural natural language processing. find our card
  28. Maass, Anne and Luciano Arcuri. 1996. Language and stereotyping. Stereotypes and stereotyping, pages 193–226. find
  29. Manzini, Thomas, Lim Yao Chong, Alan W Black, and Yulia Tsvetkov. 2019. Black is to criminal as caucasian is to police: Detecting and removing multi-class bias in word embeddings. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 615–621, Minneapolis, Minnesota, June. Association for Computational Linguistics. find
  30. Měchura, Michal. 2022. A taxonomy of bias-causing ambiguities in machine translation. In Proceedings of the 4th Workshop on Gender Bias in Natural Language Processing (GeBNLP), pages 168–173, Seattle, Washington, July. Association for Computational Linguistics. find
  31. Menegatti, Michela and Monica Rubini. 2017. Gender bias and sexism in language. In Oxford Research Encyclopedia of Communication. Oxford University Press. find
  32. Obeid, Ossama, Nasser Zalmout, Salam Khalifa, Dima Taji, Mai Oudah, Bashar Alhafni, Go Inoue, Fadhl Eryani, Alexander Erdmann, and Nizar Habash. 2020. CAMeL tools: An open source python toolkit for Arabic natural language processing. In Proceedings of The 12th Language Resources and Evaluation Conference, pages 7022–7032, Marseille, France, May. European Language Resources Association. find our card
  33. Olteanu, Alexandra, Carlos Castillo, Fernando Diaz, and Emr Kıcıman. 2019. Social data: Biases, methodological pitfalls, and ethical boundaries. Frontiers in Big Data, 2. find
  34. Papineni, Kishore, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. BLEU: a Method for Automatic Evaluation of Machine Translation. In Proceedings of the Conference of the Association for Computational Linguistics (ACL), pages 311–318, Philadelphia, Pennsylvania, USA. find our card
  35. Rabinovich, Ella, Raj Nath Patel, Shachar Mirkin, Lucia Specia, and Shuly Wintner. 2017. Personalized machine translation: Preserving original author traits. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 1074–1084, Valencia, Spain, April. find
  36. Rudinger, Rachel, Jason Naradowsky, Brian Leonard, and Benjamin Van Durme. 2018. Gender bias in coreference resolution. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 8–14, New Orleans, Louisiana, June. find our card
  37. Salazar, Julian, Davis Liang, Toan Q. Nguyen, and Katrin Kirchhoff. 2020. Masked language model scoring. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2699–2712, Online, July. Association for Computational Linguistics. find our card
  38. Saunders, Danielle and Bill Byrne. 2020. Reducing gender bias in neural machine translation as a domain adaptation problem. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7724–7736, Online, July. Association for Computational Linguistics. find our card
  39. Saunders, Danielle, Rosie Sallis, and Bill Byrne. 2020. Neural machine translation doesn’t translate gender coreference right unless you make it. In Proceedings of the Second Workshop on Gender Bias in Natural Language Processing, pages 35–43, Barcelona, Spain (Online), December. Association for Computational Linguistics. find our card
  40. Savoldi, Beatrice, Marco Gaido, Luisa Bentivogli, Matteo Negri, and Marco Turchi. 2021. Gender Bias in Machine Translation. Transactions of the Association for Computational Linguistics, 9:845–874, 08. find our card
  41. Savoldi, Beatrice, Marco Gaido, Luisa Bentivogli, Matteo Negri, and Marco Turchi. 2022a. On the dynamics of gender learning in speech translation. In Proceedings of the 4th Workshop on Gender Bias in Natural Language Processing (GeBNLP), pages 94– 111, Seattle, Washington, July. Association for Computational Linguistics. find
  42. Savoldi, Beatrice, Marco Gaido, Luisa Bentivogli, Matteo Negri, and Marco Turchi. 2022b. Under the morphosyntactic lens: A multifaceted evaluation of gender bias in speech translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1807–1824, Dublin, Ireland, May. Association for Computational Linguistics. find
  43. Sennrich, Rico, Barry Haddow, and Alexandra Birch. 2016. Controlling politeness in neural machine translation via side constraints. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 35–40, San Diego, California, June. Association for Computational Linguistics. find our card
  44. Sheng, Emily, Kai-Wei Chang, Prem Natarajan, and Nanyun Peng. 2021. “nice try, kiddo”: Investigating ad hominems in dialogue responses. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 750–767, Online, June. Association for Computational Linguistics. find
  45. Stafanovičs, Artūrs, Toms Bergmanis, and Mārcis Pinnis. 2020. Mitigating gender bias in machine translation with target gender annotations. find our card
  46. Stanovsky, Gabriel, Noah A. Smith, and Luke Zettlemoyer. 2019. Evaluating gender bias in machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1679–1684, Florence, Italy, July. find our card
  47. Sun, Tony, Andrew Gaut, Shirlyn Tang, Yuxin Huang, Mai ElSherief, Jieyu Zhao, Diba Mirza, Elizabeth Belding, Kai-Wei Chang, and William Yang Wang. 2019. Mitigating gender bias in natural language processing: Literature review. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1630–1640, Florence, Italy, July. Association for Computational Linguistics. find our card
  48. Sun, Tony, Kellie Webster, Apu Shah, William Yang Wang, and Melvin Johnson. 2021. They, them, theirs: Rewriting with gender-neutral english. find
  49. UN. 2018. Guidelines for gender-inclusive language in Arabic. https://www.un.org/ar/gender-inclusive-language/guidelines.shtml. ↗
  50. Vanmassenhove, Eva, Christian Hardmeier, and Andy Way. 2018. Getting gender right in neural machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3003–3008, Brussels, Belgium, October-November. find our card
  51. Vanmassenhove, Eva, Chris Emmery, and Dimitar Shterionov. 2021. NeuTral Rewriter: A rule-based and neural approach to automatic rewriting into gender neutral alternatives. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8940–8948, Online and Punta Cana, Dominican Republic, November. Association for Computational Linguistics. find
  52. Zhao, Jieyu, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. 2018a. Gender bias in coreference resolution: Evaluation and debiasing methods. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 15–20, New Orleans, Louisiana, June. find our card
  53. Zhao, Jieyu, Yichao Zhou, Zeyu Li, Wei Wang, and Kai-Wei Chang. 2018b. Learning gender-neutral word embeddings. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4847–4853, Brussels, Belgium, October-November. find our card
  54. Zhao, Jieyu, Subhabrata Mukherjee, Saghar Hosseini, Kai-Wei Chang, and Ahmed Hassan Awadallah. 2020. Gender bias in multilingual embeddings and cross-lingual transfer. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2896–2907, Online, July. Association for Computational Linguistics. find
  55. Zmigrod, Ran, Sabrina J. Mielke, Hanna Wallach, and Ryan Cotterell. 2019. Counterfactual data augmentation for mitigating gender stereotypes in languages with rich morphology. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1651–1661, Florence, Italy, July. find our card

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/alhafni-2023-user-aware-arabic-gender-rewriter/