SetFit

This is a SetFit model that can be used for Text Classification. A LogisticRegression 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 LogisticRegression instance
  • Maximum Sequence Length: 512 tokens
  • Number of Classes: 3 classes

Model Sources

Model Labels

Label Examples
1
  • 'Can you identify specific areas that need improvement in my text'
  • 'Point out the flaws in my writing style, please'
  • 'Which parts of my draft are the weakest'
0
  • "How do I make my character's driving force more compelling"
  • "Any tips to deepen my protagonist's underlying goals"
  • "Suggestions for strengthening the reasons behind my character's actions"
2
  • 'How does the Pro version elevate my writing experience'
  • 'Could you list the premium perks of Quarkle Pro'
  • 'What special advantages come with upgrading to Pro'

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("How do I handle flashbacks in a non-linear story")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 1 8.7947 14
Label Training Sample Count
0 153
1 144
2 117

Framework Versions

  • Python: 3.10.15
  • SetFit: 1.2.0.dev0
  • Sentence Transformers: 3.3.1
  • Transformers: 4.47.1
  • PyTorch: 2.5.1
  • 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
5
Safetensors
Model size
33.4M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and the model is not deployed on the HF Inference API.