SetFit with sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 as the Sentence Transformer embedding model. A OneVsRestClassifier 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-multilingual-MiniLM-L12-v2
- Classification head: a OneVsRestClassifier instance
- Maximum Sequence Length: 128 tokens
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
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/model_inclusive_credit_and_financial_services")
# Run inference
preds = model("Training infrastructure will be adapted to accommodate
new programmes.")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 1 | 47.7118 | 1181 |
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
- l2_weight: 0.01
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: False
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0003 | 1 | 0.265 | - |
0.0142 | 50 | 0.1787 | - |
0.0283 | 100 | 0.1639 | - |
0.0425 | 150 | 0.1446 | - |
0.0567 | 200 | 0.1216 | - |
0.0708 | 250 | 0.1237 | - |
0.0850 | 300 | 0.1108 | - |
0.0992 | 350 | 0.1177 | - |
0.1133 | 400 | 0.1069 | - |
0.1275 | 450 | 0.1032 | - |
0.1416 | 500 | 0.1064 | - |
0.1558 | 550 | 0.1048 | - |
0.1700 | 600 | 0.0913 | - |
0.1841 | 650 | 0.0868 | - |
0.1983 | 700 | 0.098 | - |
0.2125 | 750 | 0.0788 | - |
0.2266 | 800 | 0.0699 | - |
0.2408 | 850 | 0.0839 | - |
0.2550 | 900 | 0.0841 | - |
0.2691 | 950 | 0.0823 | - |
0.2833 | 1000 | 0.0732 | - |
0.2975 | 1050 | 0.0674 | - |
0.3116 | 1100 | 0.0731 | - |
0.3258 | 1150 | 0.0744 | - |
0.3399 | 1200 | 0.0748 | - |
0.3541 | 1250 | 0.0735 | - |
0.3683 | 1300 | 0.067 | - |
0.3824 | 1350 | 0.0712 | - |
0.3966 | 1400 | 0.0731 | - |
0.4108 | 1450 | 0.0582 | - |
0.4249 | 1500 | 0.0577 | - |
0.4391 | 1550 | 0.0681 | - |
0.4533 | 1600 | 0.0572 | - |
0.4674 | 1650 | 0.058 | - |
0.4816 | 1700 | 0.0611 | - |
0.4958 | 1750 | 0.063 | - |
0.5099 | 1800 | 0.0565 | - |
0.5241 | 1850 | 0.0592 | - |
0.5382 | 1900 | 0.0576 | - |
0.5524 | 1950 | 0.0624 | - |
0.5666 | 2000 | 0.0627 | - |
0.5807 | 2050 | 0.0695 | - |
0.5949 | 2100 | 0.0485 | - |
0.6091 | 2150 | 0.0546 | - |
0.6232 | 2200 | 0.0453 | - |
0.6374 | 2250 | 0.0569 | - |
0.6516 | 2300 | 0.0528 | - |
0.6657 | 2350 | 0.047 | - |
0.6799 | 2400 | 0.0503 | - |
0.6941 | 2450 | 0.0456 | - |
0.7082 | 2500 | 0.0563 | - |
0.7224 | 2550 | 0.0512 | - |
0.7365 | 2600 | 0.059 | - |
0.7507 | 2650 | 0.0398 | - |
0.7649 | 2700 | 0.0489 | - |
0.7790 | 2750 | 0.0477 | - |
0.7932 | 2800 | 0.0467 | - |
0.8074 | 2850 | 0.0479 | - |
0.8215 | 2900 | 0.049 | - |
0.8357 | 2950 | 0.0544 | - |
0.8499 | 3000 | 0.0504 | - |
0.8640 | 3050 | 0.0429 | - |
0.8782 | 3100 | 0.0479 | - |
0.8924 | 3150 | 0.0465 | - |
0.9065 | 3200 | 0.0478 | - |
0.9207 | 3250 | 0.056 | - |
0.9348 | 3300 | 0.0522 | - |
0.9490 | 3350 | 0.0459 | - |
0.9632 | 3400 | 0.0428 | - |
0.9773 | 3450 | 0.0418 | - |
0.9915 | 3500 | 0.0439 | - |
Framework Versions
- Python: 3.11.13
- SetFit: 1.1.2
- Sentence Transformers: 4.1.0
- Transformers: 4.52.4
- PyTorch: 2.6.0+cu124
- Datasets: 3.6.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
- 21
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support