SetFit with sentence-transformers/all-MiniLM-L6-v2
This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/all-MiniLM-L6-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 Sources
Model Labels
| Label |
Examples |
| ๐จโโ๏ธ Legal |
- 'Airmoney Expiration Policy Update Hi alex ,\r\n\r\n \r\n\r\nFrom February 1, 2025, your Airmoney can expire \u2014 this will always apply to your total balance, not partial amounts of Airmoney. \r\n\r\n \r\n\r\nYour Airmoney balance is set to expire on 1st February 2026.\r\n\r\nYour current Airmoney balance is 10.88 USD*.\r\n\r\n \r\n\r\nBelow, you\u2019ll find details to help you understand how this change applies to you.\r\n\r\n \r\n\r\nDoes my Airmoney balance have to expire?\r\n\r\n \r\n\r\nNo, your Air'
- 'Meta Privacy Policy update Meta Privacy Policy update\r\n \r\nHi Alex,\r\n \r\nWe\u2019re updating the Meta Privacy Policy to clarify some details.\r\n \r\nWhat you should know\r\n \r\nHere are the details that this update clarifies:\r\n \r\n\u2022\tHow we use information from third parties\r\n\u2022\tLegitimate interests is now our legal basis for using your information to improve Meta Products. Learn what this means for your rights\r\n\u2022\tWhen your information can be accessible to search engines\r\n \'
- "Google Play Developer Program Policy Update DEVELOPER UPDATE\r\nHello Google Play Developer,\r\nTo give users more control over their data, we're updating our Health Connect policy to strengthen safeguards regarding the handling of sensitive health record data. Health Connect is an Android platform that allows health and fitness apps to store and share the same on-device data, within a unified ecosystem. It also offers a single place for users to control which apps can read and write health and fitness data"
|
| ๐ฎ๐ฝโโ๏ธ Security |
- "Petcube security: Sign-in notifications Hi, alexeysheiko.\r\n\r\nWe noticed a recent login to your Petcube account.\r\n\r\nTimestamp (UTC): 2025-05-04T08:19:58+00:00\r\n\r\nIP address: 85.114.207.94\r\n\r\nIf this was you, no action is required. If this wasn't you, follow the link to secure your account. Reset password\r\nWags & Purrs,\r\nPetcube Team"
- 'A new device is using your account A new device is using your account\r\nHi Oleksii,\r\nA new device signed in to your Netflix account, alexsheikodev@gmail.com.\r\n \r\nThe details\r\nDevice\r\nMac Chrome - Web Browser\r\nLocation\r\nMazovia, Poland\r\n(This location may not be exact.)\r\nTime\r\nJune 19th, 3:21 PM GMT+3\r\n \r\nIf this was you or someone in your household:\r\nEnjoy watching!\r\nIf it was someone else:\r\nPlease remember that we only allow the people in your household to use your account.\r'
|
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
model = SetFitModel.from_pretrained("setfit_model_id")
preds = model("\"The Impact of Assessment for 21 st Century Skills in Higher Education Institutions: A Narrative Literature Review\" by Rany Sam You read the paper Assessing 21st century skills: Integrating research findings. We found a related paper on Academia:\r\n\r\nThe Impact of Assessment for 21 st Century Skills in Higher Education Institutions: A Narrative Literature Review\r\nPaper Thumbnail\t\r\nAuthor Photo Rany Sam\r\n2024, Multitech Publisher\r\n23 Views \r\nView PDF \u25B8\r\n \t\t\r\nDownload PDF \u2B07\r\n\r")
Training Details
Training Set Metrics
| Training set |
Min |
Median |
Max |
| Word count |
9 |
59.875 |
79 |
| Label |
Training Sample Count |
| ๐จโโ๏ธ Legal |
6 |
| ๐ฎ๐ฝโโ๏ธ Security |
2 |
Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (2, 2)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 30
- 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.0333 |
1 |
0.2806 |
- |
| 1.6667 |
50 |
0.038 |
- |
Framework Versions
- Python: 3.13.5
- SetFit: 1.1.2
- Sentence Transformers: 4.1.0
- Transformers: 4.52.4
- PyTorch: 2.7.1
- Datasets: 3.6.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}
}