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: 2 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 |
---|---|
1.0 |
|
0.0 |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.9840 |
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("Netta1994/setfit_undersampling_2k")
# Run inference
preds = model("The author clearly cites it as a Reddit thread. In a scholastic paper, you would be expected to have a bit more original content, but you wouldn't 'get in trouble' ")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 1 | 89.6623 | 412 |
Label | Training Sample Count |
---|---|
0.0 | 1454 |
1.0 | 527 |
Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 20
- body_learning_rate: (2e-05, 2e-05)
- head_learning_rate: 2e-05
- 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: False
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0002 | 1 | 0.3718 | - |
0.0101 | 50 | 0.2723 | - |
0.0202 | 100 | 0.1298 | - |
0.0303 | 150 | 0.091 | - |
0.0404 | 200 | 0.046 | - |
0.0505 | 250 | 0.0348 | - |
0.0606 | 300 | 0.0208 | - |
0.0707 | 350 | 0.0044 | - |
0.0808 | 400 | 0.0041 | - |
0.0909 | 450 | 0.0046 | - |
0.1009 | 500 | 0.0007 | - |
0.1110 | 550 | 0.0004 | - |
0.1211 | 600 | 0.0601 | - |
0.1312 | 650 | 0.0006 | - |
0.1413 | 700 | 0.0006 | - |
0.1514 | 750 | 0.0661 | - |
0.1615 | 800 | 0.0002 | - |
0.1716 | 850 | 0.0009 | - |
0.1817 | 900 | 0.0002 | - |
0.1918 | 950 | 0.0017 | - |
0.2019 | 1000 | 0.0007 | - |
0.2120 | 1050 | 0.0606 | - |
0.2221 | 1100 | 0.0001 | - |
0.2322 | 1150 | 0.0004 | - |
0.2423 | 1200 | 0.0029 | - |
0.2524 | 1250 | 0.0001 | - |
0.2625 | 1300 | 0.0001 | - |
0.2726 | 1350 | 0.0001 | - |
0.2827 | 1400 | 0.0047 | - |
0.2928 | 1450 | 0.0 | - |
0.3028 | 1500 | 0.0 | - |
0.3129 | 1550 | 0.0 | - |
0.3230 | 1600 | 0.0 | - |
0.3331 | 1650 | 0.0001 | - |
0.3432 | 1700 | 0.0004 | - |
0.3533 | 1750 | 0.0 | - |
0.3634 | 1800 | 0.0 | - |
0.3735 | 1850 | 0.0 | - |
0.3836 | 1900 | 0.0 | - |
0.3937 | 1950 | 0.0 | - |
0.4038 | 2000 | 0.0 | - |
0.4139 | 2050 | 0.0 | - |
0.4240 | 2100 | 0.0 | - |
0.4341 | 2150 | 0.0 | - |
0.4442 | 2200 | 0.0 | - |
0.4543 | 2250 | 0.0001 | - |
0.4644 | 2300 | 0.0 | - |
0.4745 | 2350 | 0.0 | - |
0.4846 | 2400 | 0.0 | - |
0.4946 | 2450 | 0.0 | - |
0.5047 | 2500 | 0.0 | - |
0.5148 | 2550 | 0.0 | - |
0.5249 | 2600 | 0.0 | - |
0.5350 | 2650 | 0.0 | - |
0.5451 | 2700 | 0.0 | - |
0.5552 | 2750 | 0.0001 | - |
0.5653 | 2800 | 0.0 | - |
0.5754 | 2850 | 0.0 | - |
0.5855 | 2900 | 0.0 | - |
0.5956 | 2950 | 0.0 | - |
0.6057 | 3000 | 0.0 | - |
0.6158 | 3050 | 0.0 | - |
0.6259 | 3100 | 0.0002 | - |
0.6360 | 3150 | 0.0 | - |
0.6461 | 3200 | 0.0 | - |
0.6562 | 3250 | 0.0002 | - |
0.6663 | 3300 | 0.0 | - |
0.6764 | 3350 | 0.0 | - |
0.6865 | 3400 | 0.0 | - |
0.6965 | 3450 | 0.0 | - |
0.7066 | 3500 | 0.0 | - |
0.7167 | 3550 | 0.0 | - |
0.7268 | 3600 | 0.0 | - |
0.7369 | 3650 | 0.0 | - |
0.7470 | 3700 | 0.0 | - |
0.7571 | 3750 | 0.0 | - |
0.7672 | 3800 | 0.0 | - |
0.7773 | 3850 | 0.0 | - |
0.7874 | 3900 | 0.0 | - |
0.7975 | 3950 | 0.0 | - |
0.8076 | 4000 | 0.0 | - |
0.8177 | 4050 | 0.0 | - |
0.8278 | 4100 | 0.0 | - |
0.8379 | 4150 | 0.0 | - |
0.8480 | 4200 | 0.0 | - |
0.8581 | 4250 | 0.0 | - |
0.8682 | 4300 | 0.0 | - |
0.8783 | 4350 | 0.0 | - |
0.8884 | 4400 | 0.0 | - |
0.8984 | 4450 | 0.0 | - |
0.9085 | 4500 | 0.0 | - |
0.9186 | 4550 | 0.0 | - |
0.9287 | 4600 | 0.0 | - |
0.9388 | 4650 | 0.0 | - |
0.9489 | 4700 | 0.0 | - |
0.9590 | 4750 | 0.0 | - |
0.9691 | 4800 | 0.0 | - |
0.9792 | 4850 | 0.0 | - |
0.9893 | 4900 | 0.0 | - |
0.9994 | 4950 | 0.0 | - |
Framework Versions
- Python: 3.10.14
- SetFit: 1.0.3
- Sentence Transformers: 2.7.0
- Transformers: 4.40.1
- PyTorch: 2.2.0+cu121
- 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
- 2
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.