SetFit
This is a SetFit model that can be used for Text Classification. 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
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 512 tokens
- Number of Classes: 2 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 |
---|---|
Non-recurring |
|
Recurring |
|
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("Kurrant/RevenueStreamJP")
# Run inference
preds = model("次世代を担う子どもたちへプログラミングの面白さを伝えるキッズプログラミングスクール「ツクル」を運営するスタートアップ。")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 1 | 2.0785 | 65 |
Label | Training Sample Count |
---|---|
Non-recurring | 929 |
Recurring | 1467 |
Training Hyperparameters
- batch_size: (8, 8)
- num_epochs: (2, 2)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 3
- 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.0006 | 1 | 0.3 | - |
0.0278 | 50 | 0.2769 | - |
0.0556 | 100 | 0.2192 | - |
0.0835 | 150 | 0.323 | - |
0.1113 | 200 | 0.2692 | - |
0.1391 | 250 | 0.1603 | - |
0.1669 | 300 | 0.3578 | - |
0.1948 | 350 | 0.197 | - |
0.2226 | 400 | 0.3582 | - |
0.2504 | 450 | 0.2184 | - |
0.2782 | 500 | 0.182 | - |
0.3061 | 550 | 0.2353 | - |
0.3339 | 600 | 0.2287 | - |
0.3617 | 650 | 0.1228 | - |
0.3895 | 700 | 0.2276 | - |
0.4174 | 750 | 0.2181 | - |
0.4452 | 800 | 0.2857 | - |
0.4730 | 850 | 0.2361 | - |
0.5008 | 900 | 0.2545 | - |
0.5287 | 950 | 0.1986 | - |
0.5565 | 1000 | 0.3308 | - |
0.5843 | 1050 | 0.2126 | - |
0.6121 | 1100 | 0.18 | - |
0.6400 | 1150 | 0.1206 | - |
0.6678 | 1200 | 0.1441 | - |
0.6956 | 1250 | 0.1999 | - |
0.7234 | 1300 | 0.1518 | - |
0.7513 | 1350 | 0.1713 | - |
0.7791 | 1400 | 0.033 | - |
0.8069 | 1450 | 0.1999 | - |
0.8347 | 1500 | 0.0766 | - |
0.8625 | 1550 | 0.1551 | - |
0.8904 | 1600 | 0.363 | - |
0.9182 | 1650 | 0.0398 | - |
0.9460 | 1700 | 0.1047 | - |
0.9738 | 1750 | 0.0475 | - |
1.0017 | 1800 | 0.0331 | - |
1.0295 | 1850 | 0.0113 | - |
1.0573 | 1900 | 0.0099 | - |
1.0851 | 1950 | 0.2228 | - |
1.1130 | 2000 | 0.1168 | - |
1.1408 | 2050 | 0.0687 | - |
1.1686 | 2100 | 0.0018 | - |
1.1964 | 2150 | 0.0043 | - |
1.2243 | 2200 | 0.0016 | - |
1.2521 | 2250 | 0.0488 | - |
1.2799 | 2300 | 0.0029 | - |
1.3077 | 2350 | 0.0053 | - |
1.3356 | 2400 | 0.0659 | - |
1.3634 | 2450 | 0.0662 | - |
1.3912 | 2500 | 0.0013 | - |
1.4190 | 2550 | 0.1195 | - |
1.4469 | 2600 | 0.0004 | - |
1.4747 | 2650 | 0.0028 | - |
1.5025 | 2700 | 0.0002 | - |
1.5303 | 2750 | 0.2196 | - |
1.5582 | 2800 | 0.0011 | - |
1.5860 | 2850 | 0.0086 | - |
1.6138 | 2900 | 0.0017 | - |
1.6416 | 2950 | 0.0048 | - |
1.6694 | 3000 | 0.0003 | - |
1.6973 | 3050 | 0.0003 | - |
1.7251 | 3100 | 0.0002 | - |
1.7529 | 3150 | 0.0002 | - |
1.7807 | 3200 | 0.0003 | - |
1.8086 | 3250 | 0.0001 | - |
1.8364 | 3300 | 0.0002 | - |
1.8642 | 3350 | 0.0133 | - |
1.8920 | 3400 | 0.0003 | - |
1.9199 | 3450 | 0.0003 | - |
1.9477 | 3500 | 0.0007 | - |
1.9755 | 3550 | 0.0005 | - |
Framework Versions
- Python: 3.10.12
- SetFit: 1.0.2
- 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}
}
- Downloads last month
- 5
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.