Abstract
Training machine learning and deep learning models on unbalanced datasets can lead to a bias portrayed by the models towards the majority classes. To tackle the problem of bias towards majority classes, researchers have presented various techniques to oversample the minority class data points. Most of the available state-of-the-art oversampling techniques generate artificial data points which cannot be comprehensibly understood by the reader, despite the synthetic data points generated being similar to the original minority class data points. In this work, we present Topic-based Language Modelling Approach for Text Oversampling (TLMOTE), a novel text oversampling technique for supervised learning from unbalanced datasets. TLMOTE improves upon previous approaches by generating data points which can be intelligibly understood by the reader, can relate to the main topics of the minority class, and introduces more variations to the synthetic data generated. We evaluate the efficacy of our approach on various tasks like Suggestion Mining SemEval 2019 Task 9 Subtasks A and B, SMS Spam Detection, and Sentiment Analysis. Experimental results verify that oversampling unbalanced datasets using TLMOTE yields a higher macro F1 score than with other oversampling techniques.
Introduction: The Challenge of Class Imbalance
Class imbalance is a pervasive issue in machine learning where the disproportionate size of a majority class causes classifiers to neglect minority class patterns. In text classification, this often leads to high accuracy but poor performance on the critical minority samples. Traditional oversampling methods like SMOTE operate in vector space, often producing "word soup" that lacks semantic coherence. Newer language-model-based approaches like LMOTE improve readability but frequently suffer from "duplicity," generating repetitive, nearly identical sentences that lead to overfitting.
Methodology: TLMOTE
TLMOTE addresses these limitations through a two-stage generation pipeline designed for both relevance and diversity.
1. Topic-Based Seed Selection
To ensure synthetic samples remain relevant to the minority class, TLMOTE employs Latent Dirichlet Allocation (LDA) to identify core topics and keywords. It extracts 5-gram sequences from the original minority data that contain these keywords, using them as "seeds" for the generation process.
2. Randomized Multi-Model Generation
To combat the issue of repetitive text, TLMOTE utilizes an ensemble of three BiLSTM-based language models. Each model is trained with a different context window (4, 5, and 6 tokens). During the generation phase, the system randomly selects a prediction from one of these three models at each step. This randomized approach, termed TLMOTE(R), introduces the necessary variation to prevent the generator from falling into repetitive loops.
Experimental Evaluation
The efficacy of TLMOTE was tested across four benchmark datasets:
- SemEval 2019 Task 9 (Subtasks A & B): Suggestion mining from forums and reviews.
- SMS Spam Detection: Identifying spam vs. ham messages.
- COVID-19 Vaccine Tweets: Sentiment analysis (Negative, Neutral, Positive).
The researchers compared TLMOTE against standard classifiers including SVM, Random Forest, and deep learning architectures like CNN-LSTMs.
Results and Discussion
TLMOTE(R) consistently outperformed existing oversampling techniques, achieving the highest Macro F1 scores across various tasks. The improvement was particularly notable in deep learning models, where the increased diversity of synthetic samples acted as a regularizer.
Visual analysis using Principal Component Analysis (PCA) revealed that TLMOTE synthetic samples cover the "boundaries" of the minority class more uniformly than previous methods. This broader coverage helps classifiers better delineate the decision boundary between classes. Furthermore, qualitative assessment confirmed that TLMOTE produces grammatically coherent and diverse sentences, significantly improving upon the "duplicity" issues found in LMOTE.
Conclusion
TLMOTE represents a significant step forward in text oversampling by prioritizing both intelligibility and diversity. By grounding generation in topic-based seeds and utilizing a randomized multi-model ensemble, it provides a robust solution for training classifiers on imbalanced text data. Future work may explore dynamic stopping criteria for sentence generation and reducing the computational overhead of training multiple language models.
Summary updated