SetFit with sentence-transformers/paraphrase-mpnet-base-v2
This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/paraphrase-mpnet-base-v2 as the Sentence Transformer embedding model. A LogisticRegression 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
- Sentence Transformer body: sentence-transformers/paraphrase-mpnet-base-v2
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 512 tokens
- Number of Classes: 6 classes
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
Model Labels
Label | Examples |
---|---|
product faq |
|
Out of Scope |
|
order tracking |
|
general faq |
|
product policy |
|
product discoverability |
|
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("What’s the best payment gateway for an online store?")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 4 | 10.4361 | 24 |
Label | Training Sample Count |
---|---|
Out of Scope | 60 |
general faq | 60 |
order tracking | 60 |
product discoverability | 60 |
product faq | 60 |
product policy | 60 |
Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (2, 2)
- max_steps: -1
- sampling_strategy: oversampling
- body_learning_rate: (2e-05, 1e-05)
- head_learning_rate: 0.01
- loss: CosineSimilarityLoss
- distance_metric: cosine_distance
- margin: 0.25
- end_to_end: False
- use_amp: False
- warmup_proportion: 0.1
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: True
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0001 | 1 | 0.3001 | - |
0.0074 | 50 | 0.2362 | - |
0.0148 | 100 | 0.2573 | - |
0.0222 | 150 | 0.223 | - |
0.0296 | 200 | 0.2201 | - |
0.0370 | 250 | 0.1694 | - |
0.0444 | 300 | 0.0765 | - |
0.0519 | 350 | 0.0828 | - |
0.0593 | 400 | 0.0514 | - |
0.0667 | 450 | 0.0482 | - |
0.0741 | 500 | 0.0435 | - |
0.0815 | 550 | 0.006 | - |
0.0889 | 600 | 0.0071 | - |
0.0963 | 650 | 0.0049 | - |
0.1037 | 700 | 0.0023 | - |
0.1111 | 750 | 0.0007 | - |
0.1185 | 800 | 0.0011 | - |
0.1259 | 850 | 0.0007 | - |
0.1333 | 900 | 0.001 | - |
0.1407 | 950 | 0.0004 | - |
0.1481 | 1000 | 0.0006 | - |
0.1556 | 1050 | 0.001 | - |
0.1630 | 1100 | 0.0006 | - |
0.1704 | 1150 | 0.0006 | - |
0.1778 | 1200 | 0.0003 | - |
0.1852 | 1250 | 0.0003 | - |
0.1926 | 1300 | 0.0003 | - |
0.2 | 1350 | 0.0003 | - |
0.2074 | 1400 | 0.0003 | - |
0.2148 | 1450 | 0.0002 | - |
0.2222 | 1500 | 0.0004 | - |
0.2296 | 1550 | 0.0001 | - |
0.2370 | 1600 | 0.0002 | - |
0.2444 | 1650 | 0.0001 | - |
0.2519 | 1700 | 0.0002 | - |
0.2593 | 1750 | 0.0002 | - |
0.2667 | 1800 | 0.0002 | - |
0.2741 | 1850 | 0.0006 | - |
0.2815 | 1900 | 0.0024 | - |
0.2889 | 1950 | 0.0012 | - |
0.2963 | 2000 | 0.0002 | - |
0.3037 | 2050 | 0.0003 | - |
0.3111 | 2100 | 0.0002 | - |
0.3185 | 2150 | 0.0002 | - |
0.3259 | 2200 | 0.0001 | - |
0.3333 | 2250 | 0.0001 | - |
0.3407 | 2300 | 0.0001 | - |
0.3481 | 2350 | 0.0002 | - |
0.3556 | 2400 | 0.0001 | - |
0.3630 | 2450 | 0.0002 | - |
0.3704 | 2500 | 0.0001 | - |
0.3778 | 2550 | 0.0001 | - |
0.3852 | 2600 | 0.0019 | - |
0.3926 | 2650 | 0.0001 | - |
0.4 | 2700 | 0.0003 | - |
0.4074 | 2750 | 0.0001 | - |
0.4148 | 2800 | 0.0001 | - |
0.4222 | 2850 | 0.0001 | - |
0.4296 | 2900 | 0.0001 | - |
0.4370 | 2950 | 0.0002 | - |
0.4444 | 3000 | 0.0001 | - |
0.4519 | 3050 | 0.0001 | - |
0.4593 | 3100 | 0.0001 | - |
0.4667 | 3150 | 0.0001 | - |
0.4741 | 3200 | 0.0001 | - |
0.4815 | 3250 | 0.0001 | - |
0.4889 | 3300 | 0.0001 | - |
0.4963 | 3350 | 0.0001 | - |
0.5037 | 3400 | 0.0001 | - |
0.5111 | 3450 | 0.0001 | - |
0.5185 | 3500 | 0.0001 | - |
0.5259 | 3550 | 0.0001 | - |
0.5333 | 3600 | 0.0 | - |
0.5407 | 3650 | 0.0001 | - |
0.5481 | 3700 | 0.0001 | - |
0.5556 | 3750 | 0.0001 | - |
0.5630 | 3800 | 0.0001 | - |
0.5704 | 3850 | 0.0001 | - |
0.5778 | 3900 | 0.0 | - |
0.5852 | 3950 | 0.0001 | - |
0.5926 | 4000 | 0.0 | - |
0.6 | 4050 | 0.0001 | - |
0.6074 | 4100 | 0.0 | - |
0.6148 | 4150 | 0.0001 | - |
0.6222 | 4200 | 0.0001 | - |
0.6296 | 4250 | 0.0001 | - |
0.6370 | 4300 | 0.0001 | - |
0.6444 | 4350 | 0.0 | - |
0.6519 | 4400 | 0.0001 | - |
0.6593 | 4450 | 0.0001 | - |
0.6667 | 4500 | 0.0 | - |
0.6741 | 4550 | 0.0001 | - |
0.6815 | 4600 | 0.0001 | - |
0.6889 | 4650 | 0.0001 | - |
0.6963 | 4700 | 0.0001 | - |
0.7037 | 4750 | 0.0001 | - |
0.7111 | 4800 | 0.0001 | - |
0.7185 | 4850 | 0.0001 | - |
0.7259 | 4900 | 0.0001 | - |
0.7333 | 4950 | 0.0 | - |
0.7407 | 5000 | 0.0 | - |
0.7481 | 5050 | 0.0 | - |
0.7556 | 5100 | 0.0001 | - |
0.7630 | 5150 | 0.0001 | - |
0.7704 | 5200 | 0.0001 | - |
0.7778 | 5250 | 0.0001 | - |
0.7852 | 5300 | 0.0001 | - |
0.7926 | 5350 | 0.0 | - |
0.8 | 5400 | 0.0001 | - |
0.8074 | 5450 | 0.0 | - |
0.8148 | 5500 | 0.0001 | - |
0.8222 | 5550 | 0.0001 | - |
0.8296 | 5600 | 0.0 | - |
0.8370 | 5650 | 0.0 | - |
0.8444 | 5700 | 0.0 | - |
0.8519 | 5750 | 0.0001 | - |
0.8593 | 5800 | 0.0001 | - |
0.8667 | 5850 | 0.0001 | - |
0.8741 | 5900 | 0.0001 | - |
0.8815 | 5950 | 0.0001 | - |
0.8889 | 6000 | 0.0 | - |
0.8963 | 6050 | 0.0 | - |
0.9037 | 6100 | 0.0 | - |
0.9111 | 6150 | 0.0 | - |
0.9185 | 6200 | 0.0 | - |
0.9259 | 6250 | 0.0 | - |
0.9333 | 6300 | 0.0001 | - |
0.9407 | 6350 | 0.0 | - |
0.9481 | 6400 | 0.0 | - |
0.9556 | 6450 | 0.0 | - |
0.9630 | 6500 | 0.0 | - |
0.9704 | 6550 | 0.0 | - |
0.9778 | 6600 | 0.0 | - |
0.9852 | 6650 | 0.0001 | - |
0.9926 | 6700 | 0.0001 | - |
1.0 | 6750 | 0.0 | - |
1.0074 | 6800 | 0.0 | - |
1.0148 | 6850 | 0.0 | - |
1.0222 | 6900 | 0.0 | - |
1.0296 | 6950 | 0.0 | - |
1.0370 | 7000 | 0.0 | - |
1.0444 | 7050 | 0.0 | - |
1.0519 | 7100 | 0.0001 | - |
1.0593 | 7150 | 0.0 | - |
1.0667 | 7200 | 0.0 | - |
1.0741 | 7250 | 0.0003 | - |
1.0815 | 7300 | 0.0001 | - |
1.0889 | 7350 | 0.059 | - |
1.0963 | 7400 | 0.0002 | - |
1.1037 | 7450 | 0.0001 | - |
1.1111 | 7500 | 0.0001 | - |
1.1185 | 7550 | 0.0001 | - |
1.1259 | 7600 | 0.0001 | - |
1.1333 | 7650 | 0.0 | - |
1.1407 | 7700 | 0.0001 | - |
1.1481 | 7750 | 0.0 | - |
1.1556 | 7800 | 0.0001 | - |
1.1630 | 7850 | 0.0 | - |
1.1704 | 7900 | 0.0 | - |
1.1778 | 7950 | 0.0001 | - |
1.1852 | 8000 | 0.0001 | - |
1.1926 | 8050 | 0.0001 | - |
1.2 | 8100 | 0.0 | - |
1.2074 | 8150 | 0.0001 | - |
1.2148 | 8200 | 0.0001 | - |
1.2222 | 8250 | 0.0 | - |
1.2296 | 8300 | 0.0 | - |
1.2370 | 8350 | 0.0 | - |
1.2444 | 8400 | 0.0 | - |
1.2519 | 8450 | 0.0 | - |
1.2593 | 8500 | 0.0 | - |
1.2667 | 8550 | 0.0 | - |
1.2741 | 8600 | 0.0 | - |
1.2815 | 8650 | 0.0001 | - |
1.2889 | 8700 | 0.0 | - |
1.2963 | 8750 | 0.0 | - |
1.3037 | 8800 | 0.0 | - |
1.3111 | 8850 | 0.0 | - |
1.3185 | 8900 | 0.0 | - |
1.3259 | 8950 | 0.0 | - |
1.3333 | 9000 | 0.0 | - |
1.3407 | 9050 | 0.0 | - |
1.3481 | 9100 | 0.0 | - |
1.3556 | 9150 | 0.0 | - |
1.3630 | 9200 | 0.0 | - |
1.3704 | 9250 | 0.0 | - |
1.3778 | 9300 | 0.0 | - |
1.3852 | 9350 | 0.0 | - |
1.3926 | 9400 | 0.0 | - |
1.4 | 9450 | 0.0001 | - |
1.4074 | 9500 | 0.0 | - |
1.4148 | 9550 | 0.0 | - |
1.4222 | 9600 | 0.0 | - |
1.4296 | 9650 | 0.0 | - |
1.4370 | 9700 | 0.0 | - |
1.4444 | 9750 | 0.0 | - |
1.4519 | 9800 | 0.0 | - |
1.4593 | 9850 | 0.0 | - |
1.4667 | 9900 | 0.0 | - |
1.4741 | 9950 | 0.0 | - |
1.4815 | 10000 | 0.0 | - |
1.4889 | 10050 | 0.0 | - |
1.4963 | 10100 | 0.0 | - |
1.5037 | 10150 | 0.0 | - |
1.5111 | 10200 | 0.0 | - |
1.5185 | 10250 | 0.0 | - |
1.5259 | 10300 | 0.0 | - |
1.5333 | 10350 | 0.0 | - |
1.5407 | 10400 | 0.0 | - |
1.5481 | 10450 | 0.0 | - |
1.5556 | 10500 | 0.0 | - |
1.5630 | 10550 | 0.0 | - |
1.5704 | 10600 | 0.0 | - |
1.5778 | 10650 | 0.0 | - |
1.5852 | 10700 | 0.0 | - |
1.5926 | 10750 | 0.0 | - |
1.6 | 10800 | 0.0 | - |
1.6074 | 10850 | 0.0 | - |
1.6148 | 10900 | 0.0 | - |
1.6222 | 10950 | 0.0 | - |
1.6296 | 11000 | 0.0 | - |
1.6370 | 11050 | 0.0 | - |
1.6444 | 11100 | 0.0 | - |
1.6519 | 11150 | 0.0 | - |
1.6593 | 11200 | 0.0 | - |
1.6667 | 11250 | 0.0 | - |
1.6741 | 11300 | 0.0 | - |
1.6815 | 11350 | 0.0 | - |
1.6889 | 11400 | 0.0 | - |
1.6963 | 11450 | 0.0 | - |
1.7037 | 11500 | 0.0 | - |
1.7111 | 11550 | 0.0 | - |
1.7185 | 11600 | 0.0 | - |
1.7259 | 11650 | 0.0001 | - |
1.7333 | 11700 | 0.0 | - |
1.7407 | 11750 | 0.0 | - |
1.7481 | 11800 | 0.0 | - |
1.7556 | 11850 | 0.0 | - |
1.7630 | 11900 | 0.0 | - |
1.7704 | 11950 | 0.0 | - |
1.7778 | 12000 | 0.0 | - |
1.7852 | 12050 | 0.0 | - |
1.7926 | 12100 | 0.0 | - |
1.8 | 12150 | 0.0 | - |
1.8074 | 12200 | 0.0 | - |
1.8148 | 12250 | 0.0 | - |
1.8222 | 12300 | 0.0 | - |
1.8296 | 12350 | 0.0 | - |
1.8370 | 12400 | 0.0 | - |
1.8444 | 12450 | 0.0 | - |
1.8519 | 12500 | 0.0 | - |
1.8593 | 12550 | 0.0 | - |
1.8667 | 12600 | 0.0 | - |
1.8741 | 12650 | 0.0 | - |
1.8815 | 12700 | 0.0 | - |
1.8889 | 12750 | 0.0 | - |
1.8963 | 12800 | 0.0 | - |
1.9037 | 12850 | 0.0 | - |
1.9111 | 12900 | 0.0 | - |
1.9185 | 12950 | 0.0 | - |
1.9259 | 13000 | 0.0 | - |
1.9333 | 13050 | 0.0 | - |
1.9407 | 13100 | 0.0 | - |
1.9481 | 13150 | 0.0 | - |
1.9556 | 13200 | 0.0 | - |
1.9630 | 13250 | 0.0 | - |
1.9704 | 13300 | 0.0 | - |
1.9778 | 13350 | 0.0 | - |
1.9852 | 13400 | 0.0 | - |
1.9926 | 13450 | 0.0 | - |
2.0 | 13500 | 0.0 | - |
Framework Versions
- Python: 3.10.16
- SetFit: 1.0.3
- Sentence Transformers: 2.7.0
- Transformers: 4.40.2
- PyTorch: 2.2.2
- Datasets: 2.19.1
- Tokenizers: 0.19.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
- 1
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support