[Paper Review] Few-Shot Text Classification with Pre-Trained Word Embeddings and a Human in the Loop
This paper proposes a human-in-the-loop few-shot text classification method that uses pre-trained word embeddings and cosine similarity to classify entire document batches with only one or two human-labeled examples per category. By leveraging LDA for topic inference and averaging word embeddings with TF-IDF weighting, the approach achieves up to 97% accuracy on small, distinct-category datasets, demonstrating feasibility for low-resource classification tasks.
Most of the literature around text classification treats it as a supervised learning problem: given a corpus of labeled documents, train a classifier such that it can accurately predict the classes of unseen documents. In industry, however, it is not uncommon for a business to have entire corpora of documents where few or none have been classified, or where existing classifications have become meaningless. With web content, for example, poor taxonomy management can result in labels being applied indiscriminately, making filtering by these labels unhelpful. Our work aims to make it possible to classify an entire corpus of unlabeled documents using a human-in-the-loop approach, where the content owner manually classifies just one or two documents per category and the rest can be automatically classified. This "few-shot" learning approach requires rich representations of the documents such that those that have been manually labeled can be treated as prototypes, and automatic classification of the rest is a simple case of measuring the distance to prototypes. This approach uses pre-trained word embeddings, where documents are represented using a simple weighted average of constituent word embeddings. We have tested the accuracy of the approach on existing labeled datasets and provide the results here. We have also made code available for reproducing the results we got on the 20 Newsgroups dataset.
Motivation & Objective
- To address the challenge of classifying large, unlabeled document corpora in industry settings where few or no labels exist.
- To enable accurate text classification with minimal human labeling by using few-shot learning and human-in-the-loop selection of category representatives.
- To evaluate the effectiveness of pre-trained word embeddings and LDA-based topic modeling in identifying high-quality category prototypes for few-shot classification.
- To explore the scalability and limitations of the method on datasets with more than a few categories.
- To improve topic inference for prototype selection using guided or neural topic models in future work.
Proposed method
- Documents are embedded using a weighted average of pre-trained word embeddings, with TF-IDF used to down-weight frequent words.
- Latent Dirichlet Allocation (LDA) is applied to each batch to identify representative documents for each category, which are then presented to the human user.
- The user manually labels one or two documents per category, and their embeddings are averaged to form a category prototype vector.
- Unlabeled documents are classified by computing cosine similarity between their embedding and each category prototype, assigning the closest match.
- The system uses PCA on document embeddings, though experiments show minimal accuracy gain over simple averaging.
- The method is evaluated on 20 Newsgroups and DBPedia subsets, with brute-force testing used to establish maximum achievable accuracy on small subsets.
Experimental results
Research questions
- RQ1Can a few-shot text classification system achieve high accuracy using only one or two human-labeled examples per category?
- RQ2How effective is LDA in identifying representative documents that serve as high-quality category prototypes?
- RQ3Does using pre-trained word embeddings with TF-IDF weighting and cosine similarity yield competitive classification performance in few-shot scenarios?
- RQ4What are the limitations of the method when applied to datasets with more than four or five categories?
- RQ5Can guided or neural topic models improve the topic inference step to better support prototype selection in future work?
Key findings
- The method achieved a maximum accuracy of 97% on a 4-category subset of the DBPedia dataset when optimal category representatives were selected.
- LDA was effective in identifying good representative documents in many cases, though performance varied and sometimes failed to separate topics clearly.
- The use of PCA on document embeddings provided little to no improvement in classification accuracy over simple averaging of word embeddings.
- The approach works best on datasets with 2–3 distinct categories where word usage clearly differentiates classes.
- The method showed promise for binary classification tasks such as stance detection, where opposing terms reflect different positions on a topic.
- Future improvements are expected by enhancing topic inference through guided LDA, Gaussian LDA, or neural topic models like ProdLDA.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.