Professional Documents
Culture Documents
s13278-024-01303-z
s13278-024-01303-z
https://doi.org/10.1007/s13278-024-01303-z
ORIGINAL ARTICLE
Abstract
In this paper, we investigate the phenomenon of homophily in hate speech generation on Twitter, aiming to deepen our
understanding of online hate dynamics. Given the vast amount of information available on Twitter, computing familiarity
and similarity–essential for discovering homophily–poses significant challenges. To address this, we introduce novel meas-
ures for computing familiarity and similarity on the platform. Hate speech on social media can manifest in various forms,
including hate against gender, race, ethnicity, politics, and nationalism. Consequently, we propose methods to detect multiple
forms of hate speech. Utilizing an empirical dataset from Twitter, we demonstrate the prevalence of homophily and explore
its variations across different categories of hate speech.
Vol.:(0123456789)
138 Page 2 of 16 Social Network Analysis and Mining (2024) 14:138
the strength of the homophilic phenomenon for different familiarity between pairs can lead to improved performance
types of hate such as, hate against gender, race and nation. in tasks such as link prediction and recommendation.
Familiarity and similarity are the two essential factors in Hate speech on social media can take on various types,
homophily. Familiarity captures the phenomenon of users such as hate against gender, race, ethnicity, politics and
becoming friends with (or, following) other users. The fea- nationalism. Identifying these hateful classes is crucial in
ture to become friends or follow other users is a signal of mitigating the spread of hate speech on social media. Tra-
familiarity. While the content produced, profile information ditional methods, such as clustering-based unsupervised
or any other meta-data information present are signals for approaches and Latent Dirichlet Allocation (LDA), have
similarity computation. been developed to detect different forms of hate. However,
Similarity computation is not straightforward due to the these methods have been found to have limitations in deter-
myriad of information available about users on social media mining the number of topics, interpreting topics, and captur-
platforms. We believe the similarity between a pair of users ing context and temporal dynamics. To address these issues,
should take multiple aspects of the content generated in we propose two complementary automated techniques and
addition to meta-data for the profiles. The multiple aspects methods to detect various hateful forms in a tweet corpus.
we explore in this paper are semantic, syntactic, stylometric The first approach involves using Task Aware Representa-
and topical. We empirically investigate homophily along tion of Sentences (TARS) (Halder et al. 2020) based clas-
with the multiple aspects of hate speech generation. We use sification for few-shot learning to detect hateful forms, par-
word embeddings to compute semantic features for a user. ticularly in cases where corpora lack labels. This approach
The word embeddings are aggregated in a time-decaying enables the system to learn from a small set of labelled
manner to get a complete semantic representation of the examples, making it particularly useful for detecting new
user-generated content. We utilize the important features and emerging forms of hate speech.
needed in authorship attribution (Bhargava et al. 2013) and In the second approach, we use hashtags to detect hate-
some other features designed by us to derive syntactical and ful forms. Hashtags have emerged as a powerful tool for
stylometric features. Additionally, we also include readabil- categorizing tweets and associating them with specific top-
ity (Kincaid 1975) related features. Lastly, we unearth the ics or events. Hashtags can provide valuable insights into
hidden thematic structure of a document along topics and the underlying topics and events that drive hateful con-
categories in two ways, (a) using latent topic modelling to tent. In our proposed automated technique, we first iden-
construct a topic affinity vector and (b) categories using tify seed hashtags for each hateful form and then expand
Empath (Fast et al. 2016) to construct category score vector. these hashtags to include other relevant hashtags. We use
The familiarity between pairs is another critical aspect of the expanded hashtags to identify the hateful forms label
homophily computing and is measured by how well users for each tweet.
know each other. Social media platforms use social network These two methods complement each other and can pro-
graphs consisting of nodes and edges to capture familiarity. vide more comprehensive coverage of detecting various
Relationships can be directed or undirected depending on forms of hate speech. The few-shot learning approach using
whether mutual consent is required. Traditional familiarity Task Aware Representation of Sentences (TARS) is useful
computations rely on explicit features such as edge exist- when labelled data is scarce or unavailable. It can effectively
ence or mutual friend count, but figuring out what to use for learn from a small set of labelled examples and adapt to
familiarity computation is time-consuming and experimen- new and emerging forms of hate speech. This approach can
tal (Dey et al. 2018). Graph embedding-based techniques, be particularly helpful in identifying previously unknown
such as deep learning-based graph neural networks (GNNs), or unclassified forms of hate speech. On the other hand,
have gained significant attention for encoding nodes in a the hashtag-based approach can provide valuable insights
vector latent space and aggregating feature information into the underlying topics and events that drive hateful con-
from local neighbours via neural networks. Unlike previ- tent. By identifying the hashtags associated with different
ous graph embedding models, GNNs aggregate feature forms of hate speech, we can understand the motivations
information from the node’s local neighbours, enabling bet- and ideologies behind hate speech. Moreover, combining
ter representation of the rich neighbourhood information these two approaches can provide a more comprehensive
(Gao et al. 2018; Hamilton et al. 2017; Kipf and Welling and accurate identification of hateful forms. The few-shot
2016a; Liu et al. 2018; Schlichtkrull et al. 2018; Veličković learning approach can identify new and emerging forms of
et al. 2017). We propose using graph convolution network hate speech, while the hashtag-based approach can provide
(GCN) based embedding called variation graph autoencod- insights into the underlying motivations and topics driving
ers (VGAE) (Kipf and Welling 2016b) to capture familiar- the hate speech. Overall, proposing two different approaches
ity. The VGAE-based embedding has shown effectiveness in for detecting hateful forms provides a more flexible and
various downstream tasks, and its application to capturing comprehensive approach to detecting hate speech on social
Social Network Analysis and Mining (2024) 14:138 Page 3 of 16 138
q(zi X, A) = N(zi _ −�� 𝜇i , diag(𝜎i2 )) (6) 3 Defining novel metrics for similarity
computation
Decoder
The decoder, as part of the generative model, is repre- We propose that the calculation of similarity on social
sented by the inner product of the latent variable Z and its media platforms should consider various aspects of a
transpose Z T . The result of this operation, specified in Eq. 8, user, beyond just direct textual similarity. These aspects
is then reconstructed as the adjacency matrix  as specified could include a user’s profile information, writing-related
in Eq. 7. The logistic sigmoid function 𝜎() is also utilized in nuances such as stylometry, the content generated, and
this process. To summarize, the decoder can be represented topics discussed, among others. Using a Twitter dataset,
mathematically as given in Eq. 8. we demonstrate that homophily exists in the generation of
hate speech along all aspects considered in the similarity
 = 𝜎(ZZ T ) (7) computation. Therefore, highlighting the importance of
considering multiple aspects of a user when evaluating
p(Aij = 1‖zi , zj ) = 𝜎(zTi zj ). (8) similarity, as it offers a more comprehensive understand-
ing of the dynamics of hate speech and could lead to an
Loss in VGAE improvement in detection accuracy.
The loss function for the Variational Graph Autoencoder
(VGAE) is composed of two parts. The first part, referred 3.1 Features for similarity computation
to as the variational lower bound, evaluates the accuracy of
the network’s reconstruction of the data and is modelled as We propose various features to capture the nuances of
the binary cross-entropy between the input and output. The the content generated by a user on online social media
second part, called KL-divergence, measures the similar- platforms. The features are capable of capturing similar-
ity between q(Z ∣ X, A) and p(Z) = N(0, 1). KL-divergence ity along semantic, syntactic, stylometric, and topical
compares the approximation q(Z ∣ X, A) to the true posterior dimensions.
p(Z). The loss function is described in Eq. 9. Algorithm 1 Computing Semantic Features fora User
L = Eq(Z‖X,A [logp(A‖Z)] − KL[q(Z‖X, A)��p(Z)] (9)
Input: User u, Set of Posts P = {p1 , p2 , ..., pM }
with timestamps
2.2 Computing familiarity Output: Semantic Embedding S (u) of the user
1: Compute time span of P as T
The concept of familiarity between a pair of users is deter- 2: Divide T into time-windows T =
mined by calculating the distance between them in the {tn , tn−1 , tn−2 , ..., t1 } of size one week where
graph embedding space. The inverse relationship between
n are the total number of weeks and t1 is the
distance and familiarity is assumed, where lower distances
most recent week
correspond to higher levels of familiarity. To compute the
3: for each time window t in T do
familiarity, existing distance measures are employed, includ-
4: Compute weight(tk ) = 1/k
ing Cosine distance, Manhattan distance, and Euclidean dis-
5: end for
tance. The metrics between two users, u1 and u2, are formally
6: for each post p in P do
defined in Eqs. 10 to 12.
Let ū1 and ū2 represent graph embedding of the users u1 7: for each word w in p do
and u2 respectively. 8: Compute word embedding E (w) using
Glove
(ū1 ⋅ (ū2 ) 9: Compute tweet embedding E (p) as
Cosine Similiarity(u1, u2) = (10)
||ū1 || ⋅ ||ū2 || mean of word embeddings E (w)
10: end for
� n �1∕p 11: Find weight W (p) for p using weight for
�
Manhattan Distance(u1, u2) = ‖xi − yi ‖p
(11) the time windows it falls in
i=1 12: end for
13: Compute user semantic embedding S (u)
√
√ n 14: S (u) = i E (pi ) ∗ W (p)/P
√∑
Euclidean Distance(u1, u2) = √ (xi − yi )2 (12)
i=1
138 Page 6 of 16 Social Network Analysis and Mining (2024) 14:138
In our approach, user-generated content is represented Moreover, to further understand the readability of a user’s
through the use of word embeddings, where each post writing style, we compute the Flesch–Kincaid Reading Ease
is transformed into a vector representation. The seman- score for each user. To do this, we first create a document
tic embedding of a user is obtained by aggregating the d for each user u by combining all the tweets, as described
post embeddings using a weighted mean pooling method. in Eq. 13. We then use the Flesch-Kincaid Reading Ease
This aggregation methodology is inspired by the work in formula (Kincaid 1975) to compute the readability score for
Rajadesingan et al. (2015), where the authors emphasize each user. This helps us capture the ease of understanding of
the significance of incorporating the temporal aspect in a user’s writing style, which can provide useful information
user-generated content. Our implementation of time- in understanding the dynamics of hate speech.
decaying aggregation accounts for two crucial factors:
the activity level of the user and the relevance of recent
posts compared to older ones. The tweets are divided into 3.2.1 Topical features
time buckets of one week and assigned weights inversely
proportional to their temporal position. The details In order to compute the topic features, we utilize two meth-
of the time-decay-based aggregation are described in ods. The first method involves performing topic modelling
Algorithm 1." on the user-generated content. The second method involves
using the methodology proposed in Fast et al. (2016) to con-
3.1.2 Syntactic features struct the Empath category scores vector.
For the first method, we employ latent topic modelling
The syntactic features of the user’s tweets play an important techniques called Latent Dirichlet Allocation. The result of
role in understanding the user’s writing style and language the topic modelling is the latent affinity of each user to vari-
use. In order to capture this information, we use the impor- ous topics, which is then used to construct a topic vector for
tant features proposed in the study of Rajadesingan et al. each user. For the second method, we utilize the Empath
(2015) and some additional features designed by us. These library (Fast et al. 2016) to construct the Empath category
features are used to compute a syntactical feature vector to scores vector. The Empath library allows for the computa-
represent the user. The features include the number of capi- tion of a fixed-length vector of category scores that represent
tal words, question marks, exclamations, numbers, URLs, a text document. The categories include emotions, objects,
user mentions, hashtags, and emojis present in a tweet. To events, and more, and capture the content and style of a
obtain the syntactic feature vector for a user, these features user’s writing. The result of this method is a topic vector that
are calculated for each tweet made by the user and then aver- captures the diverse topics discussed by a user.
aged over all the tweets. This provides a comprehensive
understanding of the user’s language use and writing style.
The resulting feature vector can be used as input for further
analysis and modelling tasks.
4 Hateful forms detection using TARS
3.2 Stylometric and readability features
We propose to use Task-aware representation of sentences
(TARS) to detect hateful forms. TARS is introduced by
In the field of authorship attribution, there have been several
Halder et al. (2020) as a simple and effective method for
important features proposed to detect the author of a piece of
few-shot and even zero-shot transfer learning for text clas-
content. In our work, we incorporate these features in cap-
sification. It means we can classify text without (m)any
turing the writing style of a user. Specifically, we adopt fea-
training examples. The pre-trained TARS model can be
tures proposed in Bhargava et al. (2013) and Rajadesingan
used as-is but providing a handful of training examples
et al. (2015). These features include the number of words
improves its performance. TARS pre-trained model can
per tweet, the number of sentences per tweet, the number of
easily be extended to learn new classes remarkably well by
elongated words per tweet, the number of repeated words per
using only a handful of training samples. We supply a few
tweet, and the word length distribution. The latter is a vector
training samples to fine-tune TARS for each hateful form.
of length 19, where each element represents the frequency of
The core idea behind TARS is that it reformulates the
words of a particular length. Additionally, we compute the
text classification problem as a "query". In this query, the
mean, median, and standard deviation of the word length
transformer receives both a sentence and a potential class
distribution.
Social Network Analysis and Mining (2024) 14:138 Page 7 of 16 138
label, and it predicts whether or not the label holds. The analyze a set of tweets that are labelled as hateful and
cross-attention mechanism in the transformer learns to identify the hashtags that are commonly used in these
combine the representation of the text and the label, and tweets.
this allows for the transfer of the full model. The advantage Manual grouping of the hashtags into various hateful
of TARS over previous models is that it preserves both the forms We then group the identified hashtags into the five
decoder layer and the semantic information present in the different categories based on the hateful forms they rep-
natural language task class labels. This results in the same resent, such as hate against race, sex, and communities.
decoder being used across arbitrary tasks and the informa- Automated expansion of hashtags for individual hateful
tion provided by the class label being interpreted by the form Finally, we employ automated expansion techniques
transformer model. Furthermore, TARS has the capability to identify other hashtags related to each hateful form.
to return predictions even for classes that have no training
data. This is possible because the textual label of the new
class is prepended to the text and the result of the "True/ 5.1 Automated expansion of hashtags for hateful
False" decoder is evaluated. form
Algorithm 2 Identification of Hateful Hashtags or not. However, annotating 19M tweets is a costly and time-
consuming process, so only a subset of tweets is annotated.
1: Step 1: Manual identification of hateful hash- Accurate annotations are vital for uncovering homophily in
tags hate speech on social media platforms. Thus, we designed
2: Analyze a set of tweets labelled as hateful and the annotation process, in two phases:
identify commonly used hashtags
3: Step 2: Manual grouping of hashtags into 1. Phase 1 Selection of the initial set of users and their
different categories tweets for annotation.
4: Group the identified hashtags into five cate- 2. Phase 2 Manual annotation of the tweets selected in
gories based on the hateful forms they repre- Phase 1.
sent
5: Step 3: Automated expansion of hashtags Phase 1: user and tweet selection
6: Compute tweet embeddings To select the most suitable tweets for annotation, we care-
7: Detect the polarity of each tweet fully selected a subset of users, including the 544 hateful
8: Assign polarity to each hashtag based on the users and another approximately 20, 000 users based on their
polarity of tweets it is present in degree in the retweet network. All tweets from these users
were considered for manual annotation. Users and tweets
9: Encode negative polarity hashtags using
were further filtered based on the following criteria:
tweets of negative polarity
10: Expand hashtags for each individual hateful
• Only users who posted in English were selected.
form based on similarity in the hashtag space
• Only tweets with a length greater than 10 characters were
using a clustering algorithm
selected to ensure proper sentence structure.
• The number of tweets per user was capped at 10, result-
ing in approximately 10 tweets per user with a length of
at least 10 characters.
6 Dataset preparation This phase yielded a total of 30, 720 tweets to be annotated.
The filtered retweet network had 771, 401 edges and 18, 642
In this section, we describe the dataset used and its modifica- nodes. This systematic approach to tweet selection helped to
tions for evaluating the proposed research questions. ensure the accuracy and reliability of the annotations, which
are crucial in uncovering homophily in hate speech on social
media platforms.
6.1 Dataset details
Phase 2: annotation
We use the hate speech dataset provided by Ribeiro et al. In Phase 2, the annotation process was carried out system-
(2017). This dataset contains 200 most recent tweets of atically and thoroughly to ensure high-quality results. Three
100, 386 users, totalling around 19M tweets. It also contains annotators with undergraduate degrees manually annotated
a retweet-induced graph of the users. The retweet-induced each tweet. The annotators were provided with the following
graph is a directed graph G = (V, E) where each node u ∈ V definition of hate speech: "Any speech that is intended to
represents a user in Twitter, and each edge (u1, u2) ∈ E rep- degrade, intimidate, or incite violence or prejudicial action
resents that the user u1 has retweeted user u2. Furthermore, against a particular person or group of people based on their
every tweet is categorized as an original tweet, retweet, or race, ethnicity, national origin, religion, sexual orientation,
quote (retweet with a comment). Out of the 100, 386 users, gender identity, or other characteristics." The annotators
labels (hateful or normal) are available for 4, 972 users, out were instructed to annotate only the text of the tweets, with-
of which 544 users are labelled as hateful and the rest as out considering any accompanying media or user informa-
normal. We perform pre-processing techniques suitable for tion. A binary label was used to indicate whether a tweet
tweets, including removing links, converting emoticons to was classified as hateful or not. In total, 27.5% of annotated
text, and removing non-ASCII characters." tweets were classified as hateful. To ensure the quality of
the annotation, we calculated the inter-annotator agreement
6.2 Dataset labelling at binary label (hateful or not) using Cohen’s kappa coefficient, which measures the level
of agreement between two annotators beyond chance. The
The dataset used in this study lacks labels for tweet content, kappa coefficient for our annotation task was 0.87, indicating
necessitating manual annotation of tweets as either hateful a high level of agreement between the two annotators. Any
Social Network Analysis and Mining (2024) 14:138 Page 9 of 16 138
Table 1 The number of labelled samples and a few seed hashtags for 7 Experiments
each type of hate speech
Form Number of Hashtags 7.1 Experiments overview
Samples
Communalism 29 #jihadi, #islamic, #terrorist The purpose of the experiments is to investigate the follow-
Homophobia 55 #gay, #dyke, #fag ing research questions (RQs) related to hateful speech and
Racism 49 #nigga, #nigger, #paki homophily:
Sexism 142 #cunt, #bitch, #pussy
Xenophobia 79 #nomorenazis, #wolf2, #illegalaliens 1. RQ1 To what extent do individuals who generate hateful
content exhibit homophily?
2. RQ2 How does the newly proposed familiarity metric
compare to existing metrics in effectively identifying
discrepancies in annotation were resolved by discussing and homophily patterns among generators of hateful speech?
reviewing the tweets until a consensus was reached. 3. RQ3 Do patterns of homophily vary across different
types of similarity aspects?
6.3 Dataset labelling at the hateful forms level 4. RQ4 How effective is our proposed TARS-based
approach in detecting different types of hateful forms?
We aim to detect the five most common distinct forms of 5. RQ5 To what extent are the manually identified seed
hate speech, namely racism, sexism, communalism, xeno- hashtags for each hateful form effective, and how does
phobia, and homophobia Davidson et al. (2017). To achieve the proposed hashtag encoding scheme perform?
this, we leverage a few-shot learning approach called TARS 6. RQ6 How well does our hashtag expansion approach
Halder et al. (2020) and hashtags. perform in detecting hateful forms?
To enable few-shot learning for TARS, we manually 7. RQ7 Are certain types of hateful speech more prone to
annotate a small number of samples for each hateful form. homophily among their generators?
We select a maximum of ten tweets per user from the 544
hateful users previously identified, resulting in a total of 7.2 Experiments settings
5,343 tweets to be annotated. To facilitate annotation, we
create a comprehensive lexicon of words commonly asso- 7.2.1 Parameter setting for familiarity computation
ciated with each of the five forms of hate, sourced from
an existing resource1 and augmented with additional terms The implementation of Variational Graph Auto-Encoder
manually extracted from tweets tagged with hashtags with (VGAE) is carried out using the source code provided by
hateful connotations. the library PyTorch Geometric.2 The adjacency matrix is
Manual inspection of the annotated tweets reveals that constructed from the retweet graph, which is represented as
99% of them correspond to the specified hate categories, an undirected graph. The training of the VGAE model was
demonstrating the effectiveness of our approach. This vali- performed with a learning rate of 0.01, for 120 epochs, with
dates our method’s potential to accurately label hateful a batch size equal to the size of the entire graph. The Adam
tweets and provide a reliable dataset for future research. We optimizer was used during the training process. The trained
obtain a set of 354 tweets that have been rigorously verified encoder portion of the VGAE was then utilized as the graph
to contain hate speech, as presented in Table 1. encoder for further experimentation.
Based on the labelled tweets, we proceed to identify To determine the similarity between users, we utilized the
initial hashtags for each type of hate speech. This involves Universal Sentence Encoder (USE)3 to encode the tweets of
extracting all the hashtags used in the tweets related to each each user. The aim here is to evaluate the effectiveness of our
form of hate speech. Furthermore, we conduct a thorough proposed familiarity computation model by comparing it to
manual inspection to examine the co-occurring hashtags of the standard similarity computation techniques employed in
these initial hashtags, with the aim of constructing a com- the state-of-the-art. In this study, we retained the use of USE
prehensive list of initial seeds for each form of hate speech. encoding for similarity features to ensure a fair comparison
Table 1 shows a few of the seed hashtags for the hateful between our proposed familiarity features and the existing
forms. In both approaches outlined in this paper, we detect ones. To measure the similarity between users, we calculated
hateful forms on the entire tweet corpus. the cosine similarity between their respective documents.
Furthermore, we computed the familiarity between users
2
1
https://www.frontgatemedia.com/a-list-of-723-bad-words-to-black https://github.com/rusty1s/pytorch_geometric
3
list- and-how-to-use-facebooks-moderation-tool/ https://tfhub.dev/google/universal-sentence-encoder/4
138 Page 10 of 16 Social Network Analysis and Mining (2024) 14:138
using two traditional metrics, namely edge existence and existing pre-trained TARS model to meet our requirements.
the number of mutual friends, as well as three metrics based The samples for each class are split into 70% for training,
on the user vectors obtained from our graph encoder. These 10% for validation, and 20% for testing. The pre-trained
metrics include cosine similarity, Euclidean distance, and model is updated using a learning rate of 0.02, a mini-batch
Manhattan distance. The calculation of familiarity computa- size of 1, and over 8 epochs. The trained classifier is then
tion is performed using the Scipy library.4 utilized to infer the labels for the tweets in the corpus.
7.2.2 Parameter settings for similarity computation 7.2.4 Parameter settings for hateful forms detection using
hashtags
As described in Sect. 3, we aim to capture the similarity
along semantic, syntactic, stylometric, and topical dimen- We retain only those hashtags that occur at least 10 times in
sions. The semantic features are constructed by utilizing pre- the corpus of tweets. To detect the polarity of a tweet, we
trained GloVe word embeddings, while the syntactic and use an existing sentiment classifier called twitter-roberta-
stylometric features are extracted based on the methodology base-sentiment available in the Hugging Face library.6 We
outlined in previous studies (Bhargava et al. 2013; Rajades- perform filtering of tweets based on the confidence score
ingan et al. 2015). of the sentiment classification model. Specifically, we only
To derive topical features, two approaches are used, retain those tweets where the model is confident enough.
namely latent topical features and Empath category scores. We experiment with different confidence scores ranging
Latent topical features are constructed by applying Latent from 0.7 to 0.9 with an increment step of 0.1. To classify
Dirichlet Allocation (LDA) to the tweet corpus, which is a hashtag as negative, we use the FT fraction of negative
composed of all tweets from all users. Each user’s tweets are tweets out of the total tweets in which the hashtag is present.
concatenated to form a document, and LDA is implemented We vary FT from 0.1 to 0.5 with an increment step of 0.1.
using the MALLET software. The values of the hyperpa- We only retain those hashtags that have a negative senti-
rameters 𝛼 and 𝛽 are set to 5.0 and 0.01, respectively. The ment. To encode the tweets, we use the Universal Sentence
Empath category scores are computed using the empath- Encoder (USE). In addition, we experiment with K-means
client library, which calculates the category score vectors clustering with different centroid update strategies, including
for each user based on the tweet document by mapping the no update, mean update, medoid update, and learning rate-
words in the tweet document to predefined categories. These based gradient update. We use the sci-kit-learn library to
scores represent the extent to which a user’s tweets belong implement these techniques. We report on the experimental
to different categories. outcomes of our study for a confidence score of 0.7 and a
Computing the similarity metrics is a compute-intensive negative tweet threshold of FT = 0.3 and K-means with cen-
task, and with the available hardware, computing the simi- troid update. This particular combination of parameters is
larity metrics for each user would not have been feasible selected as it yields the best results in our analysis. In total,
within a reasonable time frame. To address this issue, we we classify 2739 hashtags into five hateful forms.
resort to picking a subset of users. The methodology used to To detect homophily at the hateful form level, we com-
pick the subset of users does not compromise the generaliz- pute the familiarity between two users using our proposed
ability of the approach. We run modularity optimization- approach. To compute the similarity between users, we use
based community detection using the networkx library5 to the USE embeddings of their tweets.
pick a subset of users on the retweet network. The two com-
munities picked have approximately equal numbers of edges, 7.3 Experimental results
around 1, 60, 000, with the number of users being 7, 679
and 3, 277, respectively. These two communities provide To compute familiarity within a group of users, we begin
a sufficient number of users and demonstrate a significant by standardizing the familiarity values for each pair against
variation in edge density between the two. the highest value present within that specific set. This nor-
malization approach facilitates meaningful comparisons
7.2.3 Parameter settings for hateful forms detection using across a spectrum of familiarity metrics. Subsequently, we
TARS calculate the average of all these normalized pair values,
resulting in the group’s mean familiarity value. The same
We train a TARS-based few-shot multi-class classification process is reiterated to derive the similarity value for the
model for the detection of hateful classes. We update an group.
4
https://www.scipy.org/
5 6
https://networkx.org/ https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment
Social Network Analysis and Mining (2024) 14:138 Page 11 of 16 138
Fig. 6 Expanded clusters of hashtags for each hateful form Fig. 8 Experiment 2: expanded clusters of hashtags for each hateful
form
Table 3 The number of tweets and hashtags per month for each type
of hate speech.
Form T H U
T refers to the total number of tweets, while H refers to the total num-
ber of hashtags and U refers to the total number of unique users
8 Related work
Mathew B, Dutt R, Goyal P, et al (2019) Spread of hate speech in Weng J, Lim EP, Jiang J, et al (2010) Twitterrank: finding topic-sensi-
online social media. In Proceedings of the 10th ACM conference tive influential twitterers. In Proceedings of the third ACM inter-
on web science, pp 173–182 national conference on Web search and data mining, pp 261–270
McPherson M, Smith-Lovin L, Cook JM (2001) Birds of a feather: Xu S, Zhou A (2020) Hashtag homophily in twitter network: examining
homophily in social networks. Ann Rev Sociol 27(1):415–444 a controversial cause-related marketing campaign. Comput Hum
Paik A, Pachucki MC, Tu HF (2023) “Defriending’’ in a polarized Behav 102:87–96
age: Political and racial homophily and tie dissolution. Social Ying JJC, Lu EHC, Lee WC, et al (2010) Mining user similarity from
Networks 74:31–41 semantic trajectories. In Proceedings of the 2nd ACM SIGSPA-
Rajadesingan A, Zafarani R, Liu H (2015) Sarcasm detection on twit- TIAL International Workshop on Location Based Social Networks,
ter: A behavioral modeling approach. In WSDM, pp 97–106 pp 19–26
Ribeiro M, Calais P, dos Santos Y, et al (2017) “Like sheep among
wolves”: characterizing hateful users on twitter. In MIS2 Work- Publisher's Note Springer Nature remains neutral with regard to
shop at WSDM’2018 jurisdictional claims in published maps and institutional affiliations.
Schlichtkrull M, Kipf TN, Bloem P, et al (2018) Modeling relational
data with graph convolutional networks. In European semantic Springer Nature or its licensor (e.g. a society or other partner) holds
web conference, Springer, pp 593–607 exclusive rights to this article under a publishing agreement with the
Starbird K, Palen L (2012) (How) will the revolution be retweeted? author(s) or other rightsholder(s); author self-archiving of the accepted
information diffusion and the 2011 egyptian uprising. In Proceed- manuscript version of this article is solely governed by the terms of
ings of the acm 2012 conference on computer supported coopera- such publishing agreement and applicable law.
tive work, pp 7–16
Veličković P, Cucurull G, Casanova A, et al (2017) Graph attention
networks. arXiv preprint arXiv:1710.10903