Abstract
Pre-trained Transformer models have become popular in various Natural Language Processing (NLP) tasks, following a two-step process of ’pre-training’ and ’fine-tuning’. However, with the abundance of information on the web, some domain knowledge may be lacking. This can result in poor performance during the fine-tuning step when there is limited training data available. To address this issue in the case of limited data, we propose a knowledge graph-based data expansion method that enables the model to achieve good results even when there is limited data in the fine-tuning step. We extract entities in the text through Named Entity Recognition and then search for related information in the knowledge graph to expand the text’s content. This allows the pretrained model to acquire more external knowledge and enhance its training. We used our data expansion method to conduct experiments on the following well-known models, i.e., BERT, RoBERTa, and GPT-3. Our experiments show that our approach can improve the accuracy of language models on text classification tasks when training data is limited.
Introduction
While Transformer-based models have revolutionized Natural Language Processing (NLP), they remain notoriously "data-hungry." To perform well on a specific task—like identifying sarcasm or categorizing niche news—they typically require a large volume of labeled examples during the fine-tuning phase.
This creates a bottleneck for researchers and developers working with limited datasets or specialized domains where labeled data is expensive to produce. Furthermore, short texts (like news headlines) often lack sufficient internal context for a model to understand the nuances of the subject matter. This paper addresses this "context gap" by investigating whether supplemental training via automatically injected external world knowledge can mitigate the need for large labeled datasets.
Methodology
The proposed approach utilizes a Knowledge Graph-based data expansion method to augment input text before it reaches the classification model. The workflow follows a multi-stage pipeline:
- Named Entity Recognition (NER): The system scans the input text to identify key entities such as people, organizations, or locations.
- Knowledge Graph Query: Identified entities are sent to the Google Knowledge Graph API.
- Information Retrieval: The system retrieves a "short description" for each entity. For instance, if the text mentions "Netflix," the KG might return "American technology and media services provider."
- Text Augmentation: This description is appended directly to the original text, creating an "enhanced" version.
- Model Training/Inference: For models like BERT and RoBERTa, the architecture is fine-tuned on this augmented text. For Large Language Models like GPT-3, the KG descriptions are included in the few-shot prompt to provide immediate context.
Experimental Setup
The researchers evaluated their approach on two primary tasks:
- Sarcasm Detection: Utilizing the News Headlines Dataset for Sarcasm Detection. This binary classification task involves short, often cryptic headlines where context is critical.
- News Category Classification: Utilizing Kaggle’s News Category Dataset. This multi-class problem features 25 categories and a highly imbalanced distribution, testing the model's ability to handle rare classes.
Results and Analysis
The results consistently demonstrated that incorporating Knowledge Graph data significantly outperforms baseline Transformer models, particularly in low-data regimes.
Sarcasm Detection Performance
In experiments with a limited training set of 505 samples, the addition of KG data led to substantial performance gains. BERT’s accuracy rose from 77.6% to 81.6%, while RoBERTa saw a dramatic improvement from 70.6% to 81.2%.
Broader Impact
- News Category Classification: BERT’s accuracy improved from 67.9% to 73.4% after incorporating KG descriptions, showing the method's efficacy in multi-class settings.
- Prompting GPT-3: Even without fine-tuning, adding KG descriptions to the prompt increased GPT-3’s sarcasm detection accuracy from 68.0% to 70.3%.
- Semantic Anchoring: External descriptions act as semantic anchors, allowing the model to link niche entities to its broader pre-trained knowledge. This is especially potent for short-form text, where adding a 15-word description can double the available information density.
Conclusion and Future Work
This study demonstrates that Knowledge Graph-based data expansion is a versatile and effective way to improve NLP model performance when labeled data is scarce. By providing external context, models can overcome the limitations of short or domain-specific text.
Future research will focus on reducing dependency on external APIs to mitigate latency and exploring more complex relational data (KG triples) beyond simple text descriptions. Additionally, addressing potential noise from irrelevant entity descriptions remains a key area for refinement.
Summary updated