SetFit with BAAI/bge-small-en-v1.5
This is a SetFit model that can be used for Text Classification. This SetFit model uses BAAI/bge-small-en-v1.5 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: BAAI/bge-small-en-v1.5
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 512 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 |
---|---|
H |
|
L |
|
0 |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.8229 |
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("Zlovoblachko/dim3_BAAI_setfit_model")
# Run inference
preds = model("('that some people watching TV', 'acl') [SEP] Argument [SEP] ('only to relax after work', 'advcl') [SEP] Argument3")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 9 | 19.0967 | 35 |
Label | Training Sample Count |
---|---|
L | 105 |
H | 94 |
0 | 101 |
Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- body_learning_rate: (2e-05, 1e-05)
- head_learning_rate: 0.01
- 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.0003 | 1 | 0.1536 | - |
0.0133 | 50 | 0.277 | - |
0.0267 | 100 | 0.2479 | - |
0.0400 | 150 | 0.2212 | - |
0.0534 | 200 | 0.1652 | - |
0.0667 | 250 | 0.1512 | - |
0.0801 | 300 | 0.1451 | - |
0.0934 | 350 | 0.1342 | - |
0.1068 | 400 | 0.1129 | - |
0.1201 | 450 | 0.1067 | - |
0.1334 | 500 | 0.0813 | - |
0.1468 | 550 | 0.0474 | - |
0.1601 | 600 | 0.0291 | - |
0.1735 | 650 | 0.0145 | - |
0.1868 | 700 | 0.0103 | - |
0.2002 | 750 | 0.0083 | - |
0.2135 | 800 | 0.006 | - |
0.2268 | 850 | 0.0049 | - |
0.2402 | 900 | 0.0021 | - |
0.2535 | 950 | 0.0037 | - |
0.2669 | 1000 | 0.0019 | - |
0.2802 | 1050 | 0.0015 | - |
0.2936 | 1100 | 0.0029 | - |
0.3069 | 1150 | 0.0013 | - |
0.3203 | 1200 | 0.0013 | - |
0.3336 | 1250 | 0.0011 | - |
0.3469 | 1300 | 0.0011 | - |
0.3603 | 1350 | 0.001 | - |
0.3736 | 1400 | 0.0017 | - |
0.3870 | 1450 | 0.0013 | - |
0.4003 | 1500 | 0.0023 | - |
0.4137 | 1550 | 0.0009 | - |
0.4270 | 1600 | 0.0009 | - |
0.4404 | 1650 | 0.0008 | - |
0.4537 | 1700 | 0.0008 | - |
0.4670 | 1750 | 0.0008 | - |
0.4804 | 1800 | 0.0007 | - |
0.4937 | 1850 | 0.0007 | - |
0.5071 | 1900 | 0.0007 | - |
0.5204 | 1950 | 0.0007 | - |
0.5338 | 2000 | 0.0007 | - |
0.5471 | 2050 | 0.0007 | - |
0.5604 | 2100 | 0.0007 | - |
0.5738 | 2150 | 0.0007 | - |
0.5871 | 2200 | 0.0007 | - |
0.6005 | 2250 | 0.0006 | - |
0.6138 | 2300 | 0.0007 | - |
0.6272 | 2350 | 0.0007 | - |
0.6405 | 2400 | 0.0006 | - |
0.6539 | 2450 | 0.0006 | - |
0.6672 | 2500 | 0.0013 | - |
0.6805 | 2550 | 0.0006 | - |
0.6939 | 2600 | 0.0006 | - |
0.7072 | 2650 | 0.0006 | - |
0.7206 | 2700 | 0.0006 | - |
0.7339 | 2750 | 0.0006 | - |
0.7473 | 2800 | 0.0006 | - |
0.7606 | 2850 | 0.0006 | - |
0.7740 | 2900 | 0.0005 | - |
0.7873 | 2950 | 0.0006 | - |
0.8006 | 3000 | 0.0005 | - |
0.8140 | 3050 | 0.0005 | - |
0.8273 | 3100 | 0.0005 | - |
0.8407 | 3150 | 0.0005 | - |
0.8540 | 3200 | 0.0005 | - |
0.8674 | 3250 | 0.0005 | - |
0.8807 | 3300 | 0.0005 | - |
0.8940 | 3350 | 0.0005 | - |
0.9074 | 3400 | 0.0005 | - |
0.9207 | 3450 | 0.0005 | - |
0.9341 | 3500 | 0.0005 | - |
0.9474 | 3550 | 0.0005 | - |
0.9608 | 3600 | 0.0005 | - |
0.9741 | 3650 | 0.0006 | - |
0.9875 | 3700 | 0.0005 | - |
Framework Versions
- Python: 3.11.13
- SetFit: 1.1.3
- Sentence Transformers: 5.1.0
- Transformers: 4.55.1
- PyTorch: 2.6.0+cu124
- Datasets: 4.0.0
- Tokenizers: 0.21.4
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
Model tree for Zlovoblachko/dim3_BAAI_setfit_model
Base model
BAAI/bge-small-en-v1.5