SetFit with BAAI/bge-base-en-v1.5
This is a SetFit model that can be used for Text Classification. This SetFit model uses BAAI/bge-base-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-base-en-v1.5
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 512 tokens
- Number of Classes: 10 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 |
---|---|
5 |
|
6 |
|
8 |
|
2 |
|
4 |
|
3 |
|
7 |
|
9 |
|
1 |
|
0 |
|
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/bge-base-en-v1.5_wikipedia_policy_wikipedia_policy")
# Run inference
preds = model("fails ")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 2 | 38.196 | 433 |
Label | Training Sample Count |
---|---|
0 | 23 |
1 | 17 |
2 | 21 |
3 | 17 |
4 | 39 |
5 | 671 |
6 | 60 |
7 | 36 |
8 | 100 |
9 | 16 |
Training Hyperparameters
- batch_size: (8, 2)
- num_epochs: (5, 5)
- 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.0004 | 1 | 0.2133 | - |
0.2 | 500 | 0.2428 | 0.2210 |
0.4 | 1000 | 0.1484 | 0.1927 |
0.6 | 1500 | 0.0528 | 0.1995 |
0.8 | 2000 | 0.0335 | 0.2373 |
1.0 | 2500 | 0.0346 | 0.2294 |
1.2 | 3000 | 0.0267 | 0.2447 |
1.4 | 3500 | 0.0239 | 0.2290 |
1.6 | 4000 | 0.0253 | 0.2354 |
1.8 | 4500 | 0.0219 | 0.2390 |
2.0 | 5000 | 0.02 | 0.2335 |
2.2 | 5500 | 0.019 | 0.2319 |
2.4 | 6000 | 0.0168 | 0.2281 |
2.6 | 6500 | 0.0154 | 0.2499 |
2.8 | 7000 | 0.013 | 0.2537 |
3.0 | 7500 | 0.015 | 0.2408 |
3.2 | 8000 | 0.0121 | 0.2423 |
3.4 | 8500 | 0.015 | 0.2391 |
3.6 | 9000 | 0.0131 | 0.2452 |
3.8 | 9500 | 0.0106 | 0.2438 |
4.0 | 10000 | 0.0135 | 0.2330 |
4.2 | 10500 | 0.0114 | 0.2396 |
4.4 | 11000 | 0.0115 | 0.2413 |
4.6 | 11500 | 0.0112 | 0.2348 |
4.8 | 12000 | 0.0111 | 0.2378 |
5.0 | 12500 | 0.013 | 0.2387 |
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
- 10
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
Model tree for research-dump/bge-base-en-v1.5_wikipedia_policy_wikipedia_policy
Base model
BAAI/bge-base-en-v1.5