SetFit with sentence-transformers/all-MiniLM-L6-v2

This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/all-MiniLM-L6-v2 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:

  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 Sources

Model Labels

Label Examples
neutral
  • ' Die Aktionen von Klima-Aktivismus-Gruppen wie Fridays for Future oder die Letzte Generation polarisieren die Öffentlichkeit, während sie gleichzeitig wichtige Diskussionen über den Klimawandel anstoßen.'
  • 'Die Diskussion um ein generelles Tempolimit auf Autobahnen hat in den vergangenen Wochen an Fahrt gewonnen und sowohl Befürworter als auch Gegner haben ihre Positionen deutlich gemacht.'
  • ' "Das geplante Heizungsgesetz sieht vor, dass ab 2024 in Neubauten und bei der Sanierung von Bestandsgebäuden verstärkt auf Wärmepumpen gesetzt werden soll."'
supportive
  • 'Die Einführung eines generellen Tempolimits auf deutschen Autobahnen würde nicht nur zu einer Senkung des Kraftstoffverbrauchs und der Treibhausgasemissionen führen, sondern auch die Verkehrssicherheit erhöhen.'
  • ' "Ein nationales Tempolimit auf Autobahnen könnte laut Experten die Verkehrssicherheit erheblich verbessern und gleichzeitig den CO2-Ausstoß reduzieren."'
  • ' "Das geplante Heizungsgesetz könnte einen wichtigen Beitrag zur Reduzierung von CO2-Emissionen leisten und somit einen bedeutenden Schritt in Richtung Klimaneutralität darstellen."'
opposed
  • 'Die Freiheit der Straße, ein Stück deutscher Identität, das in Gefahr geraten könnte, wenn die politischen Tempolimit-Fanatiker ihren Willen durchsetzen.'
  • ' "Es reicht! Wann hören diese Klima-Aktivisten endlich auf, unsere Straßen zu blockieren und den Alltag der hart arbeitenden Bürger zu stören?"'
  • '„Die Blockaden von Straßen und Autobahnen durch die Letzte Generation sorgen für tägliche Nervosität bei Pendler und Anwohner, die sich fragen, wann diese ständigen Behinderungen endlich ein Ende haben werden.“'

Evaluation

Metrics

Label Accuracy
all 0.9319

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("cbpuschmann/MiniLM-klimacoder_v0.5")
# Run inference
preds = model(" Das Tempolimit auf Autobahnen würde die Freiheit der Autofahrer massiv einschränken!")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 11 25.5421 57
Label Training Sample Count
neutral 326
opposed 394
supportive 396

Training Hyperparameters

  • batch_size: (32, 32)
  • 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.0000 1 0.2393 -
0.0019 50 0.2748 -
0.0039 100 0.2607 -
0.0058 150 0.2486 -
0.0077 200 0.2465 -
0.0097 250 0.246 -
0.0116 300 0.2454 -
0.0135 350 0.2406 -
0.0155 400 0.235 -
0.0174 450 0.2269 -
0.0193 500 0.2184 -
0.0213 550 0.2095 -
0.0232 600 0.1833 -
0.0251 650 0.1777 -
0.0271 700 0.1548 -
0.0290 750 0.1464 -
0.0310 800 0.1326 -
0.0329 850 0.1304 -
0.0348 900 0.1237 -
0.0368 950 0.1163 -
0.0387 1000 0.1129 -
0.0406 1050 0.1017 -
0.0426 1100 0.0907 -
0.0445 1150 0.0857 -
0.0464 1200 0.0645 -
0.0484 1250 0.0641 -
0.0503 1300 0.0514 -
0.0522 1350 0.0442 -
0.0542 1400 0.0342 -
0.0561 1450 0.0291 -
0.0580 1500 0.0243 -
0.0600 1550 0.0185 -
0.0619 1600 0.0142 -
0.0638 1650 0.0092 -
0.0658 1700 0.0112 -
0.0677 1750 0.0076 -
0.0696 1800 0.0046 -
0.0716 1850 0.0038 -
0.0735 1900 0.0025 -
0.0754 1950 0.0028 -
0.0774 2000 0.0034 -
0.0793 2050 0.0022 -
0.0812 2100 0.0028 -
0.0832 2150 0.0025 -
0.0851 2200 0.0025 -
0.0870 2250 0.0011 -
0.0890 2300 0.0013 -
0.0909 2350 0.0019 -
0.0929 2400 0.0006 -
0.0948 2450 0.0013 -
0.0967 2500 0.0005 -
0.0987 2550 0.0006 -
0.1006 2600 0.0012 -
0.1025 2650 0.0016 -
0.1045 2700 0.0005 -
0.1064 2750 0.0004 -
0.1083 2800 0.0003 -
0.1103 2850 0.0008 -
0.1122 2900 0.001 -
0.1141 2950 0.0018 -
0.1161 3000 0.0005 -
0.1180 3050 0.0002 -
0.1199 3100 0.0005 -
0.1219 3150 0.0006 -
0.1238 3200 0.0017 -
0.1257 3250 0.0009 -
0.1277 3300 0.0026 -
0.1296 3350 0.0008 -
0.1315 3400 0.0009 -
0.1335 3450 0.0013 -
0.1354 3500 0.0009 -
0.1373 3550 0.0011 -
0.1393 3600 0.0008 -
0.1412 3650 0.0004 -
0.1431 3700 0.0009 -
0.1451 3750 0.0008 -
0.1470 3800 0.0012 -
0.1489 3850 0.001 -
0.1509 3900 0.0003 -
0.1528 3950 0.0005 -
0.1548 4000 0.0006 -
0.1567 4050 0.0007 -
0.1586 4100 0.0009 -
0.1606 4150 0.0003 -
0.1625 4200 0.0001 -
0.1644 4250 0.0011 -
0.1664 4300 0.0004 -
0.1683 4350 0.0005 -
0.1702 4400 0.001 -
0.1722 4450 0.0001 -
0.1741 4500 0.0001 -
0.1760 4550 0.0001 -
0.1780 4600 0.0007 -
0.1799 4650 0.0001 -
0.1818 4700 0.0 -
0.1838 4750 0.0 -
0.1857 4800 0.0001 -
0.1876 4850 0.0001 -
0.1896 4900 0.0 -
0.1915 4950 0.0002 -
0.1934 5000 0.0008 -
0.1954 5050 0.0006 -
0.1973 5100 0.0001 -
0.1992 5150 0.0 -
0.2012 5200 0.0 -
0.2031 5250 0.0006 -
0.2050 5300 0.0009 -
0.2070 5350 0.0001 -
0.2089 5400 0.0004 -
0.2108 5450 0.0032 -
0.2128 5500 0.0029 -
0.2147 5550 0.001 -
0.2167 5600 0.0014 -
0.2186 5650 0.0004 -
0.2205 5700 0.0034 -
0.2225 5750 0.0003 -
0.2244 5800 0.0002 -
0.2263 5850 0.0001 -
0.2283 5900 0.0 -
0.2302 5950 0.0 -
0.2321 6000 0.0 -
0.2341 6050 0.0 -
0.2360 6100 0.0 -
0.2379 6150 0.0 -
0.2399 6200 0.0 -
0.2418 6250 0.0 -
0.2437 6300 0.0001 -
0.2457 6350 0.0024 -
0.2476 6400 0.0009 -
0.2495 6450 0.0005 -
0.2515 6500 0.0016 -
0.2534 6550 0.0003 -
0.2553 6600 0.0001 -
0.2573 6650 0.0 -
0.2592 6700 0.0 -
0.2611 6750 0.0 -
0.2631 6800 0.0 -
0.2650 6850 0.0 -
0.2669 6900 0.0 -
0.2689 6950 0.0 -
0.2708 7000 0.0 -
0.2727 7050 0.0 -
0.2747 7100 0.0 -
0.2766 7150 0.0 -
0.2786 7200 0.0 -
0.2805 7250 0.0002 -
0.2824 7300 0.0006 -
0.2844 7350 0.0008 -
0.2863 7400 0.0013 -
0.2882 7450 0.0001 -
0.2902 7500 0.0005 -
0.2921 7550 0.0 -
0.2940 7600 0.0 -
0.2960 7650 0.0 -
0.2979 7700 0.0006 -
0.2998 7750 0.0 -
0.3018 7800 0.0 -
0.3037 7850 0.0 -
0.3056 7900 0.0 -
0.3076 7950 0.0 -
0.3095 8000 0.0 -
0.3114 8050 0.0 -
0.3134 8100 0.0 -
0.3153 8150 0.0 -
0.3172 8200 0.0 -
0.3192 8250 0.0 -
0.3211 8300 0.0 -
0.3230 8350 0.0 -
0.3250 8400 0.0 -
0.3269 8450 0.0 -
0.3288 8500 0.0 -
0.3308 8550 0.0 -
0.3327 8600 0.0 -
0.3346 8650 0.0004 -
0.3366 8700 0.0 -
0.3385 8750 0.0 -
0.3405 8800 0.0 -
0.3424 8850 0.0 -
0.3443 8900 0.0 -
0.3463 8950 0.0 -
0.3482 9000 0.0 -
0.3501 9050 0.0 -
0.3521 9100 0.0001 -
0.3540 9150 0.0037 -
0.3559 9200 0.0013 -
0.3579 9250 0.0007 -
0.3598 9300 0.0032 -
0.3617 9350 0.0006 -
0.3637 9400 0.0007 -
0.3656 9450 0.0 -
0.3675 9500 0.0006 -
0.3695 9550 0.0001 -
0.3714 9600 0.0004 -
0.3733 9650 0.0001 -
0.3753 9700 0.0001 -
0.3772 9750 0.0 -
0.3791 9800 0.0 -
0.3811 9850 0.0 -
0.3830 9900 0.0 -
0.3849 9950 0.0 -
0.3869 10000 0.0 -
0.3888 10050 0.0 -
0.3907 10100 0.0 -
0.3927 10150 0.0 -
0.3946 10200 0.0 -
0.3965 10250 0.0 -
0.3985 10300 0.0 -
0.4004 10350 0.0 -
0.4024 10400 0.0 -
0.4043 10450 0.0 -
0.4062 10500 0.0 -
0.4082 10550 0.0 -
0.4101 10600 0.0 -
0.4120 10650 0.0 -
0.4140 10700 0.0 -
0.4159 10750 0.0 -
0.4178 10800 0.0 -
0.4198 10850 0.0 -
0.4217 10900 0.0001 -
0.4236 10950 0.0 -
0.4256 11000 0.0 -
0.4275 11050 0.0007 -
0.4294 11100 0.0043 -
0.4314 11150 0.0011 -
0.4333 11200 0.0013 -
0.4352 11250 0.0005 -
0.4372 11300 0.0004 -
0.4391 11350 0.0001 -
0.4410 11400 0.0001 -
0.4430 11450 0.0 -
0.4449 11500 0.0001 -
0.4468 11550 0.0 -
0.4488 11600 0.0001 -
0.4507 11650 0.0004 -
0.4526 11700 0.0001 -
0.4546 11750 0.0 -
0.4565 11800 0.0013 -
0.4584 11850 0.0006 -
0.4604 11900 0.0001 -
0.4623 11950 0.0 -
0.4643 12000 0.0 -
0.4662 12050 0.0 -
0.4681 12100 0.0 -
0.4701 12150 0.0 -
0.4720 12200 0.0002 -
0.4739 12250 0.0 -
0.4759 12300 0.0 -
0.4778 12350 0.0 -
0.4797 12400 0.0 -
0.4817 12450 0.0 -
0.4836 12500 0.0 -
0.4855 12550 0.0 -
0.4875 12600 0.0 -
0.4894 12650 0.0 -
0.4913 12700 0.0 -
0.4933 12750 0.0 -
0.4952 12800 0.0 -
0.4971 12850 0.0 -
0.4991 12900 0.0 -
0.5010 12950 0.0 -
0.5029 13000 0.0 -
0.5049 13050 0.0 -
0.5068 13100 0.0 -
0.5087 13150 0.0 -
0.5107 13200 0.0 -
0.5126 13250 0.0 -
0.5145 13300 0.0 -
0.5165 13350 0.0 -
0.5184 13400 0.0 -
0.5203 13450 0.0 -
0.5223 13500 0.0 -
0.5242 13550 0.0 -
0.5262 13600 0.0 -
0.5281 13650 0.0 -
0.5300 13700 0.0 -
0.5320 13750 0.0 -
0.5339 13800 0.0 -
0.5358 13850 0.0 -
0.5378 13900 0.0 -
0.5397 13950 0.0 -
0.5416 14000 0.0 -
0.5436 14050 0.0 -
0.5455 14100 0.0 -
0.5474 14150 0.0 -
0.5494 14200 0.0 -
0.5513 14250 0.0 -
0.5532 14300 0.0 -
0.5552 14350 0.0 -
0.5571 14400 0.0 -
0.5590 14450 0.0 -
0.5610 14500 0.0 -
0.5629 14550 0.0 -
0.5648 14600 0.0 -
0.5668 14650 0.0 -
0.5687 14700 0.0 -
0.5706 14750 0.0 -
0.5726 14800 0.0 -
0.5745 14850 0.0 -
0.5764 14900 0.0 -
0.5784 14950 0.0 -
0.5803 15000 0.0 -
0.5823 15050 0.0 -
0.5842 15100 0.0 -
0.5861 15150 0.0009 -
0.5881 15200 0.0006 -
0.5900 15250 0.0 -
0.5919 15300 0.0 -
0.5939 15350 0.0 -
0.5958 15400 0.0 -
0.5977 15450 0.0 -
0.5997 15500 0.0 -
0.6016 15550 0.0 -
0.6035 15600 0.0 -
0.6055 15650 0.0 -
0.6074 15700 0.0 -
0.6093 15750 0.0006 -
0.6113 15800 0.0007 -
0.6132 15850 0.0 -
0.6151 15900 0.0 -
0.6171 15950 0.0 -
0.6190 16000 0.0 -
0.6209 16050 0.0 -
0.6229 16100 0.0 -
0.6248 16150 0.0 -
0.6267 16200 0.0 -
0.6287 16250 0.0 -
0.6306 16300 0.0 -
0.6325 16350 0.0 -
0.6345 16400 0.0 -
0.6364 16450 0.0 -
0.6383 16500 0.0 -
0.6403 16550 0.0 -
0.6422 16600 0.0 -
0.6442 16650 0.0 -
0.6461 16700 0.0 -
0.6480 16750 0.0 -
0.6500 16800 0.0 -
0.6519 16850 0.0 -
0.6538 16900 0.0 -
0.6558 16950 0.0 -
0.6577 17000 0.0 -
0.6596 17050 0.0 -
0.6616 17100 0.0 -
0.6635 17150 0.0 -
0.6654 17200 0.0 -
0.6674 17250 0.0 -
0.6693 17300 0.0 -
0.6712 17350 0.0 -
0.6732 17400 0.0 -
0.6751 17450 0.0 -
0.6770 17500 0.0 -
0.6790 17550 0.0 -
0.6809 17600 0.0 -
0.6828 17650 0.0 -
0.6848 17700 0.0 -
0.6867 17750 0.0 -
0.6886 17800 0.0 -
0.6906 17850 0.0 -
0.6925 17900 0.0 -
0.6944 17950 0.0 -
0.6964 18000 0.0 -
0.6983 18050 0.0007 -
0.7002 18100 0.0 -
0.7022 18150 0.0 -
0.7041 18200 0.0 -
0.7061 18250 0.0 -
0.7080 18300 0.0 -
0.7099 18350 0.0 -
0.7119 18400 0.0 -
0.7138 18450 0.0 -
0.7157 18500 0.0001 -
0.7177 18550 0.0 -
0.7196 18600 0.0 -
0.7215 18650 0.0004 -
0.7235 18700 0.0 -
0.7254 18750 0.0 -
0.7273 18800 0.0 -
0.7293 18850 0.0 -
0.7312 18900 0.0 -
0.7331 18950 0.0 -
0.7351 19000 0.0 -
0.7370 19050 0.0 -
0.7389 19100 0.0 -
0.7409 19150 0.0 -
0.7428 19200 0.0 -
0.7447 19250 0.0 -
0.7467 19300 0.0 -
0.7486 19350 0.0 -
0.7505 19400 0.0 -
0.7525 19450 0.0 -
0.7544 19500 0.0 -
0.7563 19550 0.0 -
0.7583 19600 0.0 -
0.7602 19650 0.0 -
0.7621 19700 0.0 -
0.7641 19750 0.0 -
0.7660 19800 0.0 -
0.7680 19850 0.0 -
0.7699 19900 0.0 -
0.7718 19950 0.0 -
0.7738 20000 0.0 -
0.7757 20050 0.0 -
0.7776 20100 0.0 -
0.7796 20150 0.0 -
0.7815 20200 0.0 -
0.7834 20250 0.0 -
0.7854 20300 0.0 -
0.7873 20350 0.0 -
0.7892 20400 0.0 -
0.7912 20450 0.0 -
0.7931 20500 0.0 -
0.7950 20550 0.0 -
0.7970 20600 0.0 -
0.7989 20650 0.0 -
0.8008 20700 0.0 -
0.8028 20750 0.0 -
0.8047 20800 0.0 -
0.8066 20850 0.0 -
0.8086 20900 0.0 -
0.8105 20950 0.0 -
0.8124 21000 0.0 -
0.8144 21050 0.0 -
0.8163 21100 0.0 -
0.8182 21150 0.0 -
0.8202 21200 0.0 -
0.8221 21250 0.0 -
0.8240 21300 0.0 -
0.8260 21350 0.0 -
0.8279 21400 0.0 -
0.8299 21450 0.0 -
0.8318 21500 0.0 -
0.8337 21550 0.0 -
0.8357 21600 0.0 -
0.8376 21650 0.0 -
0.8395 21700 0.0 -
0.8415 21750 0.0 -
0.8434 21800 0.0 -
0.8453 21850 0.0 -
0.8473 21900 0.0 -
0.8492 21950 0.0 -
0.8511 22000 0.0 -
0.8531 22050 0.0 -
0.8550 22100 0.0 -
0.8569 22150 0.0 -
0.8589 22200 0.0 -
0.8608 22250 0.0 -
0.8627 22300 0.0 -
0.8647 22350 0.0 -
0.8666 22400 0.0 -
0.8685 22450 0.0 -
0.8705 22500 0.0 -
0.8724 22550 0.0 -
0.8743 22600 0.0 -
0.8763 22650 0.0 -
0.8782 22700 0.0 -
0.8801 22750 0.0 -
0.8821 22800 0.0 -
0.8840 22850 0.0 -
0.8859 22900 0.0 -
0.8879 22950 0.0 -
0.8898 23000 0.0 -
0.8918 23050 0.0 -
0.8937 23100 0.0 -
0.8956 23150 0.0 -
0.8976 23200 0.0 -
0.8995 23250 0.0 -
0.9014 23300 0.0 -
0.9034 23350 0.0 -
0.9053 23400 0.0 -
0.9072 23450 0.0 -
0.9092 23500 0.0 -
0.9111 23550 0.0 -
0.9130 23600 0.0 -
0.9150 23650 0.0 -
0.9169 23700 0.0 -
0.9188 23750 0.0 -
0.9208 23800 0.0 -
0.9227 23850 0.0 -
0.9246 23900 0.0 -
0.9266 23950 0.0 -
0.9285 24000 0.0 -
0.9304 24050 0.0 -
0.9324 24100 0.0 -
0.9343 24150 0.0 -
0.9362 24200 0.0 -
0.9382 24250 0.0 -
0.9401 24300 0.0 -
0.9420 24350 0.0 -
0.9440 24400 0.0 -
0.9459 24450 0.0 -
0.9478 24500 0.0 -
0.9498 24550 0.0 -
0.9517 24600 0.0 -
0.9537 24650 0.0 -
0.9556 24700 0.0 -
0.9575 24750 0.0 -
0.9595 24800 0.0 -
0.9614 24850 0.0 -
0.9633 24900 0.0 -
0.9653 24950 0.0 -
0.9672 25000 0.0 -
0.9691 25050 0.0 -
0.9711 25100 0.0 -
0.9730 25150 0.0 -
0.9749 25200 0.0 -
0.9769 25250 0.0 -
0.9788 25300 0.0 -
0.9807 25350 0.0 -
0.9827 25400 0.0 -
0.9846 25450 0.0 -
0.9865 25500 0.0 -
0.9885 25550 0.0 -
0.9904 25600 0.0 -
0.9923 25650 0.0 -
0.9943 25700 0.0 -
0.9962 25750 0.0 -
0.9981 25800 0.0 -

Framework Versions

  • Python: 3.10.12
  • SetFit: 1.1.0
  • Sentence Transformers: 3.3.1
  • Transformers: 4.42.2
  • PyTorch: 2.5.1+cu121
  • Datasets: 3.2.0
  • Tokenizers: 0.19.1

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
Safetensors
Model size
22.7M params
Tensor type
F32
·
Inference Examples
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.

Model tree for cbpuschmann/MiniLM-klimacoder_v0.5

Finetuned
(181)
this model

Evaluation results