metadata
library_name: setfit
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
metrics:
- accuracy
widget:
- text: ' i still dont know what we would do though'
- text: ' where`d you go!'
- text: ' Thank you! I`m working on `s'
- text: Terminator Salvation... by myself.
- text: ' lol man i got 2 1 /2 hrs an iont how i woulda made it wit out my ramen noodles and t.v. Time'
pipeline_tag: text-classification
inference: true
base_model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
model-index:
- name: SetFit with sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: Unknown
type: unknown
split: test
metrics:
- type: accuracy
value: 0.77
name: Accuracy
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: 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 |
---|---|
0 |
|
1 |
|
2 |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.77 |
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("ehsanhallo/setfit-paraphrase-multilingual-MiniLM-L12-v2-ig-fa")
# Run inference
preds = model(" where`d you go!")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 1 | 7.0 | 75 |
Label | Training Sample Count |
---|---|
0 | 31 |
1 | 131 |
2 | 364 |
Training Hyperparameters
- batch_size: (32, 16)
- num_epochs: (2, 4)
- max_steps: -1
- sampling_strategy: oversampling
- body_learning_rate: (2e-05, 5e-06)
- head_learning_rate: 0.002
- 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: True
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0002 | 1 | 0.1854 | - |
0.0529 | 250 | 0.0626 | - |
0.1058 | 500 | 0.0034 | 0.2484 |
0.1588 | 750 | 0.0029 | - |
0.2117 | 1000 | 0.001 | 0.1899 |
0.2646 | 1250 | 0.0001 | - |
0.3175 | 1500 | 0.0001 | 0.1849 |
0.3704 | 1750 | 0.0001 | - |
0.4234 | 2000 | 0.0001 | 0.1876 |
0.4763 | 2250 | 0.0001 | - |
0.5292 | 2500 | 0.0 | 0.1888 |
0.5821 | 2750 | 0.0001 | - |
0.6351 | 3000 | 0.0 | 0.1885 |
0.6880 | 3250 | 0.0 | - |
0.7409 | 3500 | 0.0 | 0.1915 |
0.7938 | 3750 | 0.0 | - |
0.8467 | 4000 | 0.0 | 0.1947 |
0.8997 | 4250 | 0.0 | - |
0.9526 | 4500 | 0.0 | 0.1986 |
1.0055 | 4750 | 0.0 | - |
1.0584 | 5000 | 0.0 | 0.207 |
1.1113 | 5250 | 0.0 | - |
1.1643 | 5500 | 0.0 | 0.2078 |
1.2172 | 5750 | 0.0 | - |
1.2701 | 6000 | 0.0 | 0.2096 |
1.3230 | 6250 | 0.0 | - |
1.3760 | 6500 | 0.0 | 0.2095 |
1.4289 | 6750 | 0.0 | - |
1.4818 | 7000 | 0.0 | 0.2103 |
1.5347 | 7250 | 0.0 | - |
1.5876 | 7500 | 0.0 | 0.2133 |
1.6406 | 7750 | 0.0 | - |
1.6935 | 8000 | 0.0 | 0.2154 |
1.7464 | 8250 | 0.0 | - |
1.7993 | 8500 | 0.0 | 0.2141 |
1.8522 | 8750 | 0.0 | - |
1.9052 | 9000 | 0.0 | 0.2141 |
1.9581 | 9250 | 0.0 | - |
- The bold row denotes the saved checkpoint.
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.16.1
- 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}
}