A Comparative Study on Word Embeddings and Social NLP Tasks (2022)

Abstract: In recent years, gray social media platforms, those with a loose moderation policy on cyberbullying, have been attracting more users. Recently, data collected from these types of platforms have been used to pre-train word embeddings (social-media-based), yet these word embeddings have not been investigated for social NLP related tasks. In this paper, we carried out a comparative study between social-media-based and non-social-media-based word embeddings on two social NLP tasks: Detecting cyberbullying and Measuring social bias. Our results show that using social-media-based word embeddings as input features, rather than non-social-media-based embeddings, leads to better cyberbullying detection performance. We also show that some word embeddings are more useful than others for categorizing offensive words. However, we do not find strong evidence that certain word embeddings will necessarily work best when identifying certain categories of cyberbullying within our datasets. Finally, We show even though most of the state-of-the-art bias metrics ranked social-media-based word embeddings as the most socially biased, these results remain inconclusive and further research is required.

## introduction distributional word representations have been successfully used for many nlp tasks. some of these word embeddings were pre-trained on news articles like word2vec @xcite or wikipedia articles like glove @xcite . we use the term "informational-based" to describe these word embeddings. in recent years, there have been new word embedding models pre-trained on more informal text corpora like twitter, 4&8 chan and urban dictionary. we use the term "socialmedia-based" to describe those word embeddings. these informal sources contain linguistic diversity, racial slurs and forms of profanity that do not exist in formal text @xcite . however, these social-media-based word embeddings have not been investigated for social nlp related tasks like cyberbullying detection and social bias analysis. our intuition that social-media-based word embeddings could be better at detecting cyberbullying comes from the examples shown in in this paper, we compared static word embeddings based on the datasets they were pre-trained on and not models that were used to pre-train them e.g. skip-gram. while using one model to pretrain all word embeddings on different pre-training datasets would directly show the impact of the source datasets for a particular word embedding training method, we focus our work on analyzing existing, publicly released word embeddings which are often used in other downstream tasks in order to better understand the impact of using these embeddings. we examined static word embeddings instead of contextual word embeddings as they are still widely used in nlp tasks and there have not been any released contextual word embeddings pretrained on datasets like urban dictionary or chan, and pre-training these models from scratch is computationally expensive. we set out to answer the following research questions: 1) what is the performance of the different word embeddings on offences categorisation?. 2) what is the performance of the different word embeddings on the task of cyberbullying detection? can we use certain word embeddings to detect certain offensive categories within cyberbullying-related datasets? 3) are socialmedia-based word embeddings more socially biased than informational-based word embeddings? to answer the first research question, we used the different word embeddings to categorize terms from a popular lexicon of english offensive language. then we compared the performance of the social-media-based word embeddings and the informational-based word embeddings using statistical significance tests. answering our first research question should help in finding out whether social-media-based word embeddings are significantly better than informational-based word embeddings at learning the semantic relationship between terms that belong to the same group of offences. we answer our second research question through a series of experiments where we used each word embedding to automatically detect cyberbullying in cyberbullying-related datasets and to detect different types of cyberbullying within each dataset. we used a statistical significance test to compare the performance of the social-media-based word embeddings and the informational-based word embeddings. answering the second research question will help us to find out if social-media-based word embeddings improve the performance on the task of cyberbullying detection in comparison to informational-based word embeddings and to find out the ability of certain pre-trained word embeddings to detect certain types of cyberbullying. finally, to answer our last research question and to find out which word embeddings are more socially biased, we used the state-of-the-art metrics from the literature to measure gender and racial bias in each word embedding and compared the bias scores in the social-media-based word embeddings and the informational-based word embeddings. the contributions of this paper are: (a) we demonstrate that social-media-based word embeddings are better at categorizing offensive words and that social-media-based word embeddings outperform informational-based word embeddings on cyberbullying detection. (b) our findings show no evidence that certain word embeddings are better than others at detecting certain offensive categories within the examined cyberbullying-related datasets. (c) our results show no strong evidence that socialmedia-based word embeddings are more socially biased than informational-based word embeddings. we share our code with the community to reproduce our results and allow more investigation † . ## related work recent word embeddings pre-trained on data from social media platforms have been released in the community. for example, urban dictionary word embeddings that was pre-trained on words and definitions from the urban dictionary website @xcite using the fasttext framework, chan word embeddings that was pre-trained on 4&8 chan websites using continuous bag-of-words algorithm (cbow) @xcite , and a version of glove pre-trained on twitter data @xcite . even though there is evidence from the literature that the data that was used in pretraining these word embeddings contain offensive-ness and racially insensitive comments @xcite , they have not been investigated for social nlp tasks. for example, investigating the impact of social-media-based word embeddings on the task of cyberbullying detection or analysing the social bias in the socialmedia-based word embeddings. using social-media-based word embeddings could improve cyberbullying detection as they may be able to identify some offensive words or forms of profanity that are not captured by informationalbased word embeddings. comparative studies on word embeddings and deep learning models have been done for biomedical natural language processing @xcite and for text classification, @xcite , but there have been very few similar comparative studies for the task of cyberbullying detection. @xcite reviewed the literature on different word embeddings: cbow, skipgram, elmo, glove and fasttext, and then tested them with a neural networks model on hate speech detection task. they show that elmo is the best performing followed by fasttext and glove. however, they do not include social-media-based word embeddings like urban dictionary or chan. @xcite have shown that word embeddings pre-trained on urban dictionary, and twitter outperforms embeddings like word2vec and glove-wikipedia on the task of cyberbullying detection. however, they do not compare the ability of the different word embeddings to categorize offensive words or to detect different categories of offences within cyberbullying datasets. additionally, the research has shown that word embeddings are biased. among the most common methods for quantifying bias in word embeddings are the word embedding association test (weat), the relative norm distance (rnd), the relative negative sentiment bias (rnsb), and the embedding coherence test (ect). for the weat metric, the authors were inspired by the implicit association test (iat) to develop a statistical test to demonstrate human-like biases in word embeddings @xcite . they used the cosine similarity and statistical significance tests to measure the unfair correlations for two different demographics, as represented by manually curated word lists. as for the rnd metric, the authors used the euclidean distance between neutral words, like professions, and a representative group vector created by averaging the word vectors for words that describe a word embedding pre-training data type word2vec google news articles informational-based glove-wikipedia wikipedia articles informational-based glove-twitter twitter messages social-media-based chan text from 4&8 chan social-media-based urban dictionary text from urban dictionary social-media-based ## cyberbullying detection in the light of our earlier results presented in figure 2 , we make two hypotheses: (1) social-mediabased word embeddings will perform better than informational-based embeddings on the task of cyberbullying detection. (2) certain word embeddings will perform better at detecting certain offensive categories within our cyberbullying-related datasets. specifically, we expect that urban dictionary embeddings might perform the best on the examples in the datasets containing ps, om, pr, asf, asm, ddp and ddf categories; word2vec embeddings to perform the best on examples containing re and qas; and for the cds category, we expect all the models to perform similarly. to test our hypotheses and answer our second research question, we compared the performance of the different word embeddings when used to initialize the embedding layer of a deep learning model trained on the following datasets. ## social bias in this section, we answer our third research question by measuring the social bias in the different word embeddings. we studied two types of social bias: gender bias and racial bias. we hypothesise that social-media-based word embeddings, especially urban dictionary and chan, are more socially biased than informational-based based word embedding. we used the wefe framework @xcite to measure the gender bias and the racial bias in the different word embeddings using the state-of-the-art bias metrics from the literature: weat, rnsb, rnd, and ect. to measure the gender bias, we follow the methodology proposed in the original paper @xcite using the wefe framework @xcite . we used two target lists: target list 1, which contains female-related words (e.g., she, woman, and mother), and target list 2, which contains malerelated words (e.g., he, father, and son), as well as two attribute lists: attribute list 1, which contains words related to family, arts, appearance, sensitivity, stereotypical female roles, and negative words, and attribute list 2, which contains words related to career, science, math, intelligence, stereotypical male roles, and positive words. then, we measured the average gender bias scores across the different attribute lists for each word embedding using the various metrics. since the different metrics use different scales, we follow the work suggested in @xcite to rank the bias scores for each word embedding in ascending order, except for the ect metric that was ranked in descending order, as ect scores have an inverse relationship with the level of bias. similarly, to measure the racial bias we follow the methodology proposed in @xcite using the wefe framework. we used two target groups: target group 1, which contains white people's names, and target group 2, which contains african, hispanic, and asian names, and two attribute lists: attribute list 1, which contains white people's occupation names; and attribute list 2, which contains african, hispanic, and asian people's occupations. then, we measured the average racial bias scores across the different attribute lists for each word embedding using the different metrics (weat, rnd, rnsb, ect). finally, we ranked the bias scores. the results reported in ## conclusion the work in this paper was motivated by the release of the new social-media-based word embeddings. we ran a series of experiments to compare socialmedia-based word embeddings and informationalbased word embeddings regarding two social nlp tasks: cyberbullying detection and social bias analysis. we found that social-media-based word embeddings are better than informational-based embeddings at categorizing offensive words. this suggests that social-media-based word embeddings might be useful for expanding queries to collect future cyberbullying datasets. we also found that social-media-based word embeddings performed better at the task of cyberbullying detection than informational-based word embeddings. our results also show that although some word embeddings are better at categorizing offensive words in the hurtlex categories, these same embeddings do not necessarily perform better at detecting the corresponding offensive categories within our datasets. hence, there is no evidence that certain word embeddings are better at detecting certain types of cyberbullying. our results also show that even though the different bias metrics don't agree on the ranking of the word embeddings regarding social bias, most of the bias metrics (rnsb, rnd, and ect) agree that chan and urban dictionary are the highest ranked biased word embeddings regarding gender and racial bias. however, the second highest biased word embeddings is glove-wk which is not socialmedia-based which means that social-media-based word embeddings are not necessarily more socially biased than informational-based word embeddings. our findings raise questions about some common methods currently used to detect cyberbullying and to measure social bias in word embeddings. as our findings show that state-of-the-art bias metrics did not agree on the rankings of the most biased word embeddings. additionally, our findings show that profanity is an important feature that should be used in addition to other features to develop more reliable models to detect cyberbullying and to reveal the social bias in the different word embeddings. future work should investigate the relationship between the bias in the word embedding and the performance of these word embeddings on cyberbullying detection.