The growing number of applications based on semantic text analysis is making automatic natural language understanding a key topic of artificial intelligence. Language models are used for a variety of tasks, such as parsing CVs, improving web search results, or detecting harmful comments on social media. At the same time, research on bias and fairness in language models is growing rapidly, due to concerns about the internal representation of social minorities and discriminated groups. Word embeddings, a popular framework to represent words as vectors, have been shown to reflect social stereotypes. In particular, they exhibit a large amount of gender bias, as literature named the phenomenon of internalising gender stereotypes. Gender bias is estimated by the cosine similarity between vectors of gender neutral words and a gender direction. Recently, sentence embeddings have been introduced as a novel and powerful technique to represent sentences as vectors. However, gender bias cannot be measured directly for sentence vectors, because gender neutral sentences cannot be listed a priori. In this thesis we propose a new metric to estimate gender bias in sentence embeddings, called bias score. Our solution is based on neural networks to capture the semantic importance of individual words, and it is able to discern between correct and biased gender information at the sentence level. Bias score allows to identify and remove the more stereotypical entries in text corpora used to train language models. In turn, models trained from fairer corpora prove to be less stereotyped, without losing quality in downstream tasks. Moreover, we leverage the same intuition to detect gender stereotypes and anti-stereotypes, showing that gender bias can also be used successfully in the context of hate-speech detection.

Il crescente numero di applicazioni basate sull’analisi semantica del testo ha reso la comprensione automatica del linguaggio naturale un argomento chiave nel campo dell’intelligenza artificiale. I modelli di linguaggio sono utilizzati per vari compiti, come il parsing dei curricula, la ricerca web, o l’individuazione di commenti nocivi sui social media. Al tempo stesso, la ricerca su bias e fairness nei modelli di linguaggio sta crescendo velocemente, vista la preoccupazione per la rappresentazione interna delle minoranze sociali e delle categorie sociali sovente discriminate. I word embeddings, un framework molto popolare per rappresentare le parole in forma di vettori, hanno dimostrato di rispecchiare gli stereotipi della società. In particolare, presentano un’ingente quantità di gender bias, il nome dato in letteratura al fenomeno di incapsulamento degli stereotipi di genere. Il gender bias è stimato dalla somiglianza del coseno tra i vettori di parole neutrali e una direzione che identifica il genere. Recentemente, sono stati introdotti i sentence embeddings, una nuova e potente tecnica per rappresentare le frasi in forma di vettori. Tuttavia, il gender bias non può essere misurato direttamente per i sentence embeddings, perché le frasi neutrali non possono essere identificate a priori. In questa tesi proponiamo una nuova metrica per stimare il gender bias nei sentence embeddings. La nostra soluzione si basa su reti neurali per catturare l’importanza semantica delle singole parole, ed è in grado di distinguere a livello di frase le informazioni di genere corrette da quelle derivate dal gender bias. La nostra metrica permette inotre di individuare e rimuovere le voci più stereotipate nei corpus di testo usati per il training di modelli linguistici. Questi modelli risultano a loro volta più etici, se il corpus usato per il training è meno stereotipato. Inoltre, sfruttiamo la stessa intuizione per individuare frasi con stereotipi di genere, dimostrando che il gender bias può essere utilizzato positivamente anche nel campo dell’hate-speech detection.

Estimating gender bias in sentence embeddings

Dolci, Tommaso
2020/2021

Abstract

The growing number of applications based on semantic text analysis is making automatic natural language understanding a key topic of artificial intelligence. Language models are used for a variety of tasks, such as parsing CVs, improving web search results, or detecting harmful comments on social media. At the same time, research on bias and fairness in language models is growing rapidly, due to concerns about the internal representation of social minorities and discriminated groups. Word embeddings, a popular framework to represent words as vectors, have been shown to reflect social stereotypes. In particular, they exhibit a large amount of gender bias, as literature named the phenomenon of internalising gender stereotypes. Gender bias is estimated by the cosine similarity between vectors of gender neutral words and a gender direction. Recently, sentence embeddings have been introduced as a novel and powerful technique to represent sentences as vectors. However, gender bias cannot be measured directly for sentence vectors, because gender neutral sentences cannot be listed a priori. In this thesis we propose a new metric to estimate gender bias in sentence embeddings, called bias score. Our solution is based on neural networks to capture the semantic importance of individual words, and it is able to discern between correct and biased gender information at the sentence level. Bias score allows to identify and remove the more stereotypical entries in text corpora used to train language models. In turn, models trained from fairer corpora prove to be less stereotyped, without losing quality in downstream tasks. Moreover, we leverage the same intuition to detect gender stereotypes and anti-stereotypes, showing that gender bias can also be used successfully in the context of hate-speech detection.
AZZALINI, FABIO
ING - Scuola di Ingegneria Industriale e dell'Informazione
23-lug-2021
2020/2021
Il crescente numero di applicazioni basate sull’analisi semantica del testo ha reso la comprensione automatica del linguaggio naturale un argomento chiave nel campo dell’intelligenza artificiale. I modelli di linguaggio sono utilizzati per vari compiti, come il parsing dei curricula, la ricerca web, o l’individuazione di commenti nocivi sui social media. Al tempo stesso, la ricerca su bias e fairness nei modelli di linguaggio sta crescendo velocemente, vista la preoccupazione per la rappresentazione interna delle minoranze sociali e delle categorie sociali sovente discriminate. I word embeddings, un framework molto popolare per rappresentare le parole in forma di vettori, hanno dimostrato di rispecchiare gli stereotipi della società. In particolare, presentano un’ingente quantità di gender bias, il nome dato in letteratura al fenomeno di incapsulamento degli stereotipi di genere. Il gender bias è stimato dalla somiglianza del coseno tra i vettori di parole neutrali e una direzione che identifica il genere. Recentemente, sono stati introdotti i sentence embeddings, una nuova e potente tecnica per rappresentare le frasi in forma di vettori. Tuttavia, il gender bias non può essere misurato direttamente per i sentence embeddings, perché le frasi neutrali non possono essere identificate a priori. In questa tesi proponiamo una nuova metrica per stimare il gender bias nei sentence embeddings. La nostra soluzione si basa su reti neurali per catturare l’importanza semantica delle singole parole, ed è in grado di distinguere a livello di frase le informazioni di genere corrette da quelle derivate dal gender bias. La nostra metrica permette inotre di individuare e rimuovere le voci più stereotipate nei corpus di testo usati per il training di modelli linguistici. Questi modelli risultano a loro volta più etici, se il corpus usato per il training è meno stereotipato. Inoltre, sfruttiamo la stessa intuizione per individuare frasi con stereotipi di genere, dimostrando che il gender bias può essere utilizzato positivamente anche nel campo dell’hate-speech detection.
File allegati
File Dimensione Formato  
Estimating Gender Bias in Sentence Embeddings.pdf

accessibile in internet per tutti

Descrizione: Tommaso Dolci - Estimating Gender Bias in Sentence Embeddings
Dimensione 1.91 MB
Formato Adobe PDF
1.91 MB Adobe PDF Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/177248