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:

  1. Fine-tuning a Sentence Transformer with contrastive learning.
  2. 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: 44 classes

Model Sources

Evaluation

Metrics

Label F1_Micro F1_Macro F1_Weighted Precision Accuracy Recall
all 0.6077 0.0781 0.5584 0.9588 0.9869 0.4448

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-01-04, hasCustomerHomeCountry: United States, hasCustomerID: 14458, hasCustomerName: Lowe's Companies Inc(Lowe's FVS), hasCutting: Trim to size, hasElementID: 3044610, hasElementTitle: G284498 Commodity Moulding Profile Card 77991, hasFinishedSizeHeight: 6.875, hasFinishedSizeWidth: 3, hasFlatSizeHeight: 6.875, hasFlatSizeWidth: 3, hasFscPaperBeenSpecified: No, hasInternalID: 671d6e41-c7c2-4c42-83ff-d1c87deb890b, hasMaterialCategory: Other, hasMaterialDescription: 8PT _C1S Cover, hasMaterialType: Other, hasNumberOfVersions: 1, hasPrice: 0.01 USD, hasPrintedSides: Single sided, hasProofType: PDF digital proof, hasQuantity: 1, hasRecycledContentBeenOffered: N/A, hasSupplierName: HH IC Content Production + Development(HH IC Content Production + Development), hasTotalColours: 4, hasUnitOfMeasure: Inches (in), ")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 62 109.9067 637

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.2.0
  • Tokenizers: 0.21.0

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
30
Safetensors
Model size
33.4M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model authors have turned it off explicitly.

Evaluation results