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: 2 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 |
---|---|
political |
|
non-political |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.8878 |
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/MiniLM-ispolitical-german-zeroshot_v0.1")
# Run inference
preds = model("Das Coachella-Festival in der kalifornischen Wüste sorgt Jahr für Jahr für beeindruckende Bilder. Neben dem Star-Line-Up auf der Bühne steht das Event nämlich auch für ausgefallene Kostüme und Fahrzeuge im \"Mad-Max-Look\". Zwei Jahre lang mussten die Coachella-Fans jetzt aussetzen. Denn 2020 und 2021 konnte das Event – zu dem traditionell zehntausende Besucher kommen – coronabedingt nicht stattfinden.
Dementsprechend groß war in diesem Jahr die Feierlust, von der sich auch \"Temptation Island\"-Moderatorin Lola Weippert anstecken ließ. Die 26-Jährige war mit einigen Freundinnen bei dem Festival am vergangenen Wochenende. Bei Instagram hielt Lola für ihre Follower fest, wie sie das Spektakel erlebte. Neben vielen schönen Momenten berichtet sie hier auch leider von einer Begegnung, auf die sie gerne verzichtet hätte.
Sie sei \"mit einer deutschen Gruppe\" unterwegs gewesen, erzählt die RTL-Moderatorin, und eine der Frauen habe sie \"von Anfang an so abwertend gemustert, sich geweigert, sich...")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 36 | 124.8840 | 174 |
Label | Training Sample Count |
---|---|
non-political | 171 |
political | 122 |
Training Hyperparameters
- batch_size: (128, 128)
- num_epochs: (10, 10)
- 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
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: False
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0029 | 1 | 0.3219 | - |
0.1437 | 50 | 0.2316 | - |
0.2874 | 100 | 0.1009 | - |
0.4310 | 150 | 0.0031 | - |
0.5747 | 200 | 0.0003 | - |
0.7184 | 250 | 0.0002 | - |
0.8621 | 300 | 0.0001 | - |
1.0057 | 350 | 0.0001 | - |
1.1494 | 400 | 0.0001 | - |
1.2931 | 450 | 0.0 | - |
1.4368 | 500 | 0.0 | - |
1.5805 | 550 | 0.0 | - |
1.7241 | 600 | 0.0 | - |
1.8678 | 650 | 0.0 | - |
2.0115 | 700 | 0.0 | - |
2.1552 | 750 | 0.0 | - |
2.2989 | 800 | 0.0 | - |
2.4425 | 850 | 0.0 | - |
2.5862 | 900 | 0.0 | - |
2.7299 | 950 | 0.0 | - |
2.8736 | 1000 | 0.0 | - |
3.0172 | 1050 | 0.0 | - |
3.1609 | 1100 | 0.0 | - |
3.3046 | 1150 | 0.0 | - |
3.4483 | 1200 | 0.0 | - |
3.5920 | 1250 | 0.0 | - |
3.7356 | 1300 | 0.0 | - |
3.8793 | 1350 | 0.0 | - |
4.0230 | 1400 | 0.0 | - |
4.1667 | 1450 | 0.0 | - |
4.3103 | 1500 | 0.0 | - |
4.4540 | 1550 | 0.0 | - |
4.5977 | 1600 | 0.0 | - |
4.7414 | 1650 | 0.0 | - |
4.8851 | 1700 | 0.0 | - |
5.0287 | 1750 | 0.0 | - |
5.1724 | 1800 | 0.0 | - |
5.3161 | 1850 | 0.0 | - |
5.4598 | 1900 | 0.0 | - |
5.6034 | 1950 | 0.0 | - |
5.7471 | 2000 | 0.0 | - |
5.8908 | 2050 | 0.0 | - |
6.0345 | 2100 | 0.0 | - |
6.1782 | 2150 | 0.0 | - |
6.3218 | 2200 | 0.0 | - |
6.4655 | 2250 | 0.0 | - |
6.6092 | 2300 | 0.0 | - |
6.7529 | 2350 | 0.0 | - |
6.8966 | 2400 | 0.0 | - |
7.0402 | 2450 | 0.0 | - |
7.1839 | 2500 | 0.0 | - |
7.3276 | 2550 | 0.0 | - |
7.4713 | 2600 | 0.0 | - |
7.6149 | 2650 | 0.0 | - |
7.7586 | 2700 | 0.0 | - |
7.9023 | 2750 | 0.0 | - |
8.0460 | 2800 | 0.0 | - |
8.1897 | 2850 | 0.0 | - |
8.3333 | 2900 | 0.0 | - |
8.4770 | 2950 | 0.0 | - |
8.6207 | 3000 | 0.0 | - |
8.7644 | 3050 | 0.0 | - |
8.9080 | 3100 | 0.0 | - |
9.0517 | 3150 | 0.0 | - |
9.1954 | 3200 | 0.0 | - |
9.3391 | 3250 | 0.0 | - |
9.4828 | 3300 | 0.0 | - |
9.6264 | 3350 | 0.0 | - |
9.7701 | 3400 | 0.0 | - |
9.9138 | 3450 | 0.0 | - |
Framework Versions
- Python: 3.10.14
- SetFit: 1.0.3
- Sentence Transformers: 3.0.1
- Transformers: 4.40.2
- PyTorch: 2.0.0.post104
- Datasets: 2.20.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
- 0
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.