SetFit with sentence-transformers/all-mpnet-base-v2
This is a SetFit model trained on the bhaskars113/toyota-paint-attributes dataset that can be used for Text Classification. This SetFit model uses sentence-transformers/all-mpnet-base-v2 as the Sentence Transformer embedding model. A OneVsRestClassifier 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/all-mpnet-base-v2
- Classification head: a OneVsRestClassifier instance
- Maximum Sequence Length: 384 tokens
- Training Dataset: bhaskars113/toyota-paint-attributes
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
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("bhaskars113/toyota-paint-attribute-1.1")
# Run inference
preds = model("The car is from Utah and garage kept, so the paint is still in very good condition")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 5 | 33.8098 | 155 |
Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 20
- 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
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: False
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0004 | 1 | 0.1664 | - |
0.0196 | 50 | 0.2377 | - |
0.0392 | 100 | 0.1178 | - |
0.0588 | 150 | 0.0577 | - |
0.0784 | 200 | 0.0163 | - |
0.0980 | 250 | 0.0265 | - |
0.1176 | 300 | 0.0867 | - |
0.1373 | 350 | 0.0181 | - |
0.1569 | 400 | 0.0153 | - |
0.1765 | 450 | 0.0411 | - |
0.1961 | 500 | 0.0308 | - |
0.2157 | 550 | 0.0258 | - |
0.2353 | 600 | 0.0062 | - |
0.2549 | 650 | 0.0036 | - |
0.2745 | 700 | 0.0087 | - |
0.2941 | 750 | 0.0025 | - |
0.3137 | 800 | 0.004 | - |
0.3333 | 850 | 0.0025 | - |
0.3529 | 900 | 0.0044 | - |
0.3725 | 950 | 0.0031 | - |
0.3922 | 1000 | 0.0018 | - |
0.4118 | 1050 | 0.0046 | - |
0.4314 | 1100 | 0.0013 | - |
0.4510 | 1150 | 0.0014 | - |
0.4706 | 1200 | 0.002 | - |
0.4902 | 1250 | 0.0015 | - |
0.5098 | 1300 | 0.0039 | - |
0.5294 | 1350 | 0.0019 | - |
0.5490 | 1400 | 0.0011 | - |
0.5686 | 1450 | 0.0008 | - |
0.5882 | 1500 | 0.0015 | - |
0.6078 | 1550 | 0.0012 | - |
0.6275 | 1600 | 0.0011 | - |
0.6471 | 1650 | 0.0008 | - |
0.6667 | 1700 | 0.0016 | - |
0.6863 | 1750 | 0.0009 | - |
0.7059 | 1800 | 0.0008 | - |
0.7255 | 1850 | 0.0008 | - |
0.7451 | 1900 | 0.0008 | - |
0.7647 | 1950 | 0.0011 | - |
0.7843 | 2000 | 0.0008 | - |
0.8039 | 2050 | 0.001 | - |
0.8235 | 2100 | 0.001 | - |
0.8431 | 2150 | 0.0009 | - |
0.8627 | 2200 | 0.0067 | - |
0.8824 | 2250 | 0.0008 | - |
0.9020 | 2300 | 0.0009 | - |
0.9216 | 2350 | 0.0009 | - |
0.9412 | 2400 | 0.0007 | - |
0.9608 | 2450 | 0.0006 | - |
0.9804 | 2500 | 0.0007 | - |
1.0 | 2550 | 0.0006 | - |
Framework Versions
- Python: 3.10.12
- SetFit: 1.0.3
- Sentence Transformers: 2.7.0
- Transformers: 4.40.2
- PyTorch: 2.2.1+cu121
- Datasets: 2.19.1
- 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
- 8
Inference API (serverless) has been turned off for this model.
Model tree for bhaskars113/toyota-paint-attribute-1.1
Base model
sentence-transformers/all-mpnet-base-v2