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 |
|
neg |
|
obj |
|
Evaluation
Metrics
Label | Accuracy_Score | Classification_Report |
---|---|---|
all | 0.9435 | {'0': {'precision': 0.9361702127659575, 'recall': 0.9322033898305084, 'f1-score': 0.9341825902335456, 'support': 236}, '1': {'precision': 0.9333333333333333, 'recall': 0.9302325581395349, 'f1-score': 0.9317803660565723, 'support': 301}, '2': {'precision': 0.9646017699115044, 'recall': 0.9732142857142857, 'f1-score': 0.9688888888888889, 'support': 224}, 'accuracy': 0.9434954007884363, 'macro avg': {'precision': 0.9447017720035985, 'recall': 0.945216744561443, 'f1-score': 0.9449506150596689, 'support': 761}, 'weighted avg': {'precision': 0.9434169513880108, 'recall': 0.9434954007884363, 'f1-score': 0.9434482162802315, '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_middle_offsets")
# 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 | 9 | 247.2638 | 2089 |
Label | Training Sample Count |
---|---|
neg | 913 |
obj | 1216 |
pos | 911 |
Training Hyperparameters
- batch_size: (8, 8)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 1
- 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
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: False
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0013 | 1 | 0.3703 | - |
0.0658 | 50 | 0.3145 | - |
0.1316 | 100 | 0.1839 | - |
0.1974 | 150 | 0.2558 | - |
0.2632 | 200 | 0.2683 | - |
0.3289 | 250 | 0.1572 | - |
0.3947 | 300 | 0.1953 | - |
0.4605 | 350 | 0.171 | - |
0.5263 | 400 | 0.2326 | - |
0.5921 | 450 | 0.1762 | - |
0.6579 | 500 | 0.2818 | - |
0.7237 | 550 | 0.2733 | - |
0.7895 | 600 | 0.195 | - |
0.8553 | 650 | 0.2104 | - |
0.9211 | 700 | 0.2124 | - |
0.9868 | 750 | 0.0818 | - |
1.0526 | 800 | 0.1046 | - |
1.1184 | 850 | 0.1633 | - |
1.1842 | 900 | 0.3207 | - |
1.25 | 950 | 0.2703 | - |
1.3158 | 1000 | 0.1934 | - |
1.3816 | 1050 | 0.2547 | - |
1.4474 | 1100 | 0.0933 | - |
1.5132 | 1150 | 0.2102 | - |
1.5789 | 1200 | 0.0699 | - |
1.6447 | 1250 | 0.1778 | - |
1.7105 | 1300 | 0.1796 | - |
1.7763 | 1350 | 0.0221 | - |
1.8421 | 1400 | 0.2154 | - |
1.9079 | 1450 | 0.1683 | - |
1.9737 | 1500 | 0.3096 | - |
2.0395 | 1550 | 0.201 | - |
2.1053 | 1600 | 0.1954 | - |
2.1711 | 1650 | 0.2301 | - |
2.2368 | 1700 | 0.1141 | - |
2.3026 | 1750 | 0.1949 | - |
2.3684 | 1800 | 0.164 | - |
2.4342 | 1850 | 0.2307 | - |
2.5 | 1900 | 0.1912 | - |
2.5658 | 1950 | 0.2349 | - |
2.6316 | 2000 | 0.0922 | - |
2.6974 | 2050 | 0.0702 | - |
2.7632 | 2100 | 0.1089 | - |
2.8289 | 2150 | 0.1711 | - |
2.8947 | 2200 | 0.1432 | - |
2.9605 | 2250 | 0.2739 | - |
3.0263 | 2300 | 0.1889 | - |
3.0921 | 2350 | 0.1036 | - |
3.1579 | 2400 | 0.1372 | - |
3.2237 | 2450 | 0.028 | - |
3.2895 | 2500 | 0.1739 | - |
3.3553 | 2550 | 0.142 | - |
3.4211 | 2600 | 0.0838 | - |
3.4868 | 2650 | 0.0657 | - |
3.5526 | 2700 | 0.0054 | - |
3.6184 | 2750 | 0.0426 | - |
3.6842 | 2800 | 0.1974 | - |
3.75 | 2850 | 0.0279 | - |
3.8158 | 2900 | 0.1326 | - |
3.8816 | 2950 | 0.1614 | - |
3.9474 | 3000 | 0.1251 | - |
4.0132 | 3050 | 0.1174 | - |
4.0789 | 3100 | 0.1948 | - |
4.1447 | 3150 | 0.0555 | - |
4.2105 | 3200 | 0.0064 | - |
4.2763 | 3250 | 0.064 | - |
4.3421 | 3300 | 0.0013 | - |
4.4079 | 3350 | 0.135 | - |
4.4737 | 3400 | 0.0574 | - |
4.5395 | 3450 | 0.174 | - |
4.6053 | 3500 | 0.2199 | - |
4.6711 | 3550 | 0.387 | - |
4.7368 | 3600 | 0.114 | - |
4.8026 | 3650 | 0.0853 | - |
4.8684 | 3700 | 0.0325 | - |
4.9342 | 3750 | 0.019 | - |
5.0 | 3800 | 0.0572 | - |
0.0013 | 1 | 0.1435 | - |
0.0658 | 50 | 0.0969 | - |
0.1316 | 100 | 0.1085 | - |
0.1974 | 150 | 0.0271 | - |
0.2632 | 200 | 0.0138 | - |
0.3289 | 250 | 0.058 | - |
0.3947 | 300 | 0.1205 | - |
0.4605 | 350 | 0.0788 | - |
0.5263 | 400 | 0.1449 | - |
0.5921 | 450 | 0.0383 | - |
0.6579 | 500 | 0.0338 | - |
0.7237 | 550 | 0.1253 | - |
0.7895 | 600 | 0.069 | - |
0.8553 | 650 | 0.104 | - |
0.9211 | 700 | 0.0462 | - |
0.9868 | 750 | 0.1975 | - |
1.0526 | 800 | 0.0241 | - |
1.1184 | 850 | 0.0426 | - |
1.1842 | 900 | 0.0519 | - |
1.25 | 950 | 0.0815 | - |
1.3158 | 1000 | 0.1839 | - |
1.3816 | 1050 | 0.0198 | - |
1.4474 | 1100 | 0.0128 | - |
1.5132 | 1150 | 0.1645 | - |
1.5789 | 1200 | 0.0019 | - |
1.6447 | 1250 | 0.0557 | - |
1.7105 | 1300 | 0.0098 | - |
1.7763 | 1350 | 0.001 | - |
1.8421 | 1400 | 0.1557 | - |
1.9079 | 1450 | 0.1286 | - |
1.9737 | 1500 | 0.094 | - |
2.0395 | 1550 | 0.0059 | - |
2.1053 | 1600 | 0.0227 | - |
2.1711 | 1650 | 0.0899 | - |
2.2368 | 1700 | 0.0053 | - |
2.3026 | 1750 | 0.0021 | - |
2.3684 | 1800 | 0.0114 | - |
2.4342 | 1850 | 0.1163 | - |
2.5 | 1900 | 0.0959 | - |
2.5658 | 1950 | 0.0252 | - |
2.6316 | 2000 | 0.0921 | - |
2.6974 | 2050 | 0.1159 | - |
2.7632 | 2100 | 0.0026 | - |
2.8289 | 2150 | 0.1211 | - |
2.8947 | 2200 | 0.1843 | - |
2.9605 | 2250 | 0.0014 | - |
3.0263 | 2300 | 0.0085 | - |
3.0921 | 2350 | 0.0839 | - |
3.1579 | 2400 | 0.2372 | - |
3.2237 | 2450 | 0.0213 | - |
3.2895 | 2500 | 0.0155 | - |
3.3553 | 2550 | 0.1128 | - |
3.4211 | 2600 | 0.0945 | - |
3.4868 | 2650 | 0.0917 | - |
3.5526 | 2700 | 0.0011 | - |
3.6184 | 2750 | 0.0024 | - |
3.6842 | 2800 | 0.0044 | - |
3.75 | 2850 | 0.121 | - |
3.8158 | 2900 | 0.0056 | - |
3.8816 | 2950 | 0.003 | - |
3.9474 | 3000 | 0.0899 | - |
4.0132 | 3050 | 0.0157 | - |
4.0789 | 3100 | 0.1188 | - |
4.1447 | 3150 | 0.001 | - |
4.2105 | 3200 | 0.0222 | - |
4.2763 | 3250 | 0.1209 | - |
4.3421 | 3300 | 0.1085 | - |
4.4079 | 3350 | 0.0054 | - |
4.4737 | 3400 | 0.0009 | - |
4.5395 | 3450 | 0.0015 | - |
4.6053 | 3500 | 0.003 | - |
4.6711 | 3550 | 0.0009 | - |
4.7368 | 3600 | 0.0003 | - |
4.8026 | 3650 | 0.0009 | - |
4.8684 | 3700 | 0.03 | - |
4.9342 | 3750 | 0.1206 | - |
5.0 | 3800 | 0.0003 | - |
0.0013 | 1 | 0.2045 | - |
0.0658 | 50 | 0.0078 | - |
0.1316 | 100 | 0.0087 | - |
0.1974 | 150 | 0.0386 | - |
0.2632 | 200 | 0.1015 | - |
0.3289 | 250 | 0.0022 | - |
0.3947 | 300 | 0.0291 | - |
0.4605 | 350 | 0.0013 | - |
0.5263 | 400 | 0.0022 | - |
0.5921 | 450 | 0.1324 | - |
0.6579 | 500 | 0.113 | - |
0.7237 | 550 | 0.0011 | - |
0.7895 | 600 | 0.1723 | - |
0.8553 | 650 | 0.0049 | - |
0.9211 | 700 | 0.206 | - |
0.9868 | 750 | 0.1683 | - |
1.0526 | 800 | 0.0954 | - |
1.1184 | 850 | 0.018 | - |
1.1842 | 900 | 0.1854 | - |
1.25 | 950 | 0.0342 | - |
1.3158 | 1000 | 0.0015 | - |
1.3816 | 1050 | 0.0062 | - |
1.4474 | 1100 | 0.1187 | - |
1.5132 | 1150 | 0.0048 | - |
1.5789 | 1200 | 0.0011 | - |
1.6447 | 1250 | 0.002 | - |
1.7105 | 1300 | 0.092 | - |
1.7763 | 1350 | 0.1245 | - |
1.8421 | 1400 | 0.0009 | - |
1.9079 | 1450 | 0.1185 | - |
1.9737 | 1500 | 0.0017 | - |
2.0395 | 1550 | 0.008 | - |
2.1053 | 1600 | 0.0049 | - |
2.1711 | 1650 | 0.0083 | - |
2.2368 | 1700 | 0.0026 | - |
2.3026 | 1750 | 0.0081 | - |
2.3684 | 1800 | 0.0036 | - |
2.4342 | 1850 | 0.0016 | - |
2.5 | 1900 | 0.0017 | - |
2.5658 | 1950 | 0.0014 | - |
2.6316 | 2000 | 0.0017 | - |
2.6974 | 2050 | 0.002 | - |
2.7632 | 2100 | 0.1022 | - |
2.8289 | 2150 | 0.0004 | - |
2.8947 | 2200 | 0.0007 | - |
2.9605 | 2250 | 0.0794 | - |
3.0263 | 2300 | 0.0183 | - |
3.0921 | 2350 | 0.0377 | - |
3.1579 | 2400 | 0.029 | - |
3.2237 | 2450 | 0.0003 | - |
3.2895 | 2500 | 0.0961 | - |
3.3553 | 2550 | 0.0008 | - |
3.4211 | 2600 | 0.0873 | - |
3.4868 | 2650 | 0.0501 | - |
3.5526 | 2700 | 0.0029 | - |
3.6184 | 2750 | 0.0008 | - |
3.6842 | 2800 | 0.0004 | - |
3.75 | 2850 | 0.0011 | - |
3.8158 | 2900 | 0.0518 | - |
3.8816 | 2950 | 0.0002 | - |
3.9474 | 3000 | 0.1115 | - |
4.0132 | 3050 | 0.0129 | - |
4.0789 | 3100 | 0.0005 | - |
4.1447 | 3150 | 0.0012 | - |
4.2105 | 3200 | 0.1086 | - |
4.2763 | 3250 | 0.0199 | - |
4.3421 | 3300 | 0.0004 | - |
4.4079 | 3350 | 0.0001 | - |
4.4737 | 3400 | 0.0832 | - |
4.5395 | 3450 | 0.0003 | - |
4.6053 | 3500 | 0.0041 | - |
4.6711 | 3550 | 0.1146 | - |
4.7368 | 3600 | 0.0027 | - |
4.8026 | 3650 | 0.0002 | - |
4.8684 | 3700 | 0.0544 | - |
4.9342 | 3750 | 0.0002 | - |
5.0 | 3800 | 0.0046 | - |
0.0013 | 1 | 0.0015 | - |
0.0658 | 50 | 0.1973 | - |
0.1316 | 100 | 0.0106 | - |
0.1974 | 150 | 0.0744 | - |
0.2632 | 200 | 0.1033 | - |
0.3289 | 250 | 0.0425 | - |
0.3947 | 300 | 0.1125 | - |
0.4605 | 350 | 0.0018 | - |
0.5263 | 400 | 0.0019 | - |
0.5921 | 450 | 0.0002 | - |
0.6579 | 500 | 0.0007 | - |
0.7237 | 550 | 0.1393 | - |
0.7895 | 600 | 0.0002 | - |
0.8553 | 650 | 0.0043 | - |
0.9211 | 700 | 0.0339 | - |
0.9868 | 750 | 0.0002 | - |
0.0013 | 1 | 0.0007 | - |
0.0658 | 50 | 0.0419 | - |
0.1316 | 100 | 0.0068 | - |
0.1974 | 150 | 0.1401 | - |
0.2632 | 200 | 0.0423 | - |
0.3289 | 250 | 0.1122 | - |
0.3947 | 300 | 0.0037 | - |
0.4605 | 350 | 0.005 | - |
0.5263 | 400 | 0.0006 | - |
0.5921 | 450 | 0.0006 | - |
0.6579 | 500 | 0.0016 | - |
0.7237 | 550 | 0.1244 | - |
0.7895 | 600 | 0.0016 | - |
0.8553 | 650 | 0.0028 | - |
0.9211 | 700 | 0.002 | - |
0.9868 | 750 | 0.057 | - |
0.0013 | 1 | 0.1396 | - |
0.0658 | 50 | 0.0366 | - |
0.1316 | 100 | 0.0021 | - |
0.1974 | 150 | 0.1088 | - |
0.2632 | 200 | 0.0449 | - |
0.3289 | 250 | 0.0187 | - |
0.3947 | 300 | 0.0017 | - |
0.4605 | 350 | 0.1262 | - |
0.5263 | 400 | 0.0052 | - |
0.5921 | 450 | 0.1188 | - |
0.6579 | 500 | 0.0002 | - |
0.7237 | 550 | 0.0006 | - |
0.7895 | 600 | 0.0758 | - |
0.8553 | 650 | 0.025 | - |
0.9211 | 700 | 0.0052 | - |
0.9868 | 750 | 0.1985 | - |
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.15.0
- 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
- 20
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_middle_offsets
Evaluation results
- Accuracy_Score on Unknowntest set self-reported0.943
- Classification_Report on Unknowntest set self-reported[object Object]