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.9323 | 0.3701 | 0.8821 | 0.9750 | 0.9469 | 0.8931 |
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("hasAdditionalInformation: AO, hasCreatedDate: 2024-10-08, hasCustomerHomeCountry: United States, hasCustomerID: 30642, hasCustomerName: Station Casinos LLC(Station Casinos), hasCutting: Trim to size, hasElementID: 3555960, hasElementTitle: 211696 - 381\" X 363\" SS FRONTLIT EXTERIOR VINYL SIGN , hasFinishedSizeHeight: 363, hasFinishedSizeWidth: 381, hasFscPaperBeenSpecified: No, hasInternalID: 04b8890a-dc33-4778-ad73-c1f68f68231c, hasMaterialCategory: Plastic, hasMaterialDescription: 13OZ VINYL, hasMaterialRecycledPercentage: 0%, hasMaterialThicknessOrWeight: 13, hasMaterialType: PVC, hasMaterialUnitOfMeasure: Ounces (oz), hasNumberOfVersions: 1, hasPrice: 676.0, hasPrintedSides: Not printed, hasProductCategory: Banners (synthetic), hasProofType: PDF digital proof, hasQuantity: 1, hasRecycledContentBeenOffered: N/A, hasSupplierName: WestRock Company(Westrock - 14360 - HHGSP), hasTotalColours: 4, hasUnitOfMeasure: Inches (in), ")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 67 | 110.9875 | 238 |
Framework Versions
- Python: 3.10.16
- SetFit: 1.1.2
- Sentence Transformers: 3.4.1
- Transformers: 4.51.3
- PyTorch: 2.6.0+cu124
- Datasets: 3.2.0
- 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,679
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
Evaluation results
- F1_Micro on Unknowntest set self-reported0.932
- F1_Macro on Unknowntest set self-reported0.370
- F1_Weighted on Unknowntest set self-reported0.882
- Precision on Unknowntest set self-reported0.975
- Accuracy on Unknowntest set self-reported0.947
- Recall on Unknowntest set self-reported0.893