PIEC lass: Weakly-Supervised Text Classification with Prompting and Noise-Robust Iterative Ensemble Training (2023)

Abstract: Weakly-supervised text classification trains a classifier using the label name of each target class as the only supervision, which largely reduces human annotation efforts. Most existing methods first use the label names as static keyword-based features to generate pseudo labels, which are then used for final classifier training. While reasonable, such a commonly adopted framework suffers from two limitations: (1) keywords can have different meanings in different contexts and some text may not have any keyword, so keyword matching can induce noisy and inadequate pseudo labels; (2) the errors made in the pseudo label generation stage will directly propagate to the classifier training stage without a chance of being corrected. In this paper, we propose a new method, PIEClass, consisting of two modules: (1) a pseudo label acquisition module that uses zero-shot prompting of pre-trained language models (PLM) to get pseudo labels based on contextualized text understanding beyond static keyword matching, and (2) a noise-robust iterative ensemble training module that iteratively trains classifiers and updates pseudo labels by utilizing two PLM fine-tuning methods that regularize each other. Extensive experiments show that PIEClass achieves overall better performance than existing strong baselines on seven benchmark datasets and even achieves similar performance to fully-supervised classifiers on sentiment classification tasks.

## introduction text classification is a fundamental nlp task with a wide range of downstream applications, such as question answering @xcite , sentiment analysis @xcite , and event detection @xcite . earlier studies train text classifiers in a fully-supervised manner that requires a substantial amount of training data @xcite , which are generally costly to obtain. to eliminate the need for labeled training samples, weakly-supervised text classification settings @xcite @xcite are proposed, which aim to train text classifiers using the label names of target classes as the only supervision. such settings are intriguing especially when obtaining high-quality labels is prohibitively expensive. recent advancements in large generative language models (llms) (e.g., chatgpt, gpt-4 (ope-nai, 2023)) make it a valid approach to directly prompt them in a zero-shot manner for text classification without labeled data. for example, people may provide a restaurant review and ask an llm "what is the sentiment of this document?", and the model will generate an answer according to its understanding. however, there are certain limitations of this method for the weakly-supervised text classification setting. first, directly prompting llms cannot utilize any domain-specific information hidden in the unlabeled data, because it is intractable to fine-tune such a large model and the prompts can hardly incorporate any corpus-level information, especially for corpora not appearing in llms' pre-training data (e.g., private domains). second, deploying llms is expensive, while many text classification applications require fast real-time inference (e.g., email and review classification). another line of studies tailored for weaklysupervised text classification aims to train a moderate-size classifier with a task-specific unlabeled corpus. given the label names, these methods first acquire class-indicative keywords using plms @xcite or corpus-level co-occurrence features @xcite . the keywords are then used as static features to generate pseudo-labeled documents for fine-tuning the final classifier. de-spite their promising performance, the aforementioned weakly-supervised methods may suffer from two major limitations. first, these methods are keyword-driven by using class-indicative keywords as static context-free features to generate pseudo labels with different forms of string matching. however, some texts may not contain such classindicative keywords and keywords may have different meanings in different contexts, so using them as static features can lead to noisy and inadequate pseudo labels. such an issue is more serious for abstract classes like sentiments that require understanding rhetoric. for example, a food review "it is to die for!" contains the keyword "die" which itself is negative, but the entire review expresses a strong positive sentiment, and keyword-driven methods will likely struggle in these cases. second, most existing methods are two-stage by conducting pseudo label acquisition and text classifier training in two successive steps. although different pseudo label acquisition methods are explored to improve their quality (e.g., masked language modeling @xcite , clustering of plm embeddings @xcite , or large textual entailment models trained with external data @xcite ), there is still a large performance gap between weakly-supervised and fully-supervised settings, because erroneous pseudo labels in the first stage will propagate to and harm the classifier training stage without a chance to be corrected. to address the limitations of existing works, in this paper, we propose pieclass: prompting and iterative ensemble training for weakly-supervised text classification. pieclass consists of two modules. (1) pseudo label acquisition via plm prompting. by designing a task-specific prompt, we can apply a moderate-size plm to infer the class label of documents based on the entire input sequence, which is thus contextualized and beyond static keyword features. in this work, besides the well-studied prompting method using plms pre-trained with the masked language modeling task (mlm) (e.g., bert @xcite , roberta @xcite ), we also explore a different prompting method for a discriminative pretrained language model, electra @xcite , and compare them in the experiments. (2) noise-robust training with iterative ensemble. in each iteration, we train text classifiers using the current pseudo labels and then use the confident predictions to re-select the pseudo labels. in this way, we can gradually expand the pseudo labels which can be used to train better text classifiers. to avoid erroneous pseudo labels accumulated during the iterative process, we propose to utilize two plm fine-tuning strategies, head token fine-tuning and prompt-based fine-tuning, as two complementary views of the data: one captures the semantics of the entire sequence while the other interprets the contexts based on the prompts. we use the two views to regularize each other and further apply model ensemble to improve the noise robustness of the pseudo label expansion process. to summarize, the contributions of this paper are as follows: (1) we propose to use the contextualization power of plm prompting to get pseudo labels for the weakly-supervised text classification task instead of static keyword-based features. (2) we explore the prompting method of a discriminative plm on the text classification task and compare it with prompting methods for mlm. (3) we propose a noise-robust iterative ensemble training method. to deal with noisy pseudo labels, we utilize two plm fine-tuning strategies that regularize each other and apply model ensemble to enhance the pseudo label quality. (4) on seven benchmark datasets, pieclass overall performs better than strong baselines and even achieves similar performance to fully-supervised methods. ## problem definition the weakly-supervised text classification task aims to train a text classifier using label names as the only supervision. formally, given a set of documents @xmath0, . . . , d n } and m target classes @xmath1, . . . , c m } with their associated label names l(c), our goal is to train a text classifier f that can classify a document into one of the classes. for example, we may classify a collection of news articles using the label names "politics", "sports", and "technology". notice that, there are previous studies using more than one topic-indicative keyword or a few labeled documents as supervision, whereas here, we follow the extremely weak supervision setting @xcite and only use the sole surface name of each class as supervision. ## methodology to address the limitations of existing methods for weakly-supervised text classification, we introduce our method, pieclass, in this section, which contains two major modules: (1) zero-shot prompting ## related work weakly-supervised text classification weakly-supervised text classification aims to train a classifier with very limited supervision. earlier studies utilize distant supervision from knowledge bases such as wikipedia to interpret the document-label semantic relevance @xcite @xcite . some other supervision signals such as keywords @xcite @xcite @xcite ) and heuristic rules @xcite @xcite are also explored to reduce the efforts of acquiring any labels or domain-specific data. recently, the extremely weakly-supervised settings, where only the label name of each class is utilized as supervision, are studied and achieve inspiring results @xcite @xcite . lotclass @xcite fine-tunes an mlm-based plm for category prediction and generalizes the model with self-training. conwea @xcite ) leverages seed words and contextualized embeddings to disambiguate the keywords for each class. xclass @xcite utilizes keywords to obtain static representations of classes and documents and generates pseudo labels by clustering. classkg @xcite learns the correlation between keywords by training a gnn over a keyword co-occurrence graph. however, these methods only depend on static keyword features, leading to noisy pseudo-labeled documents for classifier training. lops @xcite studies the order of pseudo label selection with learning-based confidence scores. a concurrent work megclass @xcite studies how different text granularities can mutually enhance each other for document-level classification. data programming is another line of work on weak supervision. these methods either require domain knowledge to provide heuristic rules @xcite or some labeled samples to induce labeling functions @xcite , or both @xcite @xcite . in this paper, we focus on training text classifiers with extremely weak supervision, i.e., using only the label names as supervision, so we do not compare with data programming methods that require additional knowledge like textual patterns and keyword lists @xcite . prompt-based learning plms @xcite @xcite have shown superior performance on various downstream tasks through fine-tuning with task-specific data. some papers show that plms can learn generic knowledge during the pre-training stage and design cloze-style prompts to directly probe its knowledge without fine-tuning @xcite @xcite . later, task-specific prompts are used to guide plm fine-tuning and perform well in a low-resource setting for several tasks, such as text classification @xcite , relation extraction @xcite , and entity typing @xcite . recent works use prompts for keyword or rule discovery @xcite or directly prompt large plms for weak supervision @xcite . to mitigate the human efforts in prompt engineering, researchers also study automatic methods including prompt search @xcite and prompt generation @xcite . soft prompts are also proposed by tuning some randomly initialized vectors together with the input @xcite @xcite . @xcite also shows that the co-training method can benefit prompt-based learning in a few-shot setting. besides standard prompting methods for mlmbased plms, prompting methods for discriminative plms are also studied on few-shot tasks @xcite @xcite . ## conclusion and future work in this paper, we study the task of weaklysupervised text classification that trains a classifier using the label names of target classes as the only supervision. to overcome the limitations of existing keyword-driven methods, we propose pieclass which consists of two modules: (1) an initial pseudo label acquisition module using zeroshot plm prompting that assigns pseudo labels based on contextualized text understanding, and (2) a noise-robust iterative ensemble training module that utilizes two plm fine-tuning methods with model ensemble to expand pseudo labels while ensuring the quality. extensive experiments show that pieclass can achieve overall better performance than strong baselines, especially on the sentiment classification task where pieclass achieves similar performance to a fully-supervised baseline. there are three future directions that can be explored. first, we can extend our method to other forms of text data (e.g., social media) and other abstract classes (e.g., stance detection, morality classification) that require deeper text understanding and keyword-driven methods will likely fail. second, pieclass can be integrated with keyword-based methods as two types of training signals to further improve the performance of weakly-supervised text classification. third, the idea of pieclass is also generalizable to other text mining tasks with limited supervision, such as named entity recognition and relation extraction.