SetFit
This is a SetFit model that can be used for Text Classification. A OneVsRestClassifier instance is used for classification.
The model has been trained using an efficient few-shot learning technique that involves:
- Fine-tuning a Sentence Transformer with contrastive learning.
- Training a classification head with features from the fine-tuned Sentence Transformer.
Model Details
Model Description
- Model Type: SetFit
- Classification head: a OneVsRestClassifier instance
- Maximum Sequence Length: 512 tokens
- Number of Classes: 8 classes
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
Evaluation
Metrics
Label | F1_Micro | F1_Macro | F1_Weighted | Precision | Accuracy | Recall |
---|---|---|---|---|---|---|
all | 0.8505 | 0.3573 | 0.7613 | 0.9125 | 0.8797 | 0.7964 |
Uses
Direct Use for Inference
First install the SetFit library:
pip install setfit
Then you can load this model and run inference.
from setfit import SetFitModel
# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("setfit_model_id")
# Run inference
preds = model("hasCreatedDate: 2024-11-20, hasCustomerHomeCountry: United States, hasCustomerID: 14347, hasCustomerName: Lowe's Companies Inc.(Lowe's USD), hasCutting: Trim to size, hasElementID: 3646411, hasElementTitle: RESET00002 PT BRITTEN, hasFinishedSizeHeight: 1, hasFinishedSizeWidth: 1, hasFlatSizeHeight: 1, hasFlatSizeWidth: 1, hasFscPaperBeenSpecified: No, hasInternalID: 47920581-39d1-4737-aa2e-32fdddebe3c3, hasMaterialCategory: Other, hasMaterialDescription: Other, hasMaterialType: Other, hasNumberOfVersions: 1, hasPrice: 0 USD, hasPrintedSides: Single sided, hasProofType: No proof required, hasQuantity: 1, hasRecycledContentBeenOffered: N/A, hasSupplierName: BRITTEN BANNERS(Britten Inc - 38859 - HHGSP), hasTotalColours: 4, hasUnitOfMeasure: Inches (in), ")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 69 | 111.6031 | 313 |
Framework Versions
- Python: 3.10.16
- SetFit: 1.1.1
- Sentence Transformers: 3.4.1
- Transformers: 4.49.0
- PyTorch: 2.6.0+cu124
- Datasets: 3.4.1
- Tokenizers: 0.21.1
Citation
BibTeX
@article{https://doi.org/10.48550/arxiv.2209.11055,
doi = {10.48550/ARXIV.2209.11055},
url = {https://arxiv.org/abs/2209.11055},
author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Efficient Few-Shot Learning Without Prompts},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution 4.0 International}
}
- Downloads last month
- 2
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
HF Inference deployability: The model authors have turned it off explicitly.
Evaluation results
- F1_Micro on Unknowntest set self-reported0.850
- F1_Macro on Unknowntest set self-reported0.357
- F1_Weighted on Unknowntest set self-reported0.761
- Precision on Unknowntest set self-reported0.913
- Accuracy on Unknowntest set self-reported0.880
- Recall on Unknowntest set self-reported0.796