nlbse26_python / README.md
mmock's picture
Upload folder using huggingface_hub
9f145d8 verified
|
raw
history blame
22.7 kB
metadata
tags:
  - setfit
  - sentence-transformers
  - text-classification
  - generated_from_setfit_trainer
widget:
  - text: dataright np^sin 2 np^pi 224 t | Audio
  - text: >-
      robust way to ask the database for its current transaction state. |
      AtomicTests
  - text: the string marking the beginning of a print statement. | Environment
  - text: handled otherwise by a particular method. | StringMethods
  - text: table. | PlotAccessor
metrics:
  - accuracy
pipeline_tag: text-classification
library_name: setfit
inference: false

SetFit

This is a SetFit model that can be used for Text Classification. A MultiOutputClassifier instance is used for classification.

The model has been trained using an efficient few-shot learning technique that involves:

  1. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

  • Model Type: SetFit
  • Classification head: a MultiOutputClassifier instance
  • Maximum Sequence Length: 128 tokens

Model Sources

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("table. | PlotAccessor")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 3 8.9868 28

Training Hyperparameters

  • batch_size: (32, 32)
  • num_epochs: (10, 10)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 20
  • 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.0006 1 0.2743 -
0.0292 50 0.3546 -
0.0585 100 0.3106 -
0.0877 150 0.2652 -
0.1170 200 0.2543 -
0.1462 250 0.2544 -
0.1754 300 0.2521 -
0.2047 350 0.2508 -
0.2339 400 0.2485 -
0.2632 450 0.2499 -
0.2924 500 0.2453 -
0.3216 550 0.2414 -
0.3509 600 0.2379 -
0.3801 650 0.2426 -
0.4094 700 0.2383 -
0.4386 750 0.2385 -
0.4678 800 0.2402 -
0.4971 850 0.2329 -
0.5263 900 0.2328 -
0.5556 950 0.2309 -
0.5848 1000 0.228 -
0.6140 1050 0.2149 -
0.6433 1100 0.2053 -
0.6725 1150 0.1997 -
0.7018 1200 0.1978 -
0.7310 1250 0.1896 -
0.7602 1300 0.1775 -
0.7895 1350 0.1629 -
0.8187 1400 0.1571 -
0.8480 1450 0.1493 -
0.8772 1500 0.1445 -
0.9064 1550 0.1345 -
0.9357 1600 0.1306 -
0.9649 1650 0.1276 -
0.9942 1700 0.1181 -
1.0234 1750 0.1081 -
1.0526 1800 0.1081 -
1.0819 1850 0.1006 -
1.1111 1900 0.0892 -
1.1404 1950 0.0996 -
1.1696 2000 0.0912 -
1.1988 2050 0.0868 -
1.2281 2100 0.089 -
1.2573 2150 0.078 -
1.2865 2200 0.0864 -
1.3158 2250 0.0719 -
1.3450 2300 0.0675 -
1.3743 2350 0.0669 -
1.4035 2400 0.0666 -
1.4327 2450 0.074 -
1.4620 2500 0.0671 -
1.4912 2550 0.0663 -
1.5205 2600 0.0599 -
1.5497 2650 0.0612 -
1.5789 2700 0.056 -
1.6082 2750 0.0575 -
1.6374 2800 0.0553 -
1.6667 2850 0.0611 -
1.6959 2900 0.0535 -
1.7251 2950 0.0558 -
1.7544 3000 0.054 -
1.7836 3050 0.0552 -
1.8129 3100 0.0494 -
1.8421 3150 0.0489 -
1.8713 3200 0.0494 -
1.9006 3250 0.0468 -
1.9298 3300 0.0527 -
1.9591 3350 0.0496 -
1.9883 3400 0.0492 -
2.0175 3450 0.0415 -
2.0468 3500 0.0434 -
2.0760 3550 0.0456 -
2.1053 3600 0.0394 -
2.1345 3650 0.0387 -
2.1637 3700 0.0381 -
2.1930 3750 0.0378 -
2.2222 3800 0.0387 -
2.2515 3850 0.035 -
2.2807 3900 0.0384 -
2.3099 3950 0.0386 -
2.3392 4000 0.0379 -
2.3684 4050 0.0315 -
2.3977 4100 0.0372 -
2.4269 4150 0.0324 -
2.4561 4200 0.0319 -
2.4854 4250 0.0306 -
2.5146 4300 0.0309 -
2.5439 4350 0.0382 -
2.5731 4400 0.0314 -
2.6023 4450 0.0314 -
2.6316 4500 0.0254 -
2.6608 4550 0.0257 -
2.6901 4600 0.0325 -
2.7193 4650 0.0249 -
2.7485 4700 0.026 -
2.7778 4750 0.0298 -
2.8070 4800 0.0253 -
2.8363 4850 0.0306 -
2.8655 4900 0.0285 -
2.8947 4950 0.0273 -
2.9240 5000 0.029 -
2.9532 5050 0.0238 -
2.9825 5100 0.0287 -
3.0117 5150 0.0267 -
3.0409 5200 0.0259 -
3.0702 5250 0.0232 -
3.0994 5300 0.0269 -
3.1287 5350 0.0239 -
3.1579 5400 0.0268 -
3.1871 5450 0.0242 -
3.2164 5500 0.0264 -
3.2456 5550 0.0217 -
3.2749 5600 0.026 -
3.3041 5650 0.0248 -
3.3333 5700 0.0242 -
3.3626 5750 0.0239 -
3.3918 5800 0.0229 -
3.4211 5850 0.0205 -
3.4503 5900 0.0252 -
3.4795 5950 0.0208 -
3.5088 6000 0.024 -
3.5380 6050 0.025 -
3.5673 6100 0.0235 -
3.5965 6150 0.0228 -
3.6257 6200 0.0213 -
3.6550 6250 0.024 -
3.6842 6300 0.021 -
3.7135 6350 0.0236 -
3.7427 6400 0.0213 -
3.7719 6450 0.0188 -
3.8012 6500 0.0239 -
3.8304 6550 0.0244 -
3.8596 6600 0.0228 -
3.8889 6650 0.0219 -
3.9181 6700 0.0251 -
3.9474 6750 0.02 -
3.9766 6800 0.0209 -
4.0058 6850 0.0204 -
4.0351 6900 0.022 -
4.0643 6950 0.0197 -
4.0936 7000 0.019 -
4.1228 7050 0.0212 -
4.1520 7100 0.0201 -
4.1813 7150 0.021 -
4.2105 7200 0.0219 -
4.2398 7250 0.0223 -
4.2690 7300 0.0236 -
4.2982 7350 0.0206 -
4.3275 7400 0.02 -
4.3567 7450 0.0223 -
4.3860 7500 0.0212 -
4.4152 7550 0.0205 -
4.4444 7600 0.0212 -
4.4737 7650 0.0189 -
4.5029 7700 0.0213 -
4.5322 7750 0.021 -
4.5614 7800 0.0212 -
4.5906 7850 0.0196 -
4.6199 7900 0.0187 -
4.6491 7950 0.0185 -
4.6784 8000 0.017 -
4.7076 8050 0.0211 -
4.7368 8100 0.0177 -
4.7661 8150 0.0208 -
4.7953 8200 0.0235 -
4.8246 8250 0.0196 -
4.8538 8300 0.0193 -
4.8830 8350 0.0185 -
4.9123 8400 0.022 -
4.9415 8450 0.0196 -
4.9708 8500 0.0196 -
5.0 8550 0.0227 -
5.0292 8600 0.0188 -
5.0585 8650 0.0183 -
5.0877 8700 0.0192 -
5.1170 8750 0.0219 -
5.1462 8800 0.0181 -
5.1754 8850 0.0173 -
5.2047 8900 0.0178 -
5.2339 8950 0.0183 -
5.2632 9000 0.0199 -
5.2924 9050 0.0194 -
5.3216 9100 0.0219 -
5.3509 9150 0.0218 -
5.3801 9200 0.0186 -
5.4094 9250 0.0202 -
5.4386 9300 0.0195 -
5.4678 9350 0.0181 -
5.4971 9400 0.0197 -
5.5263 9450 0.0176 -
5.5556 9500 0.0181 -
5.5848 9550 0.0193 -
5.6140 9600 0.0183 -
5.6433 9650 0.0206 -
5.6725 9700 0.0191 -
5.7018 9750 0.0179 -
5.7310 9800 0.0192 -
5.7602 9850 0.0184 -
5.7895 9900 0.0194 -
5.8187 9950 0.0186 -
5.8480 10000 0.0193 -
5.8772 10050 0.0176 -
5.9064 10100 0.0187 -
5.9357 10150 0.0193 -
5.9649 10200 0.0199 -
5.9942 10250 0.0169 -
6.0234 10300 0.017 -
6.0526 10350 0.0207 -
6.0819 10400 0.0188 -
6.1111 10450 0.018 -
6.1404 10500 0.0184 -
6.1696 10550 0.0153 -
6.1988 10600 0.0173 -
6.2281 10650 0.0172 -
6.2573 10700 0.0188 -
6.2865 10750 0.02 -
6.3158 10800 0.0193 -
6.3450 10850 0.0188 -
6.3743 10900 0.0183 -
6.4035 10950 0.0185 -
6.4327 11000 0.0203 -
6.4620 11050 0.018 -
6.4912 11100 0.0184 -
6.5205 11150 0.0182 -
6.5497 11200 0.0173 -
6.5789 11250 0.0173 -
6.6082 11300 0.0189 -
6.6374 11350 0.0167 -
6.6667 11400 0.0169 -
6.6959 11450 0.0171 -
6.7251 11500 0.0174 -
6.7544 11550 0.0169 -
6.7836 11600 0.0193 -
6.8129 11650 0.0184 -
6.8421 11700 0.0175 -
6.8713 11750 0.0173 -
6.9006 11800 0.0146 -
6.9298 11850 0.0163 -
6.9591 11900 0.0173 -
6.9883 11950 0.0196 -
7.0175 12000 0.0188 -
7.0468 12050 0.0182 -
7.0760 12100 0.0168 -
7.1053 12150 0.0169 -
7.1345 12200 0.0164 -
7.1637 12250 0.0159 -
7.1930 12300 0.0187 -
7.2222 12350 0.0197 -
7.2515 12400 0.0186 -
7.2807 12450 0.0163 -
7.3099 12500 0.0178 -
7.3392 12550 0.0184 -
7.3684 12600 0.0184 -
7.3977 12650 0.0177 -
7.4269 12700 0.0157 -
7.4561 12750 0.0184 -
7.4854 12800 0.0184 -
7.5146 12850 0.0182 -
7.5439 12900 0.0182 -
7.5731 12950 0.0169 -
7.6023 13000 0.0182 -
7.6316 13050 0.0156 -
7.6608 13100 0.0173 -
7.6901 13150 0.0159 -
7.7193 13200 0.0167 -
7.7485 13250 0.0175 -
7.7778 13300 0.016 -
7.8070 13350 0.0175 -
7.8363 13400 0.0169 -
7.8655 13450 0.0167 -
7.8947 13500 0.0159 -
7.9240 13550 0.0168 -
7.9532 13600 0.0183 -
7.9825 13650 0.0162 -
8.0117 13700 0.0162 -
8.0409 13750 0.017 -
8.0702 13800 0.018 -
8.0994 13850 0.0161 -
8.1287 13900 0.0159 -
8.1579 13950 0.0185 -
8.1871 14000 0.017 -
8.2164 14050 0.0167 -
8.2456 14100 0.0154 -
8.2749 14150 0.0166 -
8.3041 14200 0.0173 -
8.3333 14250 0.0156 -
8.3626 14300 0.0175 -
8.3918 14350 0.0144 -
8.4211 14400 0.0198 -
8.4503 14450 0.0184 -
8.4795 14500 0.0168 -
8.5088 14550 0.0183 -
8.5380 14600 0.0175 -
8.5673 14650 0.0155 -
8.5965 14700 0.0168 -
8.6257 14750 0.0179 -
8.6550 14800 0.0162 -
8.6842 14850 0.0181 -
8.7135 14900 0.017 -
8.7427 14950 0.0169 -
8.7719 15000 0.0177 -
8.8012 15050 0.0174 -
8.8304 15100 0.015 -
8.8596 15150 0.0159 -
8.8889 15200 0.0191 -
8.9181 15250 0.0168 -
8.9474 15300 0.0147 -
8.9766 15350 0.0166 -
9.0058 15400 0.0163 -
9.0351 15450 0.0156 -
9.0643 15500 0.0171 -
9.0936 15550 0.0168 -
9.1228 15600 0.0174 -
9.1520 15650 0.0152 -
9.1813 15700 0.017 -
9.2105 15750 0.0172 -
9.2398 15800 0.0149 -
9.2690 15850 0.0172 -
9.2982 15900 0.0161 -
9.3275 15950 0.0174 -
9.3567 16000 0.0181 -
9.3860 16050 0.0167 -
9.4152 16100 0.0159 -
9.4444 16150 0.0157 -
9.4737 16200 0.0174 -
9.5029 16250 0.0155 -
9.5322 16300 0.0158 -
9.5614 16350 0.0164 -
9.5906 16400 0.0165 -
9.6199 16450 0.0164 -
9.6491 16500 0.0155 -
9.6784 16550 0.0164 -
9.7076 16600 0.016 -
9.7368 16650 0.0154 -
9.7661 16700 0.0171 -
9.7953 16750 0.0173 -
9.8246 16800 0.0158 -
9.8538 16850 0.0169 -
9.8830 16900 0.0163 -
9.9123 16950 0.0177 -
9.9415 17000 0.0167 -
9.9708 17050 0.0172 -
10.0 17100 0.0172 -

Framework Versions

  • Python: 3.10.8
  • SetFit: 1.1.2
  • Sentence Transformers: 5.0.0
  • Transformers: 4.54.1
  • PyTorch: 2.7.1+cu126
  • Datasets: 3.6.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}
}