Semi-Supervised Topic Modeling for Gender Bias Discovery in E nglish and S wedish (2020)

Abstract: Gender bias has been identified in many models for Natural Language Processing, stemming from implicit biases in the text corpora used to train the models. Such corpora are too large to closely analyze for biased or stereotypical content. Thus, we argue for a combination of quantitative and qualitative methods, where the quantitative part produces a view of the data of a size suitable for qualitative analysis. We investigate the usefulness of semi-supervised topic modeling for the detection and analysis of gender bias in three corpora (mainstream news articles in English and Swedish, and LGBTQ+ web content in English). We compare differences in topic models for three gender categories (masculine, feminine, and nonbinary or neutral) in each corpus. We find that in all corpora, genders are treated differently and that these differences tend to correspond to hegemonic ideas of gender.

## introduction as machine learning (ml) models are increasingly applied in ways that affect our lives in significant ways, their fairness becomes a societal concern. over the last few years, a number of highly publicized scandals have occurred. for example, @xcite reports on amazon's problems with a recruiting tool that turned out to be biased against women, while @xcite describes how google translate tended to translate gender neutral pronouns into e.g. masculine ones for engineers, but feminine ones for nurses. if we are to continue using ml models for decision making, it is crucial that we develop methods for ensuring their fairness. when we say that we want a fair ml model, it is not always clear what we mean. from a gendertheoretical perspective, fairness is typically understood in relation to structural frameworks of power asymmetries, see, e.g., @xcite . various technical definitions of fairness exist in computer science, and which definition is appropriate may vary by application, complicating what it means to "not include" biased data; see, e.g., @xcite . we believe that in the long run, methods and tools from the humanities and social sciences will be a necessary complement to mathematics and statistics in our quest for fair natural language processing (nlp) systems. the current work is a small step in this direction. ml models are trained using data produced by humans, such as medical diagnoses, image labels, and written text. as a natural consequence, these data generally reflect our society, including our biases and stereotypes @xcite . in fact, the data does not only reflect biases and stereotypes; it also contributes to shaping them (discussed in section 1.1). there are two general approaches for analyzing and mitigating bias in the models: focusing on either the training data or the models themselves. (for a more fine-grained description of the approaches, see, e.g., @xcite .) both approaches have their merits, but in this article we focus on the former as we believe understanding injustices in the data will help practitioners make more appropriate choices when training models. more specifically, we look at text corpora of the kind often used to train nlp models and explore the possibility of using latent dirichlet allocation (lda) @xcite topic modeling (tm) to investigate gender bias in such corpora. a topic model is a statistical generative model that, during training, can be said to "discover" a set of topics implicitly underlying the documents in the corpus. it has previously been noted that, due to stereotypes and representational issues in the training data, some of the topics tend to be gendered, in the sense that they represent traditionally masculine or feminine aspects of life @xcite . our aim is to further investigate this potential for discovering gendered topics. to be able to more clearly find what words are associated with different genders, we make use of semisupervised tm (see, e.g., @xcite ). this means that some topics are seeded with gendered words, forcing the training procedure to treat these words as belonging to the same, explicitly gendered, topic. in addition, we use unsupervised tm to explore which topics are implicitly gendered. after training the models, we manually inspect the results, looking first at the top 50 words of each topic and their respective weights, and then looking at the top 20 in more depth. this involves using a qualitative, rather than a purely quantitative approach. we argue that this is an advantage because bias and prejudice are complex, context-dependent concepts, and a purely quantitative approach does not lend itself to a complete understanding of the situation. ## methods we used semi-supervised tm to find explicitly-gendered topics in order to explore the differences in what words and concepts women, men, and nonbinary (or, in cases with low representation, "neutral") people are associated with. we trained these topic models using two different sets of seed words across three corpora, for 15 topics at sentence-level "documents." we also trained a baseline, unsupervised topic model for each corpus, which we use to explore implicitly-gendered topics. one key aspect of our approach was our use of qualitative analysis to interpret our topics. ## results ## discussion semi-supervised topic modeling seems to do a decent job of exposing the differences in treatment of gender in the text corpora we tested, suggesting it is indeed an appropriate method for discovering bias in data before it is used to train a biased model. we found evidence of gendered differences emblematic of structural power divides in all three corpora. women tend to be strongly associated with the "home" (family, relationships) and communication; while men are more varied and nonbinary people are nearly invisible in "mainstream" contexts. generally, this method constitutes a "middle ground" where we escape some limitations of purely quantitative metrics (e.g. understanding how representational harms manifest, rather than merely confirming the existence of expected biases) but still must reckon with others (e.g. the required subjective reading may overlook unexpected biases). we plan to expand this method, for example to include guidelines for qualitative analysis with an eye to structures of power borrowed from feminist research methods. the models we trained require qualitative analysis in the form of human reading to interpret. this is a benefit, as it requires us to think through the how and why of these differences, but can also leave us with lingering questions. for example, we found a very strong theme of christianity and death in the masculine topic for the qe corpus, but without further examination we cannot tell if this association with christianity is positive (affirming ministry, messages of acceptance) or negative (condemnation, homophobia). contrary to our expectations, we did not find a connection between women and appearance in any of our corpora -this may be due to genre (not many "lifestyle" articles) but again would require further examination to determine a cause. additionally, tm is not fully deterministic, so there can be some question of the reliability of the results across corpora. it might have been interesting to e.g. train one model for both the english corpora and then investigate them separately, and this may be an angle for future research. this behavior may also be an advantage for more involved investigations, as training multiple models on the same data with different random seeds could provide different "points of view" from which to investigate the corpus and allowing us to triangulate a more complete picture. this potential should also be investigated in future work. more work is necessary to establish whether tm can help us "debias" corpora, e.g. by identifying and removing strongly-biased texts from the corpus. a natural next step in the line of research presented here is to use the semi-supervised topic models to classify documents and investigate how well this method does at identifying stereotypical writing. tm is relatively computationally cheap, making it an attractive first step in understanding the potential consequences of training a model on a given dataset. most work on bias in text so far deals only with gender and considers gender to be a binary category system. we want to contribute to more nuance by working with a nonbinary definition of gender and with a greater focus on intersectionality. this is important since research both in the humanities and in the sciences has shown that focus on only one category, such as gender, can hide prejudice against, for example, women of color; see, e.g., @xcite . english and swedish mark gender grammatically through third person pronouns and semantically in certain nouns (mother, father, parent), but there is no equivalent explicit marking for other aspects of identity such as race or class, meaning different strategies must be undertaken to discover intersectional associations. our technique similarly may not generalize to languages which do not mark gender in this way (e.g. finnish, which has no gendered third person pronouns), or which have noun cases with grammatical gender (e.g. french or german). although we make some progress towards better capturing fluid and multi-faceted understandings by expanding our fixed data categories of "gender" to include a third option, this remains an unsatisfactory solution as it fails both to separate nonbinary individuals from a group or generic (in the case of english they) and to provide an intersectional view of different experiences of gender within these three categories. as @xcite describes such a three-category practice, it "transgresses a rigid binary, yet falls short of a fluid spectrum, positioning ... somewhere in-between". it remains an open question how to tackle these issues in practical nlp research.