Optimization Techniques for Dealing with Small Dataset for Sentiment Analysis

Isfaque Al Kaderi Tuhin, Zhengkui Wang, Xiaorong Li, Wei ZhangJournal of Advances in Information Technology 2025

Abstract

Sentiment analysis is crucial for many organizations, including those in the transportation industry which use it to gain insights into current issues and improve services provided by public transport operators. However, industries such as transportation face difficulties in fully utilizing AI tools due to the lack of annotated, domain specific datasets. This scarcity often stems from challenges such as the sensitive nature of the data and a shortage of manpower dedicated to data annotation. Although many sentiment analysis technologies exist, including state-of-the art transformer-based models, typically require access to large, annotated datasets. This creates a gap in solutions for scenarios characterized by limited and imbalanced data. Our research aims to address this gap by systematically exploring strategies for optimizing sentiment analysis with small, imbalanced datasets for multi-class sentiment classification tasks. We consider constraints posed by data privacy and resource limitations, proposing methodologies that enhance sentiment analysis accuracy without the need for large datasets or extensive annotation efforts. Using RoBERTa, a transformer-based pre-trained model designed for sentiment analysis, and a combination of optimization and data augmentation techniques, we aim to extend the capabilities of sentiment analysis models to perform effectively in data sparse situations. Our approach addresses the challenges of small datasets and contributes to the broader field of sentiment analysis by offering scalable solutions that can be adapted to various domain-specific environments. Our experimentation has achieved significant improvements in prediction accuracy, demonstrating the feasibility and effectiveness of our approach. By integrating theoretical insights with practical applications, our study sheds light on the untapped potential of small datasets in sentiment analysis. It provides a roadmap for leveraging advanced optimization techniques and innovative data processing strategies to achieve high levels of accuracy, thus opening new avenues for research and application in areas where data is inherently limited.

Introduction

State-of-the-art Natural Language Processing (NLP) models, particularly transformers like BERT and RoBERTa, are notoriously "data-hungry," typically requiring tens of thousands of labeled examples to reach peak performance. However, in specialized sectors like public transportation, data is often scarce, sensitive, and imbalanced. Manual annotation is expensive, and privacy regulations like GDPR or Singapore’s PDPA restrict large-scale data sharing. This paper addresses the "small dataset" gap, focusing on multi-class sentiment classification in the transportation domain.

Methodology

The researchers propose a multi-stage optimization pipeline that moves beyond simple fine-tuning to achieve high performance in data-sparse environments.

The proposed multi-stage optimization pipeline for sentiment analysis.

Key components of the methodology include:

  • Model Selection: RoBERTa was selected as the backbone architecture due to its superior performance in understanding nuanced, short-form text.
  • Stratified Splitting: Instead of random shuffling, stratified sampling was used to ensure training and testing sets maintained the same class proportions as the original imbalanced dataset.
  • Synthetic Data Augmentation via GPT-4: To address class imbalance, GPT-4 generated 50 additional synthetic text samples for minority classes, injecting linguistic diversity into the training set.
  • Hyperparameter Optimization: Rigorous testing identified optimal settings for small data: a low learning rate ($1e-6$), a batch size of 16, and training over 40 epochs.

Data and Distribution

The study validated its approach using three primary datasets: the Transportation Feedback Corpus (TFC), the Gold Standard Corpus (GSC), and Amazon Reviews (AMZ). A major hurdle across these datasets was the inherent imbalance in real-world feedback.

Comparison of class distributions in the training and testing sets after stratified splitting.

As illustrated in the distribution charts, classes such as "Negative" and "Neutral" are far more frequent than polar extremes. Stratified splitting is mandatory in these scenarios to prevent the model from becoming overly biased toward majority classes during training.

Results and Discussion

The optimization techniques yielded significant quantitative gains. The unoptimized RoBERTa model started with an F1-score of 0.49, which climbed to 0.73 after the full optimization pipeline was applied. These results were remarkably consistent across different domains, including the SMRT (transport) and Amazon datasets.

Qualitative analysis revealed an "Adjacent Error" phenomenon: when the model erred, it almost always predicted an adjacent class (e.g., labeling "Very Negative" as "Negative") rather than a polar opposite. This indicates strong semantic polarity awareness despite the small training size. Furthermore, the process proved computationally efficient, with training taking approximately 474 seconds on a consumer-grade GPU.

Conclusion

This research proves that massive datasets are not always a prerequisite for deep learning success in sentiment analysis. By combining advanced transformer models with strategic data augmentation and sampling, high accuracy can be achieved in data-constrained environments. Future work will explore more sophisticated prompt engineering for synthetic data and test the framework in other sensitive fields like healthcare and finance.

Summary updated

BibTeX
@article{tuhin2025optimization,
  author = {Isfaque Al Kaderi Tuhin and Zhengkui Wang and Xiaorong Li and Wei Zhang},
  title = {{Optimization Techniques for Dealing with Small Dataset for Sentiment Analysis}},
  journal = {Journal of Advances in Information Technology},
  year = {2025},
  doi = {10.12720/jait.16.9.1226-1235},
}
Figure