NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Weakly-supervised Text Classification Based on Keyword Graph

Lu Zhang, Jiandong Ding, Yi Xu, Yingyao Liu, Shuigeng Zhou

Abstract

Weakly-supervised text classification (WTC) leverages user-provided seed keywords to categorize unlabeled data, mitigating the need for extensive manual labeling. However, traditional methods often treat keywords as independent entities, failing to account for polysemy and contextual correlations. This paper presents ClassKG (Classification with Keyword Graph), an iterative framework that models keywords as nodes in a graph. By utilizing Graph Neural Networks (GNNs) to capture structural relationships, ClassKG effectively disambiguates keywords based on their local topology. Experimental results demonstrate that ClassKG significantly outperforms existing state-of-the-art methods, particularly on complex, fine-grained datasets.

Introduction

Supervised text classification models are notoriously data-hungry. Weakly-supervised approaches offer a solution by using high-level "seed" keywords to generate pseudo-labels. Despite their promise, most existing WTC methods rely on a "bag-of-keywords" approach, assigning labels based on keyword frequency. This approach is fundamentally limited by keyword correlation and polysemy. For instance, the word "windows" might refer to an operating system in a technology context or a vehicle component in a transportation context. Without understanding these relationships, models frequently mislabel documents where keywords appear in non-target contexts.

The ClassKG Framework

The authors introduce ClassKG, which transforms pseudo-labeling into a graph-based task to capture keyword context. The framework operates through an iterative pipeline:

  1. Keyword Graph Construction: A master graph is built where nodes represent keywords and edges denote co-occurrence within the unlabeled corpus.
  2. Subgraph Annotation: Each document is mapped to a subgraph of the master keyword graph. Labeling then becomes a graph-level classification problem.
  3. GNN-based Annotator: A Graph Isomorphism Network (GIN) propagates information across the graph, learning contextualized keyword representations.
  4. Self-Supervised Pre-training: To stabilize the GNN, a self-supervised "pretext" task involving random walks is employed to teach the model structural properties before label exposure.
  5. Iterative Refinement: Pseudo-labels from the GNN train a standard classifier (e.g., BERT), which then re-extracts refined keywords for the next iteration.
The iterative ClassKG framework for weakly-supervised text classification.

Key Insights

The core innovation of ClassKG lies in treating context as a structural property. By converting text into subgraphs, the model bridges natural language processing with geometric deep learning. This allows for the disambiguation of terms like "windows" by examining their neighbors (e.g., "Microsoft" vs. "car") within the graph topology. Furthermore, the self-supervised pre-training phase acts as a critical regularizer, preventing "negative transfer" from noisy initial labels.

Experimental Evaluation

ClassKG was evaluated on several benchmarks covering both long-form and short-form text:

  • Long-text: 20 Newsgroups and The New York Times (NYT), featuring both coarse and fine-grained categories.
  • Short-text: AG News, DBPedia, IMDB, and Amazon reviews.

Results and Discussion

ClassKG achieved substantial performance gains over previous state-of-the-art models like ConWea and LOTClass. On the fine-grained 20 Newsgroups dataset, ClassKG reached a Macro-F1 score of 0.77, a significant improvement over ConWea's 0.64. The model also demonstrated high accuracy on short-text datasets, hitting 98% on DBPedia and 92.6% on Amazon reviews.

Performance comparison of ClassKG against baselines across iterations.

As shown in the performance metrics, the inclusion of self-supervised learning (SSL) provides a consistent boost over the "w/o SSL" variant, and both graph-based approaches vastly outperform simple keyword counting. The model typically converges by the third iteration, demonstrating high efficiency.

Conclusion

ClassKG represents a significant advancement in weakly-supervised text classification by moving beyond independent keyword analysis to a graph-based contextual approach. While the model remains sensitive to initial keyword quality and introduces some structural complexity, its ability to handle polysemy and fine-grained categories sets a new benchmark for the field. Future work will focus on optimizing keyword extraction and exploring more complex network architectures.

Summary updated

BibTeX
@inproceedings{zhang2021weakly,
  author = {Lu Zhang and Jiandong Ding and Yi Xu and Yingyao Liu and Shuigeng Zhou},
  title = {{Weakly-supervised Text Classification Based on Keyword Graph}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.222},
}
Figure