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: 4 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 |
---|---|
0 |
|
2 |
|
1 |
|
3 |
|
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("research-dump/paraphrase-multilingual-MiniLM-L12-v2_wikipedia_es_outcome_prediction_gr")
# Run inference
preds = model("
La siguiente discusión es una consulta de borrado archivada.Por favor, no la modifiques.Los comentarios siguientes deben hacerse en la página de discusión apropiada (la discusión del artículo o en unaconsulta de restauración). No se deben realizar más ediciones en esta página.El resultado fueBorrarCarece deverificabilidad, las referencias son inválidasEsteban(discusión)23:16 23 sep 2010 (UTC)[responder]Ciudad Bolívar (Barrio)[editar]Ciudad Bolívar (Barrio)(editar|discusión|historial|enlaces|vigilar|registros|proteger|borrar)– (Ver registro del día)Un mes con la plantilla sin relevancia aparente. Defendida en discusión y ampliada.Taichi〒06:40 9 sep 2010 (UTC)[responder]Bórreseinformación incorrecta y pretenciosa --Don Pownerus de la Mancha(Mensajes)19:00 9 sep 2010 (UTC)[responder]BórreseEstoy plenamente de acuerdo, ademas no tiene las fuentes que indiquen como esta conformado el barrio, su historia, actividades socio-económicas, los limites y sitios destacables. --Oscarín Orbitus(discusión)23:57 9 sep 2010 (UTC)[responder]BórreseLas referencias no parecen sustentar el articulo, ademas, me parece que para decir que un determinado sitio es \"un tugurio\" se necesitan muy buenas fuentes o caeriamos en difamacion. Es demasiado corto y demasiado sesgado para permanecer.Andrea(discusión)15:30 16 sep 2010 (UTC)[responder]Bórreseaunque el barrio merecerá, sin duda, un lugar en Wikipedia, el artículo no es aceptable por cuanto se limita a aportar determinadas apreciaciones \"noticiosas\" sobre el mismo, careciendo de contenido enciclopédico.Pepepitos(discusión)18:51 23 sep 2010 (UTC)[responder]La discusión anterior se conserva como registro del debate.Por favor, no la modifiques.Esta página no se debe editar más.")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 59 | 703.43 | 6784 |
Label | Training Sample Count |
---|---|
0 | 69 |
1 | 3 |
2 | 25 |
3 | 3 |
Training Hyperparameters
- batch_size: (8, 2)
- num_epochs: (10, 10)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 10
- body_learning_rate: (1e-05, 1e-05)
- head_learning_rate: 5e-05
- loss: CosineSimilarityLoss
- distance_metric: cosine_distance
- margin: 0.25
- end_to_end: True
- use_amp: True
- 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.004 | 1 | 0.1701 | - |
2.0 | 500 | 0.1034 | 0.1161 |
4.0 | 1000 | 0.0009 | 0.1125 |
6.0 | 1500 | 0.0003 | 0.1186 |
8.0 | 2000 | 0.0002 | 0.1198 |
10.0 | 2500 | 0.0001 | 0.1206 |
Framework Versions
- Python: 3.12.7
- SetFit: 1.1.1
- Sentence Transformers: 3.4.1
- Transformers: 4.48.2
- PyTorch: 2.6.0+cu124
- Datasets: 3.2.0
- Tokenizers: 0.21.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
- 4
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.