SetFit with sentence-transformers/paraphrase-multilingual-mpnet-base-v2
This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/paraphrase-multilingual-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-multilingual-mpnet-base-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 |
---|---|
supportive |
|
opposed |
|
neutral |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 1.0 |
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("cbpuschmann/klimacoder_protest_v0.1")
# Run inference
preds = model("Chaos in der City! Wieder einmal legen Klima-Aktivisten mit ihren radikalen Aktionen den Verkehr lahm und sorgen für Frust bei den Pendlern. Viele fragen sich: Geht's hier wirklich noch ums Klima oder nur um Aufmerksamkeit um jeden Preis?")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 30 | 48.5311 | 73 |
Label | Training Sample Count |
---|---|
neutral | 169 |
opposed | 177 |
supportive | 185 |
Training Hyperparameters
- batch_size: (32, 32)
- 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: False
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0002 | 1 | 0.2854 | - |
0.0085 | 50 | 0.2769 | - |
0.0170 | 100 | 0.1526 | - |
0.0255 | 150 | 0.0652 | - |
0.0341 | 200 | 0.0195 | - |
0.0426 | 250 | 0.0062 | - |
0.0511 | 300 | 0.0015 | - |
0.0596 | 350 | 0.0007 | - |
0.0681 | 400 | 0.0004 | - |
0.0766 | 450 | 0.0002 | - |
0.0852 | 500 | 0.0002 | - |
0.0937 | 550 | 0.0001 | - |
0.1022 | 600 | 0.0001 | - |
0.1107 | 650 | 0.0001 | - |
0.1192 | 700 | 0.0001 | - |
0.1277 | 750 | 0.0001 | - |
0.1363 | 800 | 0.0 | - |
0.1448 | 850 | 0.0 | - |
0.1533 | 900 | 0.0 | - |
0.1618 | 950 | 0.0 | - |
0.1703 | 1000 | 0.0 | - |
0.1788 | 1050 | 0.0 | - |
0.1874 | 1100 | 0.0 | - |
0.1959 | 1150 | 0.0 | - |
0.2044 | 1200 | 0.0 | - |
0.2129 | 1250 | 0.0 | - |
0.2214 | 1300 | 0.0 | - |
0.2299 | 1350 | 0.0 | - |
0.2385 | 1400 | 0.0 | - |
0.2470 | 1450 | 0.0 | - |
0.2555 | 1500 | 0.0 | - |
0.2640 | 1550 | 0.0 | - |
0.2725 | 1600 | 0.0 | - |
0.2810 | 1650 | 0.0 | - |
0.2896 | 1700 | 0.0 | - |
0.2981 | 1750 | 0.0 | - |
0.3066 | 1800 | 0.0 | - |
0.3151 | 1850 | 0.0 | - |
0.3236 | 1900 | 0.0 | - |
0.3321 | 1950 | 0.0 | - |
0.3407 | 2000 | 0.0 | - |
0.3492 | 2050 | 0.0 | - |
0.3577 | 2100 | 0.0 | - |
0.3662 | 2150 | 0.0 | - |
0.3747 | 2200 | 0.0 | - |
0.3832 | 2250 | 0.0 | - |
0.3918 | 2300 | 0.0 | - |
0.4003 | 2350 | 0.0 | - |
0.4088 | 2400 | 0.0 | - |
0.4173 | 2450 | 0.0 | - |
0.4258 | 2500 | 0.0 | - |
0.4343 | 2550 | 0.0 | - |
0.4429 | 2600 | 0.0 | - |
0.4514 | 2650 | 0.0 | - |
0.4599 | 2700 | 0.0 | - |
0.4684 | 2750 | 0.0 | - |
0.4769 | 2800 | 0.0 | - |
0.4854 | 2850 | 0.0 | - |
0.4940 | 2900 | 0.0 | - |
0.5025 | 2950 | 0.0 | - |
0.5110 | 3000 | 0.0 | - |
0.5195 | 3050 | 0.0 | - |
0.5280 | 3100 | 0.0 | - |
0.5365 | 3150 | 0.0 | - |
0.5451 | 3200 | 0.0 | - |
0.5536 | 3250 | 0.0 | - |
0.5621 | 3300 | 0.0 | - |
0.5706 | 3350 | 0.0 | - |
0.5791 | 3400 | 0.0 | - |
0.5876 | 3450 | 0.0 | - |
0.5962 | 3500 | 0.0 | - |
0.6047 | 3550 | 0.0 | - |
0.6132 | 3600 | 0.0 | - |
0.6217 | 3650 | 0.0 | - |
0.6302 | 3700 | 0.0 | - |
0.6387 | 3750 | 0.0 | - |
0.6472 | 3800 | 0.0 | - |
0.6558 | 3850 | 0.0 | - |
0.6643 | 3900 | 0.0 | - |
0.6728 | 3950 | 0.0 | - |
0.6813 | 4000 | 0.0 | - |
0.6898 | 4050 | 0.0 | - |
0.6983 | 4100 | 0.0 | - |
0.7069 | 4150 | 0.0 | - |
0.7154 | 4200 | 0.0 | - |
0.7239 | 4250 | 0.0 | - |
0.7324 | 4300 | 0.0 | - |
0.7409 | 4350 | 0.0 | - |
0.7494 | 4400 | 0.0 | - |
0.7580 | 4450 | 0.0 | - |
0.7665 | 4500 | 0.0 | - |
0.7750 | 4550 | 0.0 | - |
0.7835 | 4600 | 0.0 | - |
0.7920 | 4650 | 0.0 | - |
0.8005 | 4700 | 0.0 | - |
0.8091 | 4750 | 0.0 | - |
0.8176 | 4800 | 0.0 | - |
0.8261 | 4850 | 0.0 | - |
0.8346 | 4900 | 0.0 | - |
0.8431 | 4950 | 0.0 | - |
0.8516 | 5000 | 0.0 | - |
0.8602 | 5050 | 0.0 | - |
0.8687 | 5100 | 0.0 | - |
0.8772 | 5150 | 0.0 | - |
0.8857 | 5200 | 0.0 | - |
0.8942 | 5250 | 0.0 | - |
0.9027 | 5300 | 0.0 | - |
0.9113 | 5350 | 0.0 | - |
0.9198 | 5400 | 0.0 | - |
0.9283 | 5450 | 0.0 | - |
0.9368 | 5500 | 0.0 | - |
0.9453 | 5550 | 0.0 | - |
0.9538 | 5600 | 0.0 | - |
0.9624 | 5650 | 0.0 | - |
0.9709 | 5700 | 0.0 | - |
0.9794 | 5750 | 0.0 | - |
0.9879 | 5800 | 0.0 | - |
0.9964 | 5850 | 0.0 | - |
Framework Versions
- Python: 3.10.12
- SetFit: 1.1.0
- Sentence Transformers: 3.3.1
- Transformers: 4.42.2
- PyTorch: 2.5.1+cu121
- Datasets: 3.2.0
- Tokenizers: 0.19.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
- 10
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.