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-augmented")
# 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 | 7 | 105.1494 | 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. | 27 |
1.1. Food Security & Nutrition: Encompasses ensuring everyone’s access to sufficient, safe, and nutritious food, improving overall dietary intake and nutritional well-being. | 67 |
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. | 22 |
1.2. Diet quality: Focuses on the balance, diversity, and healthfulness of what people eat, aiming to prevent malnutrition and diet-related diseases. | 23 |
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. | 35 |
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.0004 | 1 | 0.2349 | - |
0.0175 | 50 | 0.23 | - |
0.0351 | 100 | 0.2089 | - |
0.0526 | 150 | 0.1986 | - |
0.0701 | 200 | 0.1648 | - |
0.0876 | 250 | 0.1593 | - |
0.1052 | 300 | 0.1308 | - |
0.1227 | 350 | 0.1049 | - |
0.1402 | 400 | 0.0829 | - |
0.1577 | 450 | 0.0851 | - |
0.1753 | 500 | 0.0442 | - |
0.1928 | 550 | 0.046 | - |
0.2103 | 600 | 0.0467 | - |
0.2278 | 650 | 0.0416 | - |
0.2454 | 700 | 0.0391 | - |
0.2629 | 750 | 0.0353 | - |
0.2804 | 800 | 0.0296 | - |
0.2979 | 850 | 0.0271 | - |
0.3155 | 900 | 0.0231 | - |
0.3330 | 950 | 0.0356 | - |
0.3505 | 1000 | 0.0268 | - |
0.3680 | 1050 | 0.0314 | - |
0.3856 | 1100 | 0.037 | - |
0.4031 | 1150 | 0.0322 | - |
0.4206 | 1200 | 0.0223 | - |
0.4381 | 1250 | 0.0357 | - |
0.4557 | 1300 | 0.0242 | - |
0.4732 | 1350 | 0.0374 | - |
0.4907 | 1400 | 0.0275 | - |
0.5082 | 1450 | 0.0189 | - |
0.5258 | 1500 | 0.0236 | - |
0.5433 | 1550 | 0.0317 | - |
0.5608 | 1600 | 0.0324 | - |
0.5783 | 1650 | 0.0241 | - |
0.5959 | 1700 | 0.0184 | - |
0.6134 | 1750 | 0.0285 | - |
0.6309 | 1800 | 0.0243 | - |
0.6484 | 1850 | 0.017 | - |
0.6660 | 1900 | 0.0247 | - |
0.6835 | 1950 | 0.0194 | - |
0.7010 | 2000 | 0.0368 | - |
0.7185 | 2050 | 0.0199 | - |
0.7361 | 2100 | 0.0228 | - |
0.7536 | 2150 | 0.0262 | - |
0.7711 | 2200 | 0.0222 | - |
0.7886 | 2250 | 0.0188 | - |
0.8062 | 2300 | 0.0167 | - |
0.8237 | 2350 | 0.0331 | - |
0.8412 | 2400 | 0.0275 | - |
0.8587 | 2450 | 0.0239 | - |
0.8763 | 2500 | 0.025 | - |
0.8938 | 2550 | 0.0194 | - |
0.9113 | 2600 | 0.0366 | - |
0.9288 | 2650 | 0.0333 | - |
0.9464 | 2700 | 0.0281 | - |
0.9639 | 2750 | 0.0162 | - |
0.9814 | 2800 | 0.0304 | - |
0.9989 | 2850 | 0.0306 | - |
1.0 | 2853 | - | 0.2305 |
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
- 27
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support