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:

  1. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

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("I just vomited")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 1 7.9297 17

Training Hyperparameters

  • batch_size: (4, 4)
  • num_epochs: (2, 2)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 10
  • 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: False

Training Results

Epoch Step Training Loss Validation Loss
0.0004 1 0.3903 -
0.0180 50 0.2544 -
0.0360 100 0.2240 -
0.0541 150 0.2069 -
0.0721 200 0.1946 -
0.0901 250 0.1553 -
0.1081 300 0.1542 -
0.1261 350 0.1490 -
0.1441 400 0.1384 -
0.1622 450 0.1072 -
0.1802 500 0.1045 -
0.1982 550 0.1209 -
0.2162 600 0.0889 -
0.2342 650 0.1010 -
0.2523 700 0.0843 -
0.2703 750 0.0790 -
0.2883 800 0.0734 -
0.3063 850 0.0590 -
0.3243 900 0.0848 -
0.3423 950 0.0520 -
0.3604 1000 0.0523 -
0.3784 1050 0.0680 -
0.3964 1100 0.0716 -
0.4144 1150 0.0732 -
0.4324 1200 0.0584 -
0.4505 1250 0.0600 -
0.4685 1300 0.0522 -
0.4865 1350 0.0489 -
0.5045 1400 0.0524 -
0.5225 1450 0.0524 -
0.5405 1500 0.0507 -
0.5586 1550 0.0666 -
0.5766 1600 0.0575 -
0.5946 1650 0.0490 -
0.6126 1700 0.0487 -
0.6306 1750 0.0518 -
0.6486 1800 0.0554 -
0.6667 1850 0.0394 -
0.6847 1900 0.0517 -
0.7027 1950 0.0494 -
0.7207 2000 0.0413 -
0.7387 2050 0.0652 -
0.7568 2100 0.0427 -
0.7748 2150 0.0354 -
0.7928 2200 0.0586 -
0.8108 2250 0.0452 -
0.8288 2300 0.0465 -
0.8468 2350 0.0422 -
0.8649 2400 0.0349 -
0.8829 2450 0.0391 -
0.9009 2500 0.0404 -
0.9189 2550 0.0382 -
0.9369 2600 0.0376 -
0.9550 2650 0.0530 -
0.9730 2700 0.0426 -
0.9910 2750 0.0377 -
1.0090 2800 0.0419 -
1.0270 2850 0.0399 -
1.0450 2900 0.0374 -
1.0631 2950 0.0245 -
1.0811 3000 0.0348 -
1.0991 3050 0.0332 -
1.1171 3100 0.0310 -
1.1351 3150 0.0315 -
1.1532 3200 0.0355 -
1.1712 3250 0.0329 -
1.1892 3300 0.0312 -
1.2072 3350 0.0400 -
1.2252 3400 0.0370 -
1.2432 3450 0.0287 -
1.2613 3500 0.0349 -
1.2793 3550 0.0390 -
1.2973 3600 0.0275 -
1.3153 3650 0.0388 -
1.3333 3700 0.0299 -
1.3514 3750 0.0286 -
1.3694 3800 0.0293 -
1.3874 3850 0.0361 -
1.4054 3900 0.0326 -
1.4234 3950 0.0278 -
1.4414 4000 0.0317 -
1.4595 4050 0.0330 -
1.4775 4100 0.0252 -
1.4955 4150 0.0377 -
1.5135 4200 0.0223 -
1.5315 4250 0.0352 -
1.5495 4300 0.0317 -
1.5676 4350 0.0344 -
1.5856 4400 0.0282 -
1.6036 4450 0.0320 -
1.6216 4500 0.0302 -
1.6396 4550 0.0336 -
1.6577 4600 0.0288 -
1.6757 4650 0.0358 -
1.6937 4700 0.0303 -
1.7117 4750 0.0365 -
1.7297 4800 0.0253 -
1.7477 4850 0.0334 -
1.7658 4900 0.0347 -
1.7838 4950 0.0301 -
1.8018 5000 0.0314 -
1.8198 5050 0.0325 -
1.8378 5100 0.0304 -
1.8559 5150 0.0290 -
1.8739 5200 0.0269 -
1.8919 5250 0.0312 -
1.9099 5300 0.0262 -
1.9279 5350 0.0323 -
1.9459 5400 0.0301 -
1.9640 5450 0.0232 -
1.9820 5500 0.0304 -
2.0 5550 0.0297 -

Framework Versions

  • Python: 3.12.1
  • SetFit: 1.2.0
  • Sentence Transformers: 6.1.0
  • Transformers: 5.19.0
  • PyTorch: 2.6.0
  • Datasets: 4.4.1
  • Tokenizers: 0.23.3

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
17
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for priyadp1/setfit-multilingual

Paper for priyadp1/setfit-multilingual