metadata
base_model: klue/roberta-base
library_name: setfit
metrics:
- metric
pipeline_tag: text-classification
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: 닥터 브로너스 그린티 퓨어 캐스틸 바솝 140g 3개 옵션없음 (주)엠아이인터내셔널
- text: 에치앤지 코스노리 아이래쉬 틴팅 세럼 9g 옵션없음 탑서비스
- text: '[VT] 피디알엔 리들샷 옵션없음 (주)지에스리테일 홈쇼핑'
- text: 1950년대 영국체어 옵션없음 4Umall (포유몰)
- text: Tip Top 팁탑 포마드 오리지널 120g [한정수량할인] 바르노 포마드_01 바르노 오리지널(수성) 주식회사 설빈
inference: true
model-index:
- name: SetFit with klue/roberta-base
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: Unknown
type: unknown
split: test
metrics:
- type: metric
value: 0.8909090909090909
name: Metric
SetFit with klue/roberta-base
This is a SetFit model that can be used for Text Classification. This SetFit model uses klue/roberta-base 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: klue/roberta-base
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 512 tokens
- Number of Classes: 13 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 |
---|---|
1 |
|
6 |
|
8 |
|
2 |
|
7 |
|
5 |
|
3 |
|
0 |
|
4 |
|
9 |
|
11 |
|
12 |
|
10 |
|
Evaluation
Metrics
Label | Metric |
---|---|
all | 0.8909 |
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("setfit_model_id")
# Run inference
preds = model("1950년대 영국체어 옵션없음 4Umall (포유몰)")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 3 | 9.8008 | 33 |
Label | Training Sample Count |
---|---|
0 | 1281 |
1 | 582 |
2 | 681 |
3 | 1592 |
4 | 587 |
5 | 706 |
6 | 1206 |
7 | 587 |
8 | 1081 |
9 | 1077 |
10 | 224 |
11 | 567 |
12 | 699 |
Training Hyperparameters
- batch_size: (512, 512)
- num_epochs: (10, 10)
- 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.0012 | 1 | 0.4342 | - |
0.0588 | 50 | 0.3693 | - |
0.1176 | 100 | 0.3229 | - |
0.1765 | 150 | 0.2888 | - |
0.2353 | 200 | 0.2413 | - |
0.2941 | 250 | 0.2136 | - |
0.3529 | 300 | 0.1925 | - |
0.4118 | 350 | 0.1672 | - |
0.4706 | 400 | 0.1529 | - |
0.5294 | 450 | 0.13 | - |
0.5882 | 500 | 0.1112 | - |
0.6471 | 550 | 0.0979 | - |
0.7059 | 600 | 0.0873 | - |
0.7647 | 650 | 0.0575 | - |
0.8235 | 700 | 0.0482 | - |
0.8824 | 750 | 0.0729 | - |
0.9412 | 800 | 0.0411 | - |
1.0 | 850 | 0.0542 | - |
1.0588 | 900 | 0.0626 | - |
1.1176 | 950 | 0.0385 | - |
1.1765 | 1000 | 0.0373 | - |
1.2353 | 1050 | 0.0276 | - |
1.2941 | 1100 | 0.0205 | - |
1.3529 | 1150 | 0.0275 | - |
1.4118 | 1200 | 0.0226 | - |
1.4706 | 1250 | 0.0231 | - |
1.5294 | 1300 | 0.0273 | - |
1.5882 | 1350 | 0.0183 | - |
1.6471 | 1400 | 0.0158 | - |
1.7059 | 1450 | 0.0112 | - |
1.7647 | 1500 | 0.0068 | - |
1.8235 | 1550 | 0.0098 | - |
1.8824 | 1600 | 0.0047 | - |
1.9412 | 1650 | 0.0053 | - |
2.0 | 1700 | 0.0027 | - |
2.0588 | 1750 | 0.0007 | - |
2.1176 | 1800 | 0.0015 | - |
2.1765 | 1850 | 0.0042 | - |
2.2353 | 1900 | 0.002 | - |
2.2941 | 1950 | 0.0018 | - |
2.3529 | 2000 | 0.0023 | - |
2.4118 | 2050 | 0.0025 | - |
2.4706 | 2100 | 0.0014 | - |
2.5294 | 2150 | 0.0007 | - |
2.5882 | 2200 | 0.0005 | - |
2.6471 | 2250 | 0.0042 | - |
2.7059 | 2300 | 0.0022 | - |
2.7647 | 2350 | 0.0028 | - |
2.8235 | 2400 | 0.0004 | - |
2.8824 | 2450 | 0.0003 | - |
2.9412 | 2500 | 0.0009 | - |
3.0 | 2550 | 0.0002 | - |
3.0588 | 2600 | 0.0011 | - |
3.1176 | 2650 | 0.001 | - |
3.1765 | 2700 | 0.0003 | - |
3.2353 | 2750 | 0.0006 | - |
3.2941 | 2800 | 0.0034 | - |
3.3529 | 2850 | 0.0002 | - |
3.4118 | 2900 | 0.0012 | - |
3.4706 | 2950 | 0.0004 | - |
3.5294 | 3000 | 0.0004 | - |
3.5882 | 3050 | 0.0002 | - |
3.6471 | 3100 | 0.0002 | - |
3.7059 | 3150 | 0.0002 | - |
3.7647 | 3200 | 0.0001 | - |
3.8235 | 3250 | 0.002 | - |
3.8824 | 3300 | 0.0026 | - |
3.9412 | 3350 | 0.0001 | - |
4.0 | 3400 | 0.0001 | - |
4.0588 | 3450 | 0.0001 | - |
4.1176 | 3500 | 0.0003 | - |
4.1765 | 3550 | 0.0001 | - |
4.2353 | 3600 | 0.0005 | - |
4.2941 | 3650 | 0.0002 | - |
4.3529 | 3700 | 0.0003 | - |
4.4118 | 3750 | 0.0001 | - |
4.4706 | 3800 | 0.0025 | - |
4.5294 | 3850 | 0.0003 | - |
4.5882 | 3900 | 0.0003 | - |
4.6471 | 3950 | 0.0002 | - |
4.7059 | 4000 | 0.0005 | - |
4.7647 | 4050 | 0.0002 | - |
4.8235 | 4100 | 0.0022 | - |
4.8824 | 4150 | 0.0001 | - |
4.9412 | 4200 | 0.0001 | - |
5.0 | 4250 | 0.0009 | - |
5.0588 | 4300 | 0.0001 | - |
5.1176 | 4350 | 0.0001 | - |
5.1765 | 4400 | 0.0002 | - |
5.2353 | 4450 | 0.0002 | - |
5.2941 | 4500 | 0.0013 | - |
5.3529 | 4550 | 0.0005 | - |
5.4118 | 4600 | 0.0003 | - |
5.4706 | 4650 | 0.0001 | - |
5.5294 | 4700 | 0.0001 | - |
5.5882 | 4750 | 0.0003 | - |
5.6471 | 4800 | 0.0002 | - |
5.7059 | 4850 | 0.0002 | - |
5.7647 | 4900 | 0.0001 | - |
5.8235 | 4950 | 0.0001 | - |
5.8824 | 5000 | 0.0001 | - |
5.9412 | 5050 | 0.0001 | - |
6.0 | 5100 | 0.0001 | - |
6.0588 | 5150 | 0.0001 | - |
6.1176 | 5200 | 0.0009 | - |
6.1765 | 5250 | 0.0017 | - |
6.2353 | 5300 | 0.0 | - |
6.2941 | 5350 | 0.0016 | - |
6.3529 | 5400 | 0.0001 | - |
6.4118 | 5450 | 0.0004 | - |
6.4706 | 5500 | 0.0001 | - |
6.5294 | 5550 | 0.0011 | - |
6.5882 | 5600 | 0.0001 | - |
6.6471 | 5650 | 0.0016 | - |
6.7059 | 5700 | 0.0008 | - |
6.7647 | 5750 | 0.0001 | - |
6.8235 | 5800 | 0.0 | - |
6.8824 | 5850 | 0.0 | - |
6.9412 | 5900 | 0.0001 | - |
7.0 | 5950 | 0.0001 | - |
7.0588 | 6000 | 0.0001 | - |
7.1176 | 6050 | 0.0001 | - |
7.1765 | 6100 | 0.0001 | - |
7.2353 | 6150 | 0.0 | - |
7.2941 | 6200 | 0.0001 | - |
7.3529 | 6250 | 0.0 | - |
7.4118 | 6300 | 0.0008 | - |
7.4706 | 6350 | 0.0 | - |
7.5294 | 6400 | 0.0 | - |
7.5882 | 6450 | 0.0 | - |
7.6471 | 6500 | 0.0 | - |
7.7059 | 6550 | 0.0004 | - |
7.7647 | 6600 | 0.0 | - |
7.8235 | 6650 | 0.0 | - |
7.8824 | 6700 | 0.0 | - |
7.9412 | 6750 | 0.0001 | - |
8.0 | 6800 | 0.0 | - |
8.0588 | 6850 | 0.0 | - |
8.1176 | 6900 | 0.0 | - |
8.1765 | 6950 | 0.0 | - |
8.2353 | 7000 | 0.0 | - |
8.2941 | 7050 | 0.0001 | - |
8.3529 | 7100 | 0.0001 | - |
8.4118 | 7150 | 0.0 | - |
8.4706 | 7200 | 0.0 | - |
8.5294 | 7250 | 0.0 | - |
8.5882 | 7300 | 0.0 | - |
8.6471 | 7350 | 0.0 | - |
8.7059 | 7400 | 0.0 | - |
8.7647 | 7450 | 0.0 | - |
8.8235 | 7500 | 0.0 | - |
8.8824 | 7550 | 0.0 | - |
8.9412 | 7600 | 0.0 | - |
9.0 | 7650 | 0.0 | - |
9.0588 | 7700 | 0.0 | - |
9.1176 | 7750 | 0.0 | - |
9.1765 | 7800 | 0.0 | - |
9.2353 | 7850 | 0.0 | - |
9.2941 | 7900 | 0.0002 | - |
9.3529 | 7950 | 0.0 | - |
9.4118 | 8000 | 0.0 | - |
9.4706 | 8050 | 0.0 | - |
9.5294 | 8100 | 0.0 | - |
9.5882 | 8150 | 0.0 | - |
9.6471 | 8200 | 0.0 | - |
9.7059 | 8250 | 0.0 | - |
9.7647 | 8300 | 0.0 | - |
9.8235 | 8350 | 0.0001 | - |
9.8824 | 8400 | 0.0 | - |
9.9412 | 8450 | 0.0 | - |
10.0 | 8500 | 0.0 | - |
Framework Versions
- Python: 3.10.12
- SetFit: 1.1.0.dev0
- Sentence Transformers: 3.1.1
- Transformers: 4.45.1
- PyTorch: 2.4.0+cu121
- Datasets: 2.20.0
- Tokenizers: 0.20.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}
}