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: 5 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 |
---|---|
6.3.4 Effectiveness of Policy Implementation: Assesses how well policies are executed, supported, and monitored, ensuring that institutions deliver on their commitments and enable positive outcomes. |
|
1.1. Food Security & Nutrition: Encompasses ensuring everyone’s access to sufficient, safe, and nutritious food, improving overall dietary intake and nutritional well-being. |
|
5.2 Resilience Capacities (absorptive, adaptive & transformative): Promotes building skills, diversifying options, strengthening networks, and improving surveillance systems so that communities, ecosystems, and value chains can withstand and recover from disruptions. |
|
1.2. Diet quality: Focuses on the balance, diversity, and healthfulness of what people eat, aiming to prevent malnutrition and diet-related diseases. |
|
6.3.3 Awareness and use of the evidence-based / agrifood systems approach: Encourages long-term, integrated planning for agrifood systems, guided by robust data, stakeholder consensus, and strategic foresight. |
|
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("faodl/setfit-paraphrase-mpnet-base-v2-5ClassesDesc-10augmented")
# Run inference
preds = model("Since the development of the first National Nutrition Strategy of Timor-Leste in 2004, there have been several emerging global, regional and national initiatives to accelerate improvements in nutritional status. ")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 6 | 93.0804 | 1014 |
Label | Training Sample Count |
---|---|
6.3.4 Effectiveness of Policy Implementation: Assesses how well policies are executed, supported, and monitored, ensuring that institutions deliver on their commitments and enable positive outcomes. | 32 |
1.1. Food Security & Nutrition: Encompasses ensuring everyone’s access to sufficient, safe, and nutritious food, improving overall dietary intake and nutritional well-being. | 72 |
5.2 Resilience Capacities (absorptive, adaptive & transformative): Promotes building skills, diversifying options, strengthening networks, and improving surveillance systems so that communities, ecosystems, and value chains can withstand and recover from disruptions. | 27 |
1.2. Diet quality: Focuses on the balance, diversity, and healthfulness of what people eat, aiming to prevent malnutrition and diet-related diseases. | 28 |
6.3.3 Awareness and use of the evidence-based / agrifood systems approach: Encourages long-term, integrated planning for agrifood systems, guided by robust data, stakeholder consensus, and strategic foresight. | 40 |
Training Hyperparameters
- batch_size: (8, 8)
- num_epochs: (1, 1)
- 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
- l2_weight: 0.01
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: True
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0003 | 1 | 0.2267 | - |
0.0132 | 50 | 0.2304 | - |
0.0264 | 100 | 0.2207 | - |
0.0396 | 150 | 0.1975 | - |
0.0528 | 200 | 0.1701 | - |
0.0661 | 250 | 0.1499 | - |
0.0793 | 300 | 0.1411 | - |
0.0925 | 350 | 0.113 | - |
0.1057 | 400 | 0.1 | - |
0.1189 | 450 | 0.0741 | - |
0.1321 | 500 | 0.0898 | - |
0.1453 | 550 | 0.0665 | - |
0.1585 | 600 | 0.0582 | - |
0.1717 | 650 | 0.0537 | - |
0.1849 | 700 | 0.0337 | - |
0.1982 | 750 | 0.0443 | - |
0.2114 | 800 | 0.0345 | - |
0.2246 | 850 | 0.0408 | - |
0.2378 | 900 | 0.0354 | - |
0.2510 | 950 | 0.0332 | - |
0.2642 | 1000 | 0.0326 | - |
0.2774 | 1050 | 0.0299 | - |
0.2906 | 1100 | 0.0285 | - |
0.3038 | 1150 | 0.0359 | - |
0.3170 | 1200 | 0.0355 | - |
0.3303 | 1250 | 0.035 | - |
0.3435 | 1300 | 0.0257 | - |
0.3567 | 1350 | 0.0188 | - |
0.3699 | 1400 | 0.0303 | - |
0.3831 | 1450 | 0.0226 | - |
0.3963 | 1500 | 0.0322 | - |
0.4095 | 1550 | 0.0235 | - |
0.4227 | 1600 | 0.0192 | - |
0.4359 | 1650 | 0.0303 | - |
0.4491 | 1700 | 0.033 | - |
0.4624 | 1750 | 0.0209 | - |
0.4756 | 1800 | 0.0218 | - |
0.4888 | 1850 | 0.0225 | - |
0.5020 | 1900 | 0.0236 | - |
0.5152 | 1950 | 0.0228 | - |
0.5284 | 2000 | 0.019 | - |
0.5416 | 2050 | 0.019 | - |
0.5548 | 2100 | 0.0116 | - |
0.5680 | 2150 | 0.0209 | - |
0.5812 | 2200 | 0.016 | - |
0.5945 | 2250 | 0.0234 | - |
0.6077 | 2300 | 0.0165 | - |
0.6209 | 2350 | 0.0159 | - |
0.6341 | 2400 | 0.0172 | - |
0.6473 | 2450 | 0.0208 | - |
0.6605 | 2500 | 0.0264 | - |
0.6737 | 2550 | 0.0267 | - |
0.6869 | 2600 | 0.0285 | - |
0.7001 | 2650 | 0.0195 | - |
0.7133 | 2700 | 0.0253 | - |
0.7266 | 2750 | 0.0159 | - |
0.7398 | 2800 | 0.0284 | - |
0.7530 | 2850 | 0.0216 | - |
0.7662 | 2900 | 0.0179 | - |
0.7794 | 2950 | 0.0193 | - |
0.7926 | 3000 | 0.0159 | - |
0.8058 | 3050 | 0.0254 | - |
0.8190 | 3100 | 0.0209 | - |
0.8322 | 3150 | 0.0242 | - |
0.8454 | 3200 | 0.0221 | - |
0.8587 | 3250 | 0.016 | - |
0.8719 | 3300 | 0.0191 | - |
0.8851 | 3350 | 0.0218 | - |
0.8983 | 3400 | 0.0194 | - |
0.9115 | 3450 | 0.0168 | - |
0.9247 | 3500 | 0.0274 | - |
0.9379 | 3550 | 0.0202 | - |
0.9511 | 3600 | 0.0226 | - |
0.9643 | 3650 | 0.0251 | - |
0.9775 | 3700 | 0.0264 | - |
0.9908 | 3750 | 0.018 | - |
1.0 | 3785 | - | 0.2535 |
Framework Versions
- Python: 3.11.11
- SetFit: 1.1.1
- Sentence Transformers: 3.4.1
- Transformers: 4.50.0
- PyTorch: 2.6.0+cu124
- Datasets: 3.5.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
- 5
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support