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_masked_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 fuecarece 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|)– (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.181 | - |
2.0 | 500 | 0.1334 | 0.3588 |
4.0 | 1000 | 0.0027 | 0.3582 |
6.0 | 1500 | 0.0009 | 0.3724 |
8.0 | 2000 | 0.0005 | 0.3818 |
10.0 | 2500 | 0.0004 | 0.3875 |
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
- 0
Inference Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
the model is not deployed on the HF Inference API.