Progressive domain adaptation for detecting hate speech on social media with small training set and its application to COVID-19 concerned posts
Paper · 2021 · Md Abul Bashar, Richi Nayak, Khanh Luong et al.
Summary
When a crisis changes what people talk about and how they talk about it, a hate speech detector trained before the crisis can miss the abuse that emerges during it. Bashar and colleagues ask whether a small set of labelled tweets about general hate can support detection of anti-East Asian hate during COVID-19. Their approach, LSTM-DA, draws on a distinction between two things a detector needs to learn. Ordinary text can teach it how language is used in the new setting. Examples with human labels can teach it which patterns matter for the classification task.
The authors train a recurrent language model to predict the next word, carrying its learned parameters through successive collections of text. It starts with Wikipedia articles, continues with general tweets from before the pandemic, and finishes with Australian Twitter conversations about COVID-19. The resulting representation supplies the starting point for a classifier trained on the small, labelled general-hate dataset. The East Asia Hate Dataset supplies the main test. The authors use its labels to score predictions after training the detector on the other hate dataset.
On the balanced cross-domain test, LSTM-DA achieves an F1 score of 0.726 and an accuracy of 0.688. It leads the tested alternatives on both measures. The order of the text collections matters. A shorter sequence that goes from Wikipedia straight to COVID-19 tweets does well, but adding general tweets in between gives the best overall results. Using all the same collections and finishing with general tweets instead gives the lowest accuracy of the tested orders. In a separate experiment that trains and tests on labelled splits of the East Asia Hate Dataset, LSTM-DA reaches an F1 score of 0.863. That score answers a different question, because the classifier has access to training labels from the domain it is tested on.
The paper also applies the same language representation to fear and anti-East Asian hate in Australian COVID-19 tweets. The application produces time series of flagged posts, with peaks that frequently occur around the same periods. Those Australian posts lack reference labels for either task. The time series therefore describe what the detectors flagged after keyword filtering, while the labelled benchmark provides the evidence that progressive adaptation improved hate detection under the tested conditions.
Deep dive: Progressive domain adaptation for detecting hate speech on social media with small training set and its application to COVID-19 concerned posts
How progressive domain adaptation uses unlabelled tweets to improve hate speech detection when the only training labels come from an older dataset. · about 39 minutes to read
The problem and its context
Why an existing collection of labels may fall short
A sudden event creates a practical mismatch for text classification. The conversations that researchers want to study are already taking place, and there may be plenty of text to collect. The human judgments needed to train a classifier take longer to obtain. During COVID-19, the authors were interested in tweets expressing fear and abuse, including hostility toward people of East Asian background. An older collection with hate labels could put a first detector within reach. Its authors, topics and examples of abuse could nevertheless differ substantially from those in the pandemic conversation.
The paper calls the domain that supplies the training labels the source. The target is the domain in which the detector will be used. The source in the main experiment contains general hate from before COVID-19 and covers several groups. The target concerns attitudes toward East Asian people during the pandemic. A salient term in the older material might rarely appear in the newer tweets. A term that becomes common during the pandemic might appear in both hostile and ordinary discussion. A classifier has to cope with both changes while learning its decision from labels attached only to the older examples.
The authors illustrate this gap with word clouds from general-hate and East Asian hate data. The clouds show that the collections give prominence to different words. That is an indication of a shift in vocabulary and frequency, which is enough to motivate a test of transfer. It leaves open how frequently the collections use the same expression with different meanings, whether their annotation policies agree, and how much an apparent difference in word use directly affects classification.
The paper addresses this mismatch through domain adaptation, a form of transfer learning in which information learned in one setting is reused in another with a different distribution of examples. Here the adaptation is unsupervised with respect to the target labels. The source classifier learns from human judgments, while the procedure uses unlabelled text to help its representation fit the target. The main evaluation can enforce that distinction because the target benchmark already has annotations. The experiment reserves those annotations for scoring, emulating a situation in which only the source labels are available during classifier training.
The small source set is central to the argument. With a large supply of source labels, a detector might learn a wide variety of constructions associated with its classes before an adaptation procedure ever sees target text. With fewer source examples, an unusual word or turn of phrase could look important simply because it appears in a handful of labelled posts. Giving the detector access to language patterns learned from many unlabelled tweets is a way to reduce how much the source examples have to teach it. The source labels still determine the task it is trained to perform.
Hate and offence are different annotation decisions
Hate detection in the related work covers several partly overlapping tasks. Some datasets distinguish racism and sexism. Others identify misogyny or use a broader category of abuse. The paper points to the shared problem of detecting language used to attack a person or group, while acknowledging that the choice of dataset and labels changes what a detector has to recognize. One earlier study described in the paper distinguishes hate, offensive language outside the hate class, and language in neither category. That distinction is the subject of Davidson and colleagues’ Automated Hate Speech Detection.
This variety matters for transfer. A detector trained to recognize a broad category of hate may have to predict a label tied to stance towards a particular population. Some source categories or expressions will have little bearing on that label. And ordinary offensiveness can be a misleading cue even within a single dataset. As the authors note, words that look abusive in isolation can be used sarcastically, and a hostile statement can communicate its point without including an obvious term from a hate lexicon. A keyword list can help retrieve material for review, but the context of a word still bears on whether the whole post belongs in the positive class.
Earlier supervised approaches described in the paper represented tweets using engineered features such as terms or n-grams, which are sequences of adjacent items. A support vector machine or logistic regression could then learn a boundary between labels from those inputs. Other studies used decision trees, random forests or ensembles. Variants changed how much influence to give individual terms. The paper mentions TF-IDF, for example, among the weighting schemes used in prior work on hate and offence. These methods made it possible to compare several feature and classifier choices within a labelled collection.
The authors also review approaches that learn representations through neural networks. Some use characters and words as input. Others combine convolutional networks with word embeddings, numerical vectors learned from patterns of word use. Recurrent approaches process text in sequence. The paper’s concern is that evidence of good performance within a single domain leaves the transfer question open. A representation can fit familiar patterns closely while losing their usefulness when the vocabulary, topics or annotation task changes.
What the authors take from transfer learning
The paper draws a motivation from computer vision research on the transferability of features. In that work, a network trained on one image collection can supply a representation for another. As the layers specialize, some features can become tied to the collection on which they were learned. That creates a tradeoff for the authors’ text setting. The detector needs enough specialization to recognize the target class, and enough continuity between domains for the classifier to use what it learned from the source.
The article discusses Adversarial Discriminative Domain Adaptation as one way earlier vision work dealt with this problem. It first uses source labels to learn a representation that can distinguish source classes. It then uses an adversarial objective to adjust the representation on target inputs, aiming to make the resulting features harder to distinguish by domain. The Progressive Feature Alignment Network adds objectives for class separation and prototype alignment, as well as for domain discrimination. In both cases, the initial source labels have substantial work to do. That makes the availability of only a small labelled source collection an important condition of the comparison in Bashar and colleagues’ experiments.
Prior work in text offered another route. A network learns a language prediction task from text, then undergoes fine-tuning, meaning that its existing parameters are updated on new data instead of being initialized afresh. The authors discuss earlier use of this approach for misogyny detection with limited labels, as well as work that adapted BERT to another domain. One cited example is BERT Post-Training for Review Reading Comprehension and Aspect-based Sentiment Analysis. The adaptation idea is closely related: text from the domain of interest can improve a representation before a downstream task uses it.
The paper describes BERT as having 110 million parameters and presents its computational demands as a motivation for a smaller recurrent system. The authors’ language predictor has 24 million parameters. They argue that a smaller pretraining collection can support such a system, while offering only partial coverage of the language needed for a particular application. Their proposal addresses coverage by changing what the network reads in succession. It starts with a general corpus, next sees ordinary posts from the platform that supplied the source labels, and finally sees conversations related to the target event. The chronology of the texts and the order in which the network encounters them are separate choices. It is the training order that the experiments vary.
The method, step by step
What the network learns at each stage
The method divides the task between two components. A language predictor learns features by trying to anticipate the next word in a sequence. It can use any of the selected text collections for this purpose because the answer is already in the text. A classifier then learns which features help distinguish the source labels. The transfer takes place through shared network weights. The final detector can reuse the features learned from unlabelled pandemic tweets even though it learns the classification decision from labelled pre-pandemic tweets.
The successive rounds of language training each have a purpose. Wikitext-103, called Wiki103 in the experiments, supplies articles intended to capture broad properties of English. Random Global Tweets, shortened to RGT, introduces the style and vocabulary of ordinary Twitter posts and comes from the period of the general-hate source. COVID-19 Australian Sphere Tweets, shortened to CAST, supplies event-specific language. CAST and the East Asia Hate Dataset play different roles. CAST is the collection used for the pandemic language-training stage. The East Asia Hate Dataset is the main target on which the hate detector’s predictions are evaluated.
From general language training to target predictions
The steps in order.
The process is progressive because the weights at the end of a stage initialize the next one. A network trained on CAST after RGT has a different starting point from a network arriving at CAST directly from Wiki103. And a network that sees RGT last makes its final language-training updates on ordinary pre-pandemic tweets. The authors expect the general collection to provide features that many domains can use, the middle collection to adapt those features to social media, and the last collection to make them more useful for the specific target.
The final transition also changes the prediction task. During language training, the network produces probabilities over possible next words. During classifier training, it produces probabilities over the task categories. The same input tweet can therefore support different kinds of learning depending on the stage. Its observed word sequence is enough for the language task. To supervise the classification task, the training procedure needs a separate judgment about the tweet as a whole.
The transfer problem in notation
The paper represents the information available to the procedure as a labelled source collection, an unlabelled target collection, and additional unlabelled collections related to either one. Its basic dataset notation can be written as follows.
Dₛ = {(Xᵢˢ, Yᵢˢ)}
Here Dₛ is the source dataset. Xᵢˢ is the input text of source example i, and Yᵢˢ is its class label. The superscript s marks the source, i identifies an example, the parentheses pair its text and label, and the braces indicate the collection of those pairs.
Dₜ = {Xᵢᵗ}
Dₜ is the target dataset as available for adaptation and prediction. Xᵢᵗ is the text of target example i. The superscript t marks the target. The absence of a paired Yᵢᵗ in this expression records the training condition. The evaluation of the hate detector can still compare its output with target annotations held for scoring.
{Dᵣₖ}ₖ₌₁ᴺʳ = {{Xᵢʳᵏ}}ₖ₌₁ᴺʳ
Dᵣₖ denotes related corpus k, and Xᵢʳᵏ is text i in that corpus. The letter r distinguishes the related corpora, and Nʳ is their total number. The bounds indicate that k starts at 1 and runs through Nʳ. The inner braces collect the texts in a corpus, and the outer braces collect the corpora.
The authors assume a difference in the joint distributions of inputs and labels.
Pₛ(Xᵢˢ, Yᵢˢ) ≠ Pₜ(Xᵢᵗ, Yᵢᵗ)
Pₛ and Pₜ denote the distributions for the source and target, respectively, and ≠ indicates that they differ. The input and label symbols retain their domain subscripts or superscripts. Yᵢᵗ refers to the target label that the system seeks to predict. The expression states the transfer problem without specifying which part of the distribution changed. A change in how often inputs occur is one possibility. A change in which label is associated with a kind of input would present a further difficulty.
The predictor as a whole is a mapping between texts and labels.
F: X → Y
F is the full prediction function. X denotes the input space and Y the label space. The arrow shows that a text is mapped to a class prediction. Internally the authors express this mapping as a representation step followed by a classification step.
𝐗ᵢ = L(Xᵢ, ω)
Xᵢ is an input sequence. L is the language predictor used to obtain a representation, ω is its set of learned parameters, and 𝐗ᵢ is the resulting feature vector. The bold form distinguishes the learned representation from the original sequence. The vector belongs to ℝᴰ, the space of real vectors with D dimensions.
Yᵢ = C(𝐗ᵢ, θ)
C is the classifier and θ is its parameter set. The input is the learned feature vector 𝐗ᵢ, and Yᵢ on the left denotes the label assigned to example i. Source annotations train this part of the system. The hope is that the associations it learns between features and labels will carry over to the target.
The paper describes domain invariance in terms of the distributions of these feature vectors. A corpus produces a distribution of input sequences, and their representations produce a corresponding distribution in feature space. The authors seek representations with similar distributions when source examples pass through the source-adapted language predictor and target examples pass through the target-adapted one. The source and target parameter sets, ωₛ and ωₜ, can differ. The aim is for a classifier trained on source examples to have features it can use on the target.
The covariate-shift qualification matters here. The argument takes for granted that the relationship needed to predict labels is stable enough across domains in the learned representation. Matching the frequency of features on its own could leave a classifier with a boundary that means something different in the target. The paper also notes that comparing high-dimensional feature distributions directly is difficult because the representations change during training. It suggests that cross-domain language-prediction loss could indicate a mismatch if the language predictor has been fitted well. The main experiments test transfer through downstream classification scores.
The authors describe the overall aim in terms of contributions from the two learning tasks.
ℒ(F) = ℒ(L) + ℒ(C)
ℒ denotes loss, a measure of prediction error or mismatch with the learning objective. F is the complete predictor, L is the language component, and C is the classifier. The plus sign expresses the paper’s conceptual division between the contribution of the language task and that of the classification task. In the procedure, they are trained in succession. The target benchmark supplies no classification loss to update F.
Predicting a sequence one word at a time
The paper starts from the probability of a text sequence. A next-word predictor assigns a probability to each item given the items that precede it. Multiplying those conditional probabilities gives the probability assigned to the whole sequence.
p(X) = p(x₁, …, xₙ) = ∏ⱼ₌₁ⁿ p(xⱼ | x₁, …, xⱼ₋₁)
X is the sequence of n items, and xⱼ is the item at position j. The items are words or other sequential input features in the paper’s account. The symbol p denotes probability, and the vertical bar means “given.” The ellipses stand for intermediate items. The product sign ∏ indicates multiplication over all positions j, from 1 through n. At the first position the preceding sequence is empty.
One direct estimate would count how frequently the context and its continuation occur together and divide by the count of the context.
p(xⱼ | x₁, …, xⱼ₋₁) = count(x₁, …, xⱼ₋₁, xⱼ) / count(x₁, …, xⱼ₋₁)
The probability on the left concerns the next item xⱼ given the prefix ending at xⱼ₋₁. On the right, count denotes the number of occurrences in the corpus. The numerator counts that prefix followed by the specified item, and the denominator counts occurrences of the prefix. The slash denotes division. The difficulty is that many long prefixes will occur too rarely to provide a reliable estimate for their possible continuations.
A limited-context assumption is one response. The paper describes a Markov approximation in which the most recent part of the prefix stands in for all preceding words.
p(xⱼ | x₁, …, xⱼ₋₁) ≡ p(xⱼ | xⱼ₋꜀, …, xⱼ₋₁)
Here the lowered c in xⱼ₋꜀ is the context length. The right-hand side begins at position j minus c and ends immediately before j. The equivalence sign marks the assumption that earlier items can be omitted from the conditional probability. Under that assumption the sequence probability has the same product structure with the shorter contexts.
p(xₙ, …, x₁) ≡ ∏ⱼ₌₁ⁿ p(xⱼ | xⱼ₋꜀, …, xⱼ₋₁)
On the left, p again denotes the joint probability of the sequence items, listed in the order used in the paper’s expression for this approximation. On the right, ∏ multiplies the conditional probabilities at positions j from 1 through n, using a context of up to c preceding items. The order of the arguments in the joint probability leaves the index order of prediction on the right intact. The authors use this form to motivate learning from local windows.
Why the paper compares against Word2Vec
Word2Vec offers a way to learn from unlabelled target text without adapting an entire recurrent network. In its continuous bag-of-words form, a window of surrounding words is used to predict a word within it. The skip-gram variant reverses that prediction direction by using a word to predict nearby context. The experiments with Word2Vec use the continuous bag-of-words variant. The theoretical discussion relates the local-context sequence score to the sum of window-based predictions.
ln p(xₙ, …, x₁) ≡ ∑ⱼ₌₁ⁿ ln p(xⱼ | xⱼ₋꜀, …, xⱼ₋₁) ≡ ∑ⱼ₌₁ⁿ⁻ᶜ⁺¹ ∑ₓₖ∈Sⱼ ln p(xₖ | Sⱼ − {xₖ})
The symbol ln means natural logarithm, and the sum sign ∑ adds the terms over the indicated indices. In the middle expression, j runs over the n positions and c specifies the lookback length. On the right, Sⱼ is the window starting at position j, and the upper bound n minus c plus 1 is the number of starts for complete windows of length c. The inner sum goes over items xₖ in that window, as indicated by ∈. Removing the selected item, denoted by Sⱼ − {xₖ}, gives its prediction context. The first step uses logs to turn a product into a sum. The final equivalence is the paper’s connection to the bag-of-words objective. The surrounding context used there can differ from the preceding-only context used for next-word prediction.
The full corpus objective then asks which embedding parameters give the highest sum of these log probabilities.
arg maxᵥ ∑ᵢ₌₁ᴺ⁻ᶜ⁺¹ ∑ₓⱼ∈Sᵢ ln p(xⱼ | Sᵢ − {xⱼ}, ϑ)
The lowered v in arg maxᵥ stands for ϑ, the parameters being estimated. The operator arg max selects the parameter values at which the objective is largest. N is the corpus length in the paper’s indexing, c is the window size, and i runs through window starts from 1 to N minus c plus 1. Sᵢ is the window starting at i, xⱼ is an item selected from that window, and the inner sum adds the log probability of each such item given the rest of its window and the parameters ϑ. The learned parameters give word vectors that can be passed to a downstream classifier.
The authors use this comparison to distinguish two ways of bringing target-domain text into the system. Word2Vec supplies word-level representations learned from neighbouring words. The recurrent approach can update its internal representation as it encounters words in sequence, and its stacked layers can combine information nonlinearly. The paper’s concern is that a bag of nearby words loses distinctions that depend on their order or on how different parts of a sequence interact. An embedding learned on the pandemic corpus still gives the baselines a way to exploit target vocabulary, making them a more informative comparison than classifiers trained exclusively on the source labels.
What the recurrent network carries forward
A recurrent neural network reads a sequence step by step and maintains an internal vector called a hidden state. The state changes when a new item arrives. At each step the network can combine the current word with what it has retained from earlier positions. The paper introduces this calculation using a simple recurrent unit.
𝐡ⱼ = fₕ(𝐱ⱼ, 𝐡ⱼ₋₁) = φ(𝐱ⱼ𝐖 + 𝐡ⱼ₋₁𝐔 + 𝐛)
At position j, 𝐱ⱼ is the vector for the input item and 𝐡ⱼ is the new hidden state. The subscript j minus 1 denotes the preceding state. The function fₕ is the hidden-state update. The matrix 𝐖 supplies weights for the current input, and 𝐔 supplies weights for the previous state. Multiplication by those matrices transforms both vectors. The plus signs combine the transformed vectors and a bias vector 𝐛. The function φ applies a nonlinear activation, for which the paper gives examples such as the rectified linear unit.
The hidden state can then supply the scores for next-word prediction. The paper writes the illustrative output equation as follows.
𝐨ⱼ = fₒ(𝐡ⱼ) = σ(𝐡ⱼ𝐕) + 𝐚
Here 𝐨ⱼ is the output vector at step j, fₒ is the output function, and 𝐡ⱼ is the hidden state. The matrix 𝐕 connects the hidden state to the output scores, and 𝐚 is the output bias. The function σ is softmax, which normalizes a vector of scores to give a probability distribution. In this displayed equation, the bias appears outside σ. A bias added after normalization could change the sum of the outputs. In its account of the implemented architecture, the paper specifies a final softmax that outputs probabilities over the vocabulary or over the classes.
The actual recurrent component is a long short-term memory network, or LSTM. Its gates control the flow of information through the sequence, allowing earlier information to pass through later steps when it remains relevant. During language training, the network compares its prediction for the next item with the item that actually follows. Over many examples, this process updates the parameters used to turn a prefix into a prediction. The resulting recurrent states supply the features transferred to the classifier.
∏ⱼ₌₁ⁿ p(xⱼ | x₁, …, xⱼ₋₁, ω) ≈ p(x₁, …, xₙ) = p(X)
The left-hand side multiplies the network’s conditional probabilities, parameterized by ω, at positions j from 1 to n. The symbol ≈ indicates approximation. The right-hand side is the joint probability of the items x₁ through xₙ in the sequence X. The chain of conditional probabilities on the left has the same structure as the earlier sequence formula. The approximation here concerns the probabilities learned by the network from a corpus.
The argument for a sequence of corpora
The language predictor learns from examples drawn from a corpus, so the paper treats its account of text as corpus-dependent.
p(X, D) = p(X | D)p(D)
X is a text sequence and D is the corpus. The left-hand side is the joint probability assigned to the sequence and corpus. The right-hand side factors it into the probability of X conditioned on D and a probability for D. Juxtaposition denotes multiplication. When the language predictor trained on D maps texts to feature vectors, the resulting feature distribution also depends on the corpus.
The authors extend the argument to a sequence of corpora. The first step is a probability factorization, which can be written with a separate term for each corpus conditioned on the ones that follow it in the indexing.
p(𝐗, D₁, …, Dₘ) = p(𝐗 | D₁, …, Dₘ) p(D₁ | D₂, …, Dₘ) … p(Dₘ₋₁ | Dₘ) p(Dₘ)
Here 𝐗 is the learned representation, D₁ through Dₘ are the corpora, and m is the total number of corpora. Each p denotes a probability or distribution. The joint expression on the left includes the representation and all the corpora. On the right, the first factor conditions the representation on the entire collection of corpora. The remaining factors expand the joint distribution of the corpora. The ellipsis between factors indicates the intervening corpus terms.
The paper then introduces a simplifying independence argument. It replaces the joint corpus term by a product of individual corpus terms and models the conditional contribution to the representation through separate corpus-level factors.
p(𝐗, D₁, …, Dₘ) ∝ ∏ₖ₌₁ᵐ p(𝐗 | Dₖ)p(Dₖ)
The proportionality sign ∝ allows for a scaling factor. Dₖ is corpus k, and the product runs from the first through the mth corpus. The factor p(𝐗 | Dₖ) expresses the contribution of that corpus to the representation, and p(Dₖ) is its corpus probability. The separation into feature contributions is part of the modelling assumption. Independence of corpus choices alone would leave open how the representation depends on combinations of corpora.
Introducing the network’s learned parameters gives a further factorization.
∏ₖ₌₁ᵐ p(𝐗 | Dₖ)p(Dₖ) ≈ ∏ₖ₌₁ᵐ p(𝐗 | Dₖ, ωₖ)p(ωₖ | Dₖ)p(Dₖ)
The symbol ωₖ denotes the parameters learned at corpus k. The first factor on the right represents the feature vector 𝐗 using those parameters and that corpus. The second accounts for the parameters given the corpus. The third concerns the corpus itself. The approximation sign expresses the paper’s move from corpus-level quantities to a description with explicit learned weights.
The progressive procedure changes the parameter term. The network for a given stage starts with the weights learned immediately before it. The paper uses a Markov assumption to describe this dependence, so information from earlier stages reaches the current one through the preceding parameter set.
p(𝐗, D₁, …, Dₘ) ≈ ∏ₖ₌₁ᵐ p(𝐗 | Dₖ, ωₖ)p(ωₖ | Dₖ, ωₖ₋₁)p(Dₖ)
Here ωₖ₋₁ is the parameter set passed to stage k by the preceding stage, and ωₖ is the result of updating it on Dₖ. The initial set ω₀ can be assigned randomly. The term p(ωₖ | Dₖ, ωₖ₋₁) represents the dependence of the new weights on both the current corpus and the weights they inherited. The other factors describe the feature representation and the corpus, as above. The order can now matter through the weight transitions even if the same corpora occur in the product.
The authors discuss the case in which the corpus probabilities are assigned equal weight. The feature and parameter terms can then be compared on a log scale.
∑ₖ₌₁ᵐ ln[p(𝐗 | Dₖ, ωₖ)p(ωₖ | Dₖ, ωₖ₋₁)]
The sum adds the natural logarithm of the bracketed probability product for each k from 1 through m. Inside the brackets, the first term describes the representation given the corpus and the current weights, and the second describes the transition to those weights. The sum is the log of the product of these terms after setting aside constant corpus factors. It is therefore a log score, even though the paper’s displayed derivation ends by using a proportionality sign between the product and the sum. The training procedure itself updates the language predictor on each corpus in sequence.
The authors draw a practical hypothesis from this account. A broadly useful starting representation can be narrowed by successive corpora chosen for relevance. The tweets in RGT can add ways of writing that the Wikipedia corpus covers poorly. The COVID-19 collection can then add vocabulary and usage associated with the target event. This also gives a reason why ending on a less target-related corpus might be detrimental. The last update can shift the representation back toward language that suits the source period.
Turning the representation into a classifier
The paper treats classification as learning the probability of a class conditional on the representation. It expresses the distinction between the distribution of features and the class decision as follows.
p(Cₗ, 𝐗, θ) = P(Cₗ | 𝐗, θ)p(𝐗)
Cₗ denotes the class indexed by l. The bold 𝐗 is the feature vector, and θ denotes classifier parameters. The conditional term P(Cₗ | 𝐗, θ) is the classifier’s probability for that class given the representation and the parameters. The term p(𝐗) denotes the marginal feature distribution. The left-hand side is the paper’s notation for the combined quantities. The exposition treats θ as the current learned parameters when it describes the class decision. The division of labour is that unlabelled text can inform the distribution of features, whereas labels are needed to train the classifier’s use of those features.
For the language component, the implementation uses AWD-LSTM, the recurrent architecture cited by the authors for its use of tuned dropout. Dropout temporarily removes contributions from parts of the network during training as a form of regularization. The paper follows earlier work for the architecture and language-training hyper-parameters. During the tweet-corpus updates it uses different learning rates for different layers, so layers can change by different amounts. It also uses a schedule that briefly raises the learning rate and then decreases it more slowly. A learning rate controls how large a parameter update is at a training step.
The classifier uses the recurrent representation with concat pooling, which joins pooled summaries of the states into a representation for the whole input. The class prediction passes through a linear layer and a softmax over classes. The authors report using gradual unfreezing, alongside a design in which the earlier representation layers stay frozen through classifier training. In the architectural account, the layers through the one indexed by n minus 2 are kept fixed, with n indexing the end of the sequence of layer representations. Keeping those layers fixed restricts how much the small source set can change the features learned through the corpus sequence. The trainable upper part can still adapt to the labelled task.
The experiments use rectified linear activations in intermediate layers and softmax at the output. The authors report tuning hyper-parameters by cross-validation and implementing the system in PyTorch. Once the classifier has been trained and validated on the source data in the transfer experiment, its parameters stay fixed during target prediction. In the in-domain comparison, the supervised training and scoring partitions instead come from within the target benchmark. The same architecture can therefore be assessed under two distinct label-access conditions.
Experiments and results
The data and what the labels mean
The main transfer experiment uses the General Hate Dataset, GHD, as the labelled source. The authors obtained it from Kaggle. It contains 31,962 tweets from 2018, of which 2,242 are labelled as hate. The study uses a stratified subset with 4,484 tweets. Its positive examples concern a variety of groups. The source set gives the classifier examples of general hate from before the pandemic and does not determine what topics the pandemic text-training collection covers.
The target is the East Asia Hate Dataset, EAHD, collected between 1st January and 17th March 2020. It contains 20,000 tweets with annotations for whether they are relevant to East Asians and, where applicable, the stance expressed. For the binary experiment, the authors assign negative and very negative stances to the positive class. In the terminology of the evaluation, a true positive is therefore a successful detection of a tweet with negative or very negative stance. A tweet whose stance annotation is positive belongs on the other side of that particular classification boundary.
There are 3898 positives under this definition. The authors randomly select 3898 tweets with neutral, positive or very positive stances for the other class. The resulting target subset has 7,796 examples. Its balance means the positive and negative classes have equal representation in this test. The classifier learns from the GHD labels, and EAHD labels are used to evaluate its predictions. The source and target collections thus differ both in topical focus and in the annotation judgment used to define a positive example.
The unlabelled corpora supply a separate source of evidence about language. Wiki103 contains 28,595 Wikipedia articles and 103 million words. RGT contains 16.28 million random tweets collected in 2018 through the Twitter Stream API. CAST contains 6.8 million tweets about COVID-19 in the Australian Twitter sphere, collected from 27th November 2019 through 7th September 2020. The CAST collection is itself based on pandemic-related search terms and hashtags. Its relevance to the target arises from that topical selection, while the hate benchmark stays a separate collection.
Each dataset size therefore refers to a different kind of input. The GHD count describes a labelled source subset, while the EAHD count describes the balanced target evaluation subset. The much larger tweet counts refer to unlabelled language-training collections. The experiment addresses a shortage of human labels in the presence of abundant text. A setting with very little target-related text would offer the approach a different kind of evidence.
The comparisons and scoring
The principal comparison includes 16 baselines. Some receive unlabelled text for adaptation, but by different routes. LSTM-W and CNN-W use continuous bag-of-words embeddings trained on CAST. Their word vectors have 200 dimensions, and the specified minimum word count for embedding training is 100. The recurrent LSTM-W uses 100 units and 50% dropout, with binary cross-entropy, Adam and a sigmoid output. Its plain LSTM counterpart uses the same stated settings without the pretrained word vectors. CNN-W and the plain CNN provide the corresponding contrast for a convolutional classifier.
Other baselines use methods adapted from computer vision. ADDA-LSTM and ADDA-CNN implement adversarial adaptation using alternative text networks in place of the original image backbone. PFAN-LSTM and PFAN-CNN use the same two types of text networks with the feature-alignment approach. The authors use these comparisons to ask how well methods that initially learn discriminative features from source labels work when source supervision is limited. Their access to target inputs comes through their adaptation objectives, while LSTM-DA learns its initial transferable representation by predicting language.
The remaining comparisons include the plain convolutional and recurrent classifiers, a feedforward deep network and conventional supervised methods. The conventional group includes linear and nonlinear support vector machines, along with random forest and XGBoost. It also includes multinomial naive Bayes, nearest neighbours and a ridge classifier. The paper reports manual cross-validation-based tuning for the neural baselines and a grid search with tenfold cross-validation for the conventional classifiers. The methods without adaptation do not use the extra unlabelled collections.
The paper evaluates classification performance from several angles. Accuracy is the proportion of all decisions that match the labels. Precision is the proportion of positive predictions that are correct. Recall is the proportion of labelled positives that are recovered. F1 combines precision and recall through their harmonic mean, which limits the benefit of a very high value on one when the other is low. Cohen’s kappa adjusts agreement for the amount expected by chance given the label and prediction frequencies. The paper also reports area under the curve, abbreviated AUC.
Counts help explain where those scores come from. A false positive is a negative example predicted as positive. A false negative is a positive example that the detector misses. True positives and true negatives are the corresponding correct decisions. A system can retrieve many relevant posts by labelling nearly everything positive. That policy shows up as high recall alongside many false positives. Conversely, a system that typically predicts the negative label can accumulate correct negatives while missing a large share of the cases of interest.
Transfer from general hate to East Asian hate
LSTM-DA leads the cross-domain test on F1. It achieves 0.726, compared with 0.646 for multinomial naive Bayes and 0.641 for the convolutional classifier with CAST-trained embeddings. LSTM-W, which combines a recurrent classifier with those embeddings, reaches 0.629. The baseline with the highest F1 is ADDA-CNN at 0.670, with a prediction pattern quite different from the other leading systems.
F1 for selected classifiers on the cross-domain EAHD test
Progressive adaptation leads the comparison while the adversarial CNN achieves its score with many positive predictions.
The numbers
| System or setting | F1 |
|---|---|
| Plain LSTM | 0.507 |
| Plain CNN | 0.621 |
| LSTM-W | 0.629 |
| CNN-W | 0.641 |
| Multinomial naive Bayes | 0.646 |
| PFAN-LSTM | 0.658 |
| ADDA-CNN | 0.670 |
| LSTM-DA (this paper) | 0.726 |
LSTM-DA obtains accuracy of 0.688, precision of 0.648 and recall of 0.825 on EAHD. Its Cohen’s kappa is 0.377, and its reported AUC is 0.688. The confusion counts are 3215 true positives, 2152 true negatives, 1746 false positives and 683 false negatives. Those counts give a sense of how much error remains at the detector’s chosen decision rule. Correct detections are common in the balanced test, and the system still flags many tweets whose reference labels fall outside the positive class.
The paper discusses the performance of multinomial naive Bayes, CNN-W and LSTM-W primarily in terms of accuracy and AUC. Multinomial naive Bayes and CNN-W share a reported value of 0.599 on each of those metrics, and LSTM-W scores 0.595 on each. Plain LSTM scores 0.553 on both. The authors attribute the relatively strong showing of naive Bayes to its ability to learn a generative description of the data. In this comparison, the plain supervised baseline with that property is competitive with the simpler embedding-based adaptation. Meanwhile the use of CAST embeddings is associated with stronger results for both the plain-versus-adapted recurrent pair and the corresponding convolutional pair.
ADDA-CNN shows why metric choice changes the ranking. Its recall of 0.977 is the highest among the compared systems. It finds 3809 positives and misses 89, but marks 3669 negatives as positive. Its precision is 0.509 and its accuracy is 0.518. A reader looking only at F1 or recall would get a different picture from one looking at chance-adjusted agreement, for which it scores 0.036. PFAN-CNN moves in the other direction. It correctly assigns 2916 negatives but misses 2755 positives, and its recall is 0.293. PFAN-LSTM reaches recall of 0.882, with 3108 false positives and precision of 0.525. The exact form of the imbalance varies with the architecture and adaptation method.
The conventional tree ensembles also trail LSTM-DA in this setting. Random forest obtains accuracy of 0.571 and XGBoost obtains 0.544 on the cross-domain EAHD test. The comparison establishes how these implementations transfer under the paper’s source and target conditions. The authors subsequently test several of them with supervised training and evaluation inside EAHD, where their inputs and labels come from the same collection.
What changes when EAHD provides training labels
The in-domain experiment uses the EAHD creators’ 80/10/10 training, validation and test split of the stratified data. Here the classifier can learn from EAHD training labels. This setting asks whether the progressively trained language representation also helps when the labelled training data concern the same population and event as the test set. A score from this part of the study therefore reflects the benefit of a different label source as well as the classifier and its representation.
F1 for selected classifiers on the in-domain EAHD test
Progressive adaptation leads the in-domain comparison even though some alternatives retrieve more positives.
The numbers
| System or setting | F1 |
|---|---|
| Plain LSTM | 0.785 |
| Random forest | 0.799 |
| Plain CNN | 0.804 |
| CNN-W | 0.826 |
| LSTM-W | 0.835 |
| LSTM-DA (this paper) | 0.863 |
LSTM-DA records accuracy of 0.858, precision of 0.854, recall of 0.873, Cohen’s kappa of 0.715 and AUC of 0.857 in the in-domain table. The paper also reports published F1 scores from the dataset creators of 0.83 for RoBERTa and 0.76 for their baseline LSTM. Those figures come from the earlier EAHD study. The comparisons in the chart are the authors’ own implementations, including their plain LSTM, with its separately reported F1 of 0.785.
CNN-W has the highest recall among the systems in the in-domain table, at 0.937. LSTM-W reaches 0.911 and the plain CNN reaches 0.889. LSTM-DA makes 60 false positive predictions according to the table, compared with 126 for CNN-W, 103 for LSTM-W and 123 for the plain CNN. The higher-recall alternatives make a different precision–recall tradeoff. CNN-W, for instance, has precision of 0.739, below the 0.854 reported for LSTM-DA.
Other familiar classifiers also achieve stronger scores in-domain. Random forest records accuracy of 0.801 and XGBoost records 0.795 on the EAHD test partition. Their in-domain F1 scores are 0.799 and 0.795, respectively. The results support examining transfer separately from ordinary held-out prediction. Having a good classifier on the data used to define the task gives limited evidence about its behaviour when the task and wording change together.
The application to fear and hate in CAST
The case study uses the same language predictor, adapted through Wiki103, RGT and CAST, for two classification tasks. Its source labels change with the task. Its target in each case is a subset of CAST retrieved by searching for terms likely to occur in the relevant discussion. In the benchmark, CAST supplies text for language adaptation and EAHD supplies the test. In this application, CAST supplies both the language-training material and the tweets being classified, and separate labelled collections supply the classifier supervision.
For fear detection, the authors use 17 fear-related keywords to select 147,240 tweets from CAST. The words serve as a broad retrieval filter for texts that might express fear. A tweet may include a fear-related word while describing someone else’s reaction or talking about fear as a topic. The classifier then makes a separate decision on whether the retrieved tweet expresses the category it learned from labelled examples.
The source fear dataset supplies a training set of 2252 labelled tweets, including 762 positives and 1490 negatives. It also supplies a labelled validation set of 389 tweets, with 138 positives and 251 negatives. Because the original test set lacks labels, the authors train and validate using the training set and use the original labelled validation set for their reported source-side test. They then flag 53,156 CAST tweets in the keyword-filtered subset as relevant to fear. The classification results on labelled source material and the number of positive CAST predictions answer different questions. There are no CAST fear annotations against which to score those predictions.
For the hate application, the authors start with 14 terms associated with East Asia in COVID-19 discussions. The paper describes some of the terms as conveying anti-East Asian sentiment and others as neutral. The filter retrieves 78,508 CAST tweets. The classifier now draws supervision from EAHD, which has moved from being the evaluation target in the main experiment to being the labelled source for this application. It flags 13,920 tweets from the retrieved CAST collection as relevant to anti-East Asian hate. CAST has no annotated hate labels for assessing this count.
The authors visualize both sets of flagged posts over time and examine the same series on a logarithmic scale. The peaks frequently fall near one another. They describe the period from February 2020 to May 2020 as the most active phase in Australia in their interpretation and note an earlier hate peak in January, when the fear series was below its peak. They also observe that a fear peak is frequently followed by a hate peak. The figures show when positive outputs accumulated under each retrieval and classification procedure. They leave the relationship between individual users’ fear and hostility unresolved.
What the ablations show
The order comparison tests more than adding text
The central ablation varies the corpus sequence while keeping the progressive LSTM approach. In the paper’s notation, W is Wiki103, R is Random Global Tweets and C is CAST. The authors compare the Wikipedia starting point alone, either of the tweet collections added to it, and both possible orders for the tweet collections after Wikipedia. Each route asks what the resulting representation contributes to the cross-domain EAHD test.
Accuracy on the cross-domain EAHD test by pretraining order
The complete sequence leads when language training finishes on COVID-19 tweets.
The numbers
| System or setting | Accuracy |
|---|---|
| Wiki103 only | 0.652 |
| Wiki103 → RGT | 0.657 |
| Wiki103 → CAST | 0.668 |
| Wiki103 → CAST → RGT | 0.644 |
| Wiki103 → RGT → CAST (this paper) | 0.688 |
The Wikipedia-only route gives an EAHD F1 score of 0.700. Adding general tweets after Wiki103 gives 0.718, while adding COVID-19 tweets directly after Wiki103 gives 0.721. The complete sequence that finishes on CAST gives 0.726. In this comparison, a stage focused on the pandemic is more helpful to overall accuracy and F1 than a single extra stage of ordinary pre-pandemic tweets. The full sequence leads both, which is consistent with the middle stage contributing useful knowledge of how people write on Twitter.
Comparing the two complete routes isolates an important aspect of the intervention. Both include Wiki103, RGT and CAST, so they draw on the same named corpora. With RGT before CAST the score is 0.726 F1. With RGT after CAST it is 0.688. Precision on the EAHD test is 0.648 for the target-last route and 0.613 for the source-related-last route. The comparison gives direct evidence that the result depends on which training updates come last. Simply giving the language predictor access to the pandemic collection leaves open how much of that adaptation is preserved after it continues training elsewhere.
The authors interpret the poor result for the reversed route as evidence that the predictor becomes more useful when its last training corpus is closer to the target. The result also fits their hypothesis about the asymmetry of transfer. The general representation can give the network something to build on when it reads tweets, and a representation of general Twitter language can help when it moves into pandemic conversation. Making the last adjustment on older general tweets can favour patterns that are less helpful on EAHD. The experiment observes a performance change after reversing the order. It does not trace particular words or internal features through the successive updates.
The best order depends on what is counted
The preferred sequence leads on accuracy, precision, F1, Cohen’s kappa and the reported AUC. It does not have the highest recall in the order ablation. Wiki103 followed by RGT has recall of 0.875, and Wiki103 followed directly by CAST has recall of 0.857. The full target-last sequence has recall of 0.825. The move from Wiki103 followed by RGT to the complete sequence changes the errors from 2184 to 1746 false positives and from 489 to 683 false negatives. The method’s overall lead comes with fewer mistaken flags and more missed positives than that shorter, higher-recall route.
The direct comparison between Wiki103 followed by CAST and the full sequence gives another view of the middle stage. The direct route yields 3339 true positives and 1867 true negatives. The full sequence yields 3215 true positives and 2152 true negatives. The middle corpus improves performance under metrics that value both sides of the decision, even though the direct route identifies more of the labelled positives. That distinction would matter if the classifier were being assessed primarily on its ability to gather as many relevant posts as possible for subsequent review.
The broader architecture comparisons are less tightly controlled. The CNN and LSTM with pretrained Word2Vec embeddings show what a simpler route to target-domain vocabulary can achieve. Giving an LSTM those embeddings helps it substantially in the cross-domain experiment, and the convolutional classifiers also benefit. LSTM-DA leads both adapted variants on accuracy and F1. The difference covers a change in representation, language objective, corpus exposure and training procedure. The ablation of corpus order within LSTM-DA provides the more direct evidence about the progressive part of the proposed approach.
The in-domain comparison supports the authors’ interpretation that transfer is a major source of difficulty for conventional systems. Several methods that score poorly when supervised on GHD give reasonable held-out results within EAHD. However, the two experiments change where the labels come from and which examples are used for testing. The comparisons cannot assign a share of the performance change to particular kinds of shift, such as differences in vocabulary, differences in the class definition or differences in the composition of the evaluation samples.
Limitations
Limits the authors state
The paper explicitly states that the Australian Twitter application has no labelled CAST data with which to measure the accuracy of either detector. The authors can score hate transfer against the EAHD annotations and assess fear prediction on labelled material from its source collection. For the CAST application, they can count predictions, plot their timing and inspect vocabulary in the flagged tweets. The reported counts remain detector outputs. Their validation would require judgments about the CAST tweets themselves.
The authors also state that their case study leaves unclear whether fear of COVID-19 led people to express hate towards East Asians. They interpret the similar timing of peaks as evidence of a relationship in the CAST data. They offer a possible explanation for the early hate peak and discuss circumstances that might give rise to fear, including economic and health concerns. These explanations are interpretations of the timing. The plots contain no direct measurement of a person’s motivation or of a transition from fear to hostility.
Corpus choice is another difficulty the authors acknowledge. A general-to-specific progression makes sense when the corpora have clear roles, as Wikipedia articles, general tweets and pandemic conversation do in this design. It may be harder to decide which of two related corpora is more general or which best bridges the domains. The paper proposes that a probability-based analysis of uncertainty could eventually help select corpora and architectures. That is a direction for future work, as is the suggestion to combine a progressively adapted representation with a convolutional network and Word2Vec features.
The authors present their method as applicable beyond the tasks they study and discuss extensions using other architectures. Their experiments establish results for the specific recurrent implementation and datasets, with the fear application illustrating reuse of the language representation. The paper’s comparison of parameter counts motivates the recurrent choice. It does not supply a head-to-head timing or resource benchmark against the BERT-based adaptation work discussed in the background.
Limits apparent from the experimental design
The main experiment is a joint shift in subject matter, time and label construction. The source uses a general hate label, whereas the target class collects negative and very negative stances towards East Asians. A change in accuracy can therefore reflect several differences at once. The result is informative for this transfer problem, but it leaves open how well the same procedure would work if the domains used identical annotation criteria, or if the text distributions were similar and the annotation criteria changed. The covariate-shift argument depends on a stable class relationship in the representation, and the paper does not independently establish that relationship.
The balanced EAHD test makes the methods easy to compare at the same class proportions. It does not tell a reader what precision a deployed detector would have in an unfiltered stream. Precision depends partly on how often positive cases occur in the material being classified. The source subset also has a selected composition. Though the study demonstrates transfer with a small labelled source, it does not vary the amount of source supervision to show how the advantage changes as the source set grows or shrinks.
The reported scores offer only indirect evidence for domain-invariant or disentangled features. Similar performance across domains could be supported by features the classifier can reuse, but the feature claim is stronger than the observation that the downstream result improves. The experiments do not give a direct comparison of source and target feature distributions or show which factors remain invariant. Nor does the corpus-order ablation compare sequential training with a single pooled corpus containing the same material under a matched training budget. The reversal is good evidence for order sensitivity within the choices tested. A universal advantage of sequential over pooled training would require a different comparison.
The paper describes performance differences as significant, but the reported tables give point estimates. There are no accompanying intervals or repeated-run results showing how much those estimates vary with random sampling or training. Some comparisons also merit care when read from the individual metrics. In the cross-domain table, the reported AUC values coincide with accuracy throughout, and the scoring procedure is not detailed enough to determine how continuous scores were used. In the in-domain table, pairs of counts that should describe a common reference-class total vary across rows. For instance, the listed true positives and false negatives are 351 and 51 for LSTM-DA, and 346 and 34 for LSTM-W. The paper describes a common split and does not explain this variation. The appropriate comparison is therefore between the results as reported, with some uncertainty about how to reconcile the in-domain confusion counts.
The CAST time series has an additional selection issue. The fear and hate searches use different vocabularies and retrieve differently sized candidate sets. Each classifier can also make errors at a different rate. Counts from those pipelines measure the combined effects of vocabulary selection, tweet volume and classification. The higher fear counts cannot by themselves establish the relative prevalence of fear and hate in CAST. Tweets that express either category without using an included keyword can be missed before the classifier sees them. Similar peaks could also arise when overall conversation about the pandemic increases and both filters retrieve more posts.
The time span of CAST matters for a different reason. The language-training corpus covers months after the end of the main EAHD collection. The cross-domain experiment therefore shows adaptation with event-related text drawn from the broad CAST collection. It does not simulate a system operating at the start of the outbreak with access restricted to tweets already posted by each date of prediction. Likewise, the case study applies the representation to CAST after language adaptation on CAST. This is consistent with the paper’s retrospective use of unlabelled data. An evaluation of real-time detection would need to restrict when each training example becomes available.
Finally, the task touches on bias, fairness and safety through its treatment of hostility directed at groups. The aggregate metrics establish error rates for the selected labels on the selected datasets. They leave open how errors are distributed across kinds of language, groups discussed in the source, or benign references to East Asian people. The case study’s neutral as well as hostile search terms make that distinction especially consequential. A prediction count can describe the material selected for analysis without resolving who is misclassified or why.
What came after
There are no later citing studies to discuss here. The paper closes with open questions about how to select corpora and estimate uncertainty at each stage, and whether the same sequence of language-training stages would help other architectures. Its direct evidence concerns a narrower question: how the choice and order of unlabelled training text affected a recurrent hate detector trained with source labels and evaluated in a different domain.
Cite
Cite as Md Abul Bashar, Richi Nayak, Khanh Luong and Thirunavukarasu Balasubramaniam. 2021. Progressive domain adaptation for detecting hate speech on social media with small training set and its application to COVID-19 concerned posts. Social Network Analysis and Mining.
@inproceedings{bashar2021progressive,
title = {{Progressive domain adaptation for detecting hate speech on social media with small training set and its application to COVID-19 concerned posts}},
author = {Md Abul Bashar, Richi Nayak, Khanh Luong and Thirunavukarasu Balasubramaniam},
booktitle = {Social Network Analysis and Mining},
year = {2021},
doi = {10.1007/s13278-021-00780-w},
url = {https://doi.org/10.1007/s13278-021-00780-w}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bashar-2021-progressive-domain-adaptation-detecting-hate/