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 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-multilingual-MiniLM-L12-v2
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 128 tokens
- Number of Classes: 20 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 |
|---|---|
| 0 |
|
| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
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("short deportivo en saga 35 soles")
Training Details
Training Set Metrics
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 6.2562 | 13 |
| Label | Training Sample Count |
|---|---|
| 0 | 30 |
| 1 | 30 |
| 2 | 30 |
| 3 | 30 |
| 4 | 30 |
| 5 | 30 |
| 6 | 30 |
| 7 | 30 |
| 8 | 30 |
| 9 | 30 |
| 10 | 30 |
| 11 | 30 |
| 12 | 30 |
| 13 | 30 |
| 14 | 30 |
| 15 | 30 |
| 16 | 30 |
| 17 | 30 |
| 18 | 30 |
| 19 | 31 |
Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (2, 2)
- 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.0007 | 1 | 0.2458 | - |
| 0.0333 | 50 | 0.2164 | - |
| 0.0665 | 100 | 0.1939 | - |
| 0.0998 | 150 | 0.178 | - |
| 0.1331 | 200 | 0.1505 | - |
| 0.1663 | 250 | 0.125 | - |
| 0.1996 | 300 | 0.0965 | - |
| 0.2329 | 350 | 0.0782 | - |
| 0.2661 | 400 | 0.0642 | - |
| 0.2994 | 450 | 0.0626 | - |
| 0.3327 | 500 | 0.05 | - |
| 0.3659 | 550 | 0.0403 | - |
| 0.3992 | 600 | 0.0449 | - |
| 0.4325 | 650 | 0.0341 | - |
| 0.4657 | 700 | 0.0285 | - |
| 0.4990 | 750 | 0.0188 | - |
| 0.5323 | 800 | 0.0208 | - |
| 0.5655 | 850 | 0.0225 | - |
| 0.5988 | 900 | 0.0173 | - |
| 0.6321 | 950 | 0.0179 | - |
| 0.6653 | 1000 | 0.0147 | - |
| 0.6986 | 1050 | 0.0178 | - |
| 0.7319 | 1100 | 0.0105 | - |
| 0.7651 | 1150 | 0.0115 | - |
| 0.7984 | 1200 | 0.0075 | - |
| 0.8317 | 1250 | 0.0143 | - |
| 0.8649 | 1300 | 0.0121 | - |
| 0.8982 | 1350 | 0.011 | - |
| 0.9315 | 1400 | 0.0094 | - |
| 0.9647 | 1450 | 0.0115 | - |
| 0.9980 | 1500 | 0.0085 | - |
| 1.0313 | 1550 | 0.0039 | - |
| 1.0645 | 1600 | 0.0049 | - |
| 1.0978 | 1650 | 0.0047 | - |
| 1.1311 | 1700 | 0.0085 | - |
| 1.1643 | 1750 | 0.0038 | - |
| 1.1976 | 1800 | 0.0049 | - |
| 1.2309 | 1850 | 0.0081 | - |
| 1.2641 | 1900 | 0.0051 | - |
| 1.2974 | 1950 | 0.0025 | - |
| 1.3307 | 2000 | 0.0025 | - |
| 1.3639 | 2050 | 0.0059 | - |
| 1.3972 | 2100 | 0.004 | - |
| 1.4305 | 2150 | 0.003 | - |
| 1.4637 | 2200 | 0.003 | - |
| 1.4970 | 2250 | 0.0013 | - |
| 1.5303 | 2300 | 0.0023 | - |
| 1.5635 | 2350 | 0.0039 | - |
| 1.5968 | 2400 | 0.0031 | - |
| 1.6301 | 2450 | 0.0015 | - |
| 1.6633 | 2500 | 0.0019 | - |
| 1.6966 | 2550 | 0.0034 | - |
| 1.7299 | 2600 | 0.0016 | - |
| 1.7631 | 2650 | 0.0029 | - |
| 1.7964 | 2700 | 0.0041 | - |
| 1.8297 | 2750 | 0.0011 | - |
| 1.8629 | 2800 | 0.002 | - |
| 1.8962 | 2850 | 0.003 | - |
| 1.9295 | 2900 | 0.0038 | - |
| 1.9627 | 2950 | 0.004 | - |
| 1.9960 | 3000 | 0.0029 | - |
Framework Versions
- Python: 3.10.19
- SetFit: 1.1.3
- Sentence Transformers: 5.1.2
- Transformers: 4.57.1
- PyTorch: 2.9.1+cpu
- Datasets: 4.4.1
- Tokenizers: 0.22.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
- 26