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 |
---|---|
pos |
|
obj |
|
neg |
|
Evaluation
Metrics
Label | 0 | 1 | 2 | Accuracy | Macro Avg | Weighted Avg |
---|---|---|---|---|---|---|
all | {'precision': 0.6018099547511312, 'recall': 0.5611814345991561, 'f1-score': 0.5807860262008734, 'support': 237} | {'precision': 0.5602409638554217, 'recall': 0.6262626262626263, 'f1-score': 0.591414944356121, 'support': 297} | {'precision': 0.7932692307692307, 'recall': 0.7268722466960352, 'f1-score': 0.7586206896551724, 'support': 227} | 0.6360 | {'precision': 0.6517733831252612, 'recall': 0.6381054358526059, 'f1-score': 0.6436072200707222, 'support': 761} | {'precision': 0.642697294251897, 'recall': 0.6360052562417872, 'f1-score': 0.6379808452498016, 'support': 761} |
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("mogaio/pr_ebsa_fr_tran_merged25_e1_beginning_offsets_10_v3")
# Run inference
preds = model("Adil Hussain
Adil Hussain est reconnaissant d'avoir reçu l'enseignement de l'acteur Naseeruddin Shah à l'époque où il fréquentait l'École nationale d'art dramatique")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 1 | 243.9997 | 2071 |
Label | Training Sample Count |
---|---|
neg | 912 |
obj | 1220 |
pos | 908 |
Training Hyperparameters
- batch_size: (8, 8)
- num_epochs: (10, 10)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 1
- 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
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: True
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0013 | 1 | 0.3526 | - |
0.0658 | 50 | 0.3825 | - |
0.1316 | 100 | 0.2039 | - |
0.1974 | 150 | 0.2579 | - |
0.2632 | 200 | 0.3062 | - |
0.3289 | 250 | 0.1744 | - |
0.3947 | 300 | 0.1571 | - |
0.4605 | 350 | 0.222 | - |
0.5263 | 400 | 0.2697 | - |
0.5921 | 450 | 0.2507 | - |
0.6579 | 500 | 0.311 | - |
0.7237 | 550 | 0.3169 | - |
0.7895 | 600 | 0.1766 | - |
0.8553 | 650 | 0.1756 | - |
0.9211 | 700 | 0.2497 | - |
0.9868 | 750 | 0.0889 | - |
1.0 | 760 | - | 0.2281 |
1.0526 | 800 | 0.1036 | - |
1.1184 | 850 | 0.3135 | - |
1.1842 | 900 | 0.1744 | - |
1.25 | 950 | 0.3287 | - |
1.3158 | 1000 | 0.1816 | - |
1.3816 | 1050 | 0.231 | - |
1.4474 | 1100 | 0.153 | - |
1.5132 | 1150 | 0.2131 | - |
1.5789 | 1200 | 0.1358 | - |
1.6447 | 1250 | 0.276 | - |
1.7105 | 1300 | 0.2646 | - |
1.7763 | 1350 | 0.0337 | - |
1.8421 | 1400 | 0.158 | - |
1.9079 | 1450 | 0.1123 | - |
1.9737 | 1500 | 0.0889 | - |
2.0 | 1520 | - | 0.2268 |
2.0395 | 1550 | 0.2369 | - |
2.1053 | 1600 | 0.196 | - |
2.1711 | 1650 | 0.2799 | - |
2.2368 | 1700 | 0.073 | - |
2.3026 | 1750 | 0.2392 | - |
2.3684 | 1800 | 0.1551 | - |
2.4342 | 1850 | 0.178 | - |
2.5 | 1900 | 0.1719 | - |
2.5658 | 1950 | 0.1203 | - |
2.6316 | 2000 | 0.1502 | - |
2.6974 | 2050 | 0.0963 | - |
2.7632 | 2100 | 0.1566 | - |
2.8289 | 2150 | 0.1273 | - |
2.8947 | 2200 | 0.264 | - |
2.9605 | 2250 | 0.0736 | - |
3.0 | 2280 | - | 0.2385 |
3.0263 | 2300 | 0.1577 | - |
3.0921 | 2350 | 0.1613 | - |
3.1579 | 2400 | 0.2313 | - |
3.2237 | 2450 | 0.1134 | - |
3.2895 | 2500 | 0.0593 | - |
3.3553 | 2550 | 0.0395 | - |
3.4211 | 2600 | 0.119 | - |
3.4868 | 2650 | 0.0152 | - |
3.5526 | 2700 | 0.019 | - |
3.6184 | 2750 | 0.1056 | - |
3.6842 | 2800 | 0.1355 | - |
3.75 | 2850 | 0.2262 | - |
3.8158 | 2900 | 0.102 | - |
3.8816 | 2950 | 0.2388 | - |
3.9474 | 3000 | 0.1755 | - |
4.0 | 3040 | - | 0.2576 |
4.0132 | 3050 | 0.0957 | - |
4.0789 | 3100 | 0.2034 | - |
4.1447 | 3150 | 0.0076 | - |
4.2105 | 3200 | 0.0431 | - |
4.2763 | 3250 | 0.2228 | - |
4.3421 | 3300 | 0.0124 | - |
4.4079 | 3350 | 0.2316 | - |
4.4737 | 3400 | 0.037 | - |
4.5395 | 3450 | 0.1812 | - |
4.6053 | 3500 | 0.2115 | - |
4.6711 | 3550 | 0.2534 | - |
4.7368 | 3600 | 0.1833 | - |
4.8026 | 3650 | 0.0135 | - |
4.8684 | 3700 | 0.1169 | - |
4.9342 | 3750 | 0.0093 | - |
5.0 | 3800 | 0.0728 | 0.2787 |
5.0658 | 3850 | 0.022 | - |
5.1316 | 3900 | 0.0586 | - |
5.1974 | 3950 | 0.002 | - |
5.2632 | 4000 | 0.1112 | - |
5.3289 | 4050 | 0.0902 | - |
5.3947 | 4100 | 0.0002 | - |
5.4605 | 4150 | 0.108 | - |
5.5263 | 4200 | 0.0158 | - |
5.5921 | 4250 | 0.0725 | - |
5.6579 | 4300 | 0.0014 | - |
5.7237 | 4350 | 0.2018 | - |
5.7895 | 4400 | 0.0023 | - |
5.8553 | 4450 | 0.002 | - |
5.9211 | 4500 | 0.213 | - |
5.9868 | 4550 | 0.0034 | - |
6.0 | 4560 | - | 0.2994 |
6.0526 | 4600 | 0.1203 | - |
6.1184 | 4650 | 0.1615 | - |
6.1842 | 4700 | 0.1968 | - |
6.25 | 4750 | 0.004 | - |
6.3158 | 4800 | 0.0018 | - |
6.3816 | 4850 | 0.048 | - |
6.4474 | 4900 | 0.0748 | - |
6.5132 | 4950 | 0.0007 | - |
6.5789 | 5000 | 0.0019 | - |
6.6447 | 5050 | 0.0015 | - |
6.7105 | 5100 | 0.0075 | - |
6.7763 | 5150 | 0.0012 | - |
6.8421 | 5200 | 0.0016 | - |
6.9079 | 5250 | 0.0009 | - |
6.9737 | 5300 | 0.0004 | - |
7.0 | 5320 | - | 0.2721 |
7.0395 | 5350 | 0.0142 | - |
7.1053 | 5400 | 0.0527 | - |
7.1711 | 5450 | 0.0019 | - |
7.2368 | 5500 | 0.0024 | - |
7.3026 | 5550 | 0.0002 | - |
7.3684 | 5600 | 0.0349 | - |
7.4342 | 5650 | 0.0008 | - |
7.5 | 5700 | 0.0008 | - |
7.5658 | 5750 | 0.0005 | - |
7.6316 | 5800 | 0.0002 | - |
7.6974 | 5850 | 0.0024 | - |
7.7632 | 5900 | 0.0017 | - |
7.8289 | 5950 | 0.0002 | - |
7.8947 | 6000 | 0.0028 | - |
7.9605 | 6050 | 0.0124 | - |
8.0 | 6080 | - | 0.3064 |
8.0263 | 6100 | 0.0038 | - |
8.0921 | 6150 | 0.064 | - |
8.1579 | 6200 | 0.0007 | - |
8.2237 | 6250 | 0.0022 | - |
8.2895 | 6300 | 0.0012 | - |
8.3553 | 6350 | 0.0103 | - |
8.4211 | 6400 | 0.0008 | - |
8.4868 | 6450 | 0.0058 | - |
8.5526 | 6500 | 0.0046 | - |
8.6184 | 6550 | 0.1061 | - |
8.6842 | 6600 | 0.0005 | - |
8.75 | 6650 | 0.1509 | - |
8.8158 | 6700 | 0.0027 | - |
8.8816 | 6750 | 0.0002 | - |
8.9474 | 6800 | 0.0006 | - |
9.0 | 6840 | - | 0.3014 |
9.0132 | 6850 | 0.0018 | - |
9.0789 | 6900 | 0.0006 | - |
9.1447 | 6950 | 0.0003 | - |
9.2105 | 7000 | 0.0007 | - |
9.2763 | 7050 | 0.0006 | - |
9.3421 | 7100 | 0.0003 | - |
9.4079 | 7150 | 0.1859 | - |
9.4737 | 7200 | 0.0009 | - |
9.5395 | 7250 | 0.12 | - |
9.6053 | 7300 | 0.0148 | - |
9.6711 | 7350 | 0.0002 | - |
9.7368 | 7400 | 0.0005 | - |
9.8026 | 7450 | 0.1027 | - |
9.8684 | 7500 | 0.0002 | - |
9.9342 | 7550 | 0.0004 | - |
10.0 | 7600 | 0.0003 | 0.3075 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.10.12
- SetFit: 1.0.1
- Sentence Transformers: 2.2.2
- Transformers: 4.35.2
- PyTorch: 2.1.0+cu121
- Datasets: 2.16.1
- Tokenizers: 0.15.0
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
- 5
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.
Model tree for mogaio/pr_ebsa_fr_tran_merged25_e1_beginning_offsets_10_v3
Evaluation results
- 0 on Unknowntest set self-reported[object Object]
- 1 on Unknowntest set self-reported[object Object]
- 2 on Unknowntest set self-reported[object Object]
- Accuracy on Unknowntest set self-reported0.636
- Macro Avg on Unknowntest set self-reported[object Object]
- Weighted Avg on Unknowntest set self-reported[object Object]