Abstract
Covid-19 has spread across the world and several vaccines have been developed to counter its surge. To identify the correct sentiments associated with the vaccines from social media posts, we fine-tune various state-of-the-art pre-trained transformer models on tweets associated with Covid-19 vaccines. Specifically, we use the recently introduced state-of-the-art pre-trained transformer models RoBERTa, XLNet and BERT, and the domain-specific transformer models CT-BERT and BERTweet that are pre-trained on Covid-19 tweets. We further explore the option of text augmentation by oversampling using Language Model based Oversampling Technique (LMOTE) to improve the accuracies of these models, specifically, for small sample datasets where there is an imbalanced class distribution among the positive, negative and neutral sentiment classes. Our results summarize our findings on the suitability of text oversampling for imbalanced small sample datasets that are used to fine-tune state-of-the-art pre-trained transformer models, and the utility of domain-specific transformer models for the classification task.
Introduction
Public health officials increasingly rely on social media sentiment analysis to track vaccine hesitancy and public opinion in real-time. However, researchers face two major hurdles in this domain: Small Sample Size (SSS) and significant Class Imbalance. High-quality, human-annotated datasets are often small, making it difficult for deep learning models to generalize. Furthermore, in the context of vaccines, "Neutral" posts—often sharing news or facts—vastly outnumber "Negative" or "Positive" sentiments. Standard machine learning often fails here because models become biased toward the majority class. This paper investigates whether domain-specific pre-training and language-model-based oversampling can mitigate these issues.
Methodology
The researchers compared two categories of Transformer models: general-purpose models (BERT, RoBERTa, and XLNet) and domain-specific models (CT-BERT, trained on 160 million COVID-19 tweets, and BERTweet, trained on 850 million general English tweets).
To tackle class imbalance, the study employed the Language Model based Oversampling Technique (LMOTE). Unlike traditional methods like SMOTE that interpolate vectors in Euclidean space, LMOTE trains a Bidirectional LSTM on the minority class to generate new, synthetically realistic tweets. This process aims to provide Transformer models with more examples of minority sentiments without losing semantic coherence.
Dataset and Pre-processing
The study utilized a subset of a popular Kaggle dataset of COVID-19 vaccine tweets, annotated for three sentiment classes:
- Total: 6,000 tweets
- Neutral (Majority): 3,680 tweets
- Positive: 1,900 tweets
- Negative (Minority): 420 tweets
Data pre-processing involved several cleaning steps, including the removal of @mentions, hashtags, websites, and specific punctuation to normalize the text before feeding it into the transformer architectures.
Key Results and the "Oversampling Paradox"
The experimental results revealed a clear hierarchy in model performance. Domain-specific models significantly outperformed general-purpose models, with CT-BERT achieving the highest accuracy (77.70%) and F1-score (0.70) on the original imbalanced dataset. These models proved better at understanding Twitter-specific syntax and the nuanced context of pandemic-related terms.
However, the study uncovered a surprising "oversampling paradox": oversampling the minority classes using LMOTE led to a slight dip in performance across almost all models. For instance, CT-BERT's accuracy fell to 76.14% when trained on the augmented dataset. While LMOTE proved far superior to standard SMOTE (which caused accuracies to plummet to ~56%), it still introduced enough noise to degrade the decision boundaries of the high-performing transformers.
Limitations and Future Work
The primary limitation identified was the quality of synthetic data. While LMOTE is more sophisticated than vector interpolation, the generated tweets can sometimes result in a "word salad" that lacks the logical flow of human speech, as seen in the examples below.
Future work will focus on refining text augmentation techniques, potentially leveraging Large Language Models (LLMs) like GPT-4 to generate more coherent synthetic training data, and adapting these domain-specific models for broader public health monitoring systems.
Summary updated