User-Centric Gender Rewriting (2022)

Abstract: In this paper, we define the task of gender rewriting in contexts involving two users (I and/or You) – first and second grammatical persons with independent grammatical gender preferences. We focus on Arabic, a gender-marking morphologically rich language. We develop a multi-step system that combines the positive aspects of both rule-based and neural rewriting models. Our results successfully demonstrate the viability of this approach on a recently created corpus for Arabic gender rewriting, achieving 88.42 M2 F0.5 on a blind test set. Our proposed system improves over previous work on the first-person-only version of this task, by 3.05 absolute increase in M2 F0.5. We demonstrate a use case of our gender rewriting system by using it to post-edit the output of a commercial MT system to provide personalized outputs based on the users’ grammatical gender preferences. We make our code, data, and pretrained models publicly available.

## introduction gender bias is a fundamental problem in natural language processing (nlp) and it has been receiving an increasing attention across a variety of core tasks such as machine translation (mt), co-reference resolution, and dialogue systems. research has shown that nlp systems have the ability to embed and amplify gender bias @xcite , which not only degrades users' experiences but also creates representational harm @xcite . the embedded bias within nlp systems is usually attributed to training models on biased data that reflects the social inequalities of the world we live in. however, even the most balanced of models can still exhibit and amplify bias if they are designed to produce a single text output without taking their users' gender preferences into consideration. therefore, to provide the correct user-aware output, nlp systems should be designed to produce outputs that are as gender-specific as the users information they have access to. users information could be either embedded as part of the input or provided externally by the users themselves. in cases where this information is unavailable to the system, generating all gender-specific forms or a gender-neutral form is more appropriate. producing user-aware outputs becomes more challenging for systems targeting multi-user contexts (first and second persons, with independent grammatical gender preferences), particularly when dealing with gender-marking morphologically rich languages. in this paper, we define the task of gender rewriting in contexts involving two users (i and/or you) -first and second grammatical persons with independent grammatical gender preferences and we focus on arabic, a gender-marking morphologically rich language. the main contributions of our work are as follows: this paper is organized as follows. we first discuss related work ( §2) as well as relevant arabic linguistic facts ( §3). we then define the gender rewriting task in §4 and describe the data we use and the gender rewriting model we build in §5 and §6. lastly, we present our experimental setup ( §7) and results ( §8) and conclude in §9. ## background and related work substantial research has targeted the problem of gender bias in various nlp tasks such as mt @xcite @xcite , dialogue systems @xcite @xcite , language modeling @xcite @xcite @xcite , co-reference resolution @xcite , and named entity recognition @xcite . while the majority of research has focused on tackling gender bias in english by debiasing word embeddings @xcite @xcite @xcite or by training systems on gender-balanced corpora built using counterfactual data augmentation techniques @xcite @xcite , our work falls under text rewriting through the controlled generation of gender alternatives for morphologically rich languages. within text rewriting, vanmassenhove et al. (2021) and sun et al. (2021) recently presented rule-based and neural rewriting models to generate gender-neutral sentences in english. for morphologically rich languages and specifically arabic, habash et al. (2019) introduced the arabic parallel gender corpus v1.0 (apgc v1.0) of firstperson-singular constructions and designed a twostep gender identification and reinflection system to generate masculine and feminine grammatical gender alternatives. alhafni et al. (2020) used apgc v1.0 to create a joint gender identification and reinflection model. they treated the problem as a user-aware grammatical error correction task and showed improvements over habash et al. (2019)'s results. both efforts modeled gender reinflection using character-level seq2seq models. more recently, alhafni et al. (2022) extended apgc v1.0 to apgc v2.0 by including contexts involving first and second grammatical persons covering singular, dual, and plural constructions; and adding six times more sentences. in our work, we use apgc v2.0 to build a multistep gender rewriting system to generate gender alternatives in multi-user contexts. we also show improvements over both habash et al. (2019)'s and alhafni et al. (2020)'s results on apgc v1.0. ## arabic linguistic facts we highlight two of the many challenges that face modern standard arabic (msa) nlp systems dealing with gender expressions. ## data for our experiments, we use the publicly available arabic parallel gender corpus (apgc) -a parallel corpus of arabic sentences with gender annotations and gender rewritten alternatives of sentences selected from opensubtitles 2018 @xcite . the corpus comes in two versions: apgc v1.0 and apgc v2.0. apgc v1.0 was introduced by @xcite in all of our experiments, we use an extended version of apgc v2.0 to train and test our systems. we also report results on the test set of apgc v1.0 to compare with previous work. annotations each sentence in apgc v2.0 has word-level gender labels where each word is labeled as b, 1f, 2f, 1m, or 2m. all sentences containing gender-specific words referring to human participants have parallels representing their opposite gender forms. for the sentences without any gender-specific words, their parallels are trivial copies. out of the 80,326 sentences in apgc v2.0, 46% (36,980) do not contain any gendered words, whereas sentences with gendered references constitute 54% @xcite . in terms of the word-level statistics, 9.7% (58,066) are gender-specific, whereas 90.3% (538,733) are marked as b. moreover, apgc v2.0 is organized into five parallel corpora that are fully aligned (1-to-1) at the word level: input, target 1m/2m, target 1f/2m, target 1m/2f, and target 1f/2f. all five corpora are balanced in terms of gender, i.e., the number of words marked as 1f and 1m is the same; and the number of words marked as 2f and 2m is the same. the input corpus contains sentences with all possible word types (b, 1f, 2f, 1m, 2m). the target 1m/2m corpus contains sentences that consist of b, 1m, 2m words; the target 1f/2m corpus contains sentences that consist of b, 1f, 2m words; the target 1m/2f corpus contains sentences that consist of b, 1m, 2f words; and the target 1f/2f corpus contains sentences that consist of b, 1f, 2f words. the four target corpora are intended to model the target users' gender preferences for a particular input. splits we use alhafni et al. (2022)'s splits: 57,603 sentences (427,523 words) for training (train), 6,647 sentences (49,257 words) for development (dev), and 16,076 sentences (120,019 words) for testing (test). ## the multi-step model approach most of the recent work on gender rewriting rely on using seq2seq models @xcite @xcite @xcite . however, the lack of large gender-annotated parallel datasets presents a challenge when training seq2seq models, and especially when dealing with morphologically rich languages. this issue is highlighted by @xcite , who report that most of the errors (68%) produced by their character-level seq2seq model are due to not making any changes to genderspecific words in the input sentences. given the complexity of the gender rewriting task in arabic and the relatively small training data size, we model the gender rewriting task using a multi-step system the combines the positive aspects of rule-based and neural models. our system consists of three components: gender identification, out-of-context word gender rewriting, and in-context ranking and selection. ## results we used our best model to conduct the data augmentation experiments as discussed in §7.4. the full set of augmentation experiment results are presented in appendix c. the best augmented model's results, which benefits from augmentation in the gid and neuralr components, are also presented in the results of our best models on the test sets of apgc v2.1 and apgc v1.0 are presented in ## conclusion and future work we defined the task of gender rewriting in contexts involving two users (i and/or you), and developed a multi-step system that combines the positive aspects of both rule-based and neural rewriting models. our best models establish the benchmark for this newly defined task and the sota for a previously defined first person version of it. we further demonstrated a use case of our gender rewriting system by post-editing the output of a commercial mt system to provide personalized outputs based on the users' grammatical gender preferences. in future work, we plan to explore the use of other pretrained models, and to work on the problem of gender rewriting in other languages and dialectal varieties.