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: 3 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 |
---|---|
negative |
|
positive |
|
neutral |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.5854 |
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("GaborMadarasz/multilingual-MiniLM-L12-v2-HUSST-setfit-model")
# Run inference
preds = model("Felületesen ugyan élveztem a filmet, de sosem értettem, mi a célja.")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 1 | 15.2367 | 37 |
Label | Training Sample Count |
---|---|
negative | 100 |
neutral | 100 |
positive | 100 |
Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (2, 2)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 25
- 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.0011 | 1 | 0.4864 | - |
0.0533 | 50 | 0.286 | - |
0.1066 | 100 | 0.2539 | - |
0.1599 | 150 | 0.227 | - |
0.2132 | 200 | 0.1783 | - |
0.2665 | 250 | 0.1464 | - |
0.3198 | 300 | 0.1352 | - |
0.3731 | 350 | 0.1226 | - |
0.4264 | 400 | 0.1136 | - |
0.4797 | 450 | 0.0963 | - |
0.5330 | 500 | 0.0437 | - |
0.5864 | 550 | 0.0181 | - |
0.6397 | 600 | 0.0079 | - |
0.6930 | 650 | 0.0046 | - |
0.7463 | 700 | 0.005 | - |
0.7996 | 750 | 0.0031 | - |
0.8529 | 800 | 0.0027 | - |
0.9062 | 850 | 0.0017 | - |
0.9595 | 900 | 0.0017 | - |
1.0128 | 950 | 0.0012 | - |
1.0661 | 1000 | 0.0012 | - |
1.1194 | 1050 | 0.0012 | - |
1.1727 | 1100 | 0.0009 | - |
1.2260 | 1150 | 0.0008 | - |
1.2793 | 1200 | 0.0017 | - |
1.3326 | 1250 | 0.0005 | - |
1.3859 | 1300 | 0.0005 | - |
1.4392 | 1350 | 0.0005 | - |
1.4925 | 1400 | 0.0005 | - |
1.5458 | 1450 | 0.0005 | - |
1.5991 | 1500 | 0.0004 | - |
1.6525 | 1550 | 0.0004 | - |
1.7058 | 1600 | 0.0003 | - |
1.7591 | 1650 | 0.0004 | - |
1.8124 | 1700 | 0.0004 | - |
1.8657 | 1750 | 0.0004 | - |
1.9190 | 1800 | 0.0003 | - |
1.9723 | 1850 | 0.0004 | - |
Framework Versions
- Python: 3.11.12
- SetFit: 1.1.2
- Sentence Transformers: 3.4.1
- Transformers: 4.51.1
- 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
- 6
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support