SetFit
Few-shot text classification framework using Sentence Transformers.
About
Few-shot text classification without prompt engineering is the focus of SetFit, an open-source framework from Hugging Face. Instead of wrapping examples in handcrafted prompts for a large language model, it fine-tunes a pretrained Sentence Transformer with contrastive learning on a small number of labeled pairs, then trains a lightweight classification head, either a scikit-learn classifier or a PyTorch alternative, on the resulting embeddings. With as few as eight labeled examples per class it can match models trained on far larger datasets, and because the underlying encoder is small, both training and inference are fast and cheap compared with LLM-based approaches. Multilingual classification works by swapping in a multilingual Sentence Transformer checkpoint. The library exposes two main components, SetFitModel and Trainer, integrates with the Hugging Face Hub for sharing checkpoints, and installs with pip. It suits teams that need production text classifiers for tasks like sentiment, intent, or topic labeling but have little labeled data.
Reviews (0)
Leave a Review
No reviews yet. Be the first to review!
Details
- Category
- Natural Language Processing
- Price
- Free
- Platform
- Local/Desktop
- Difficulty
- Easy (2/5)
- License
- Apache-2.0
- Added
- Apr 3, 2026
Related Tools
Topic modeling library leveraging transformer embeddings and c-TF-IDF.
Simple framework for state-of-the-art NLP by Zalando Research.
Library for efficient text classification and word representation by Meta.
Topic modeling and document similarity library for unsupervised NLP.
Generalist model for named entity recognition using bidirectional transformer.
Research library for NLP by AI2 built on PyTorch.