Abstract
Weakly supervised text classification (WSTC), often referred to as zero-shot or dataless classification, is a critical task for processing large-scale text data in dynamic environments where labeled datasets are unavailable. Traditional methods rely on a limited set of seed words to represent categories but often fail to capture the nuanced correlations between these words. In this paper, we introduce RulePrompt, a framework that enhances Pre-trained Language Models (PLMs) by mining and utilizing logical rules. RulePrompt establishes a self-iterative loop where mined logical expressions (e.g., "word A AND word B") improve pseudo-label generation, which in turn refines the rules. Our experiments demonstrate that RulePrompt significantly outperforms state-of-the-art weakly supervised methods across multiple benchmarks, providing both high accuracy and human-readable interpretability.
Introduction
The challenge of text classification in the "dataless" era is to categorize information using only a handful of category-indicative seed words. While prompting PLMs like RoBERTa has improved performance by leveraging internal knowledge, most existing approaches treat category words as independent entities—a "bag-of-words" strategy that ignores context.
Consider the word "penalty." In a sports context, it likely refers to a foul; in a legal context, it refers to a punishment. Without context, a model might misclassify a sports article as a legal one. However, the logical conjunction of "penalty" AND "goal" almost exclusively identifies the "Sports" category. RulePrompt addresses this by moving beyond single-word indicators to capture complex correlations through logical rules, allowing the model to adapt its understanding to the specific nuances of an unlabeled corpus.
The RulePrompt Framework
RulePrompt operates through a self-iterative closed loop consisting of three primary modules: Rule Mining, Rule-Enhanced Pseudo Label Generation, and Self-Supervised Fine-Tuning.
1. Rule Mining Module
Starting with initial seed words, the system analyzes unlabeled text to identify frequent patterns. It categorizes these patterns into two logical forms:
- Disjunctive Rules (OR): These represent strong, independent indicators (e.g., "war" OR "palestinian" for Politics).
- Conjunctive Rules (AND): These represent pairs of words that are individually weak or ambiguous but collectively strong (e.g., "world" AND "foreign").
2. Rule-Enhanced Pseudo Label Generation
To assign labels to unlabeled data, RulePrompt evaluates text through three distinct "lenses":
- Verbalizer-based: Expanding the set of label-equivalent words within the PLM's prompt space.
- Embedding-based: Measuring the global semantic similarity between the document and the logical rule representation.
- Word Overlapping: A local check for literal matches between the text and the mined rules.
3. Self-Supervised Fine-Tuning
To prevent the PLM from remaining a static observer, the model is fine-tuned on its own high-confidence predictions. By using an entropy loss function, the model aligns its internal representations with the specific vocabulary and distribution of the target dataset, effectively "specializing" the general-purpose PLM for the task at hand.
Experimental Evaluation
We evaluated RulePrompt on three benchmark datasets representing different classification challenges:
- AGNews: A large-scale news topic classification dataset.
- NYT (New York Times): A dataset characterized by high class imbalance.
- IMDB: A binary sentiment analysis dataset.
Performance Highlights
RulePrompt consistently outperformed existing state-of-the-art (SOTA) methods such as NPPrompt and PromptClass:
- AGNews: Achieved a Micro-F1 score of 0.897, a substantial improvement over NPPrompt’s 0.692.
- IMDB: Reached a score of 0.940, nearly matching the performance of a fully supervised BERT model (0.945).
- NYT: Maintained a robust Micro-F1 of 0.822, demonstrating stability even in the face of imbalanced data.
Key Insights
The Power of Logical Conjunction
Ablation studies revealed that the "AND" logic is vital for disambiguation. For instance, while the word "architecture" is shared by multiple fields, RulePrompt distinguishes "Real Estate" (architecture AND residential) from "Arts" (architecture AND museum). This capability allows the model to resolve confusion between closely related categories.
Mutual Enhancement and Interpretability
The iterative nature of RulePrompt creates a "bootstrapping" effect: cleaner pseudo-labels lead to more precise rules, which then generate even more accurate labels. Unlike "black-box" neural models, RulePrompt provides a set of human-readable logical rules for every category. This transparency allows researchers to inspect the model's logic, making the system easier to debug and trust in production environments.
Conclusion and Future Work
RulePrompt demonstrates that logical rules are a powerful bridge between human knowledge (seed words) and machine learning (PLMs). While the current model excels with AND/OR logic, future iterations could benefit from a "NOT" operator to explicitly exclude confusing terms. Additionally, while the model is stable, further research is needed to optimize performance on extremely niche categories in highly imbalanced datasets. Overall, RulePrompt offers a scalable, interpretable, and highly accurate solution for weakly supervised text classification.
Summary updated