SetFit with sentence-transformers/all-mpnet-base-v2

This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/all-mpnet-base-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
  • ' Klima-Aktivisten von Fridays for Future und der Letzten Generation setzen weiterhin auf öffentliche Aktionen, um auf die Dringlichkeit des Klimawandels hinzuweisen.'
  • ' Die Gesetzesinitiative zur flächendeckenden Einführung von Wärmepumpen wird kontrovers diskutiert, da sie sowohl ökologische Vorteile als auch erhebliche wirtschaftliche Herausforderungen mit sich bringt.'
  • 'Ein Gesetzesentwurf der Bundesregierung sieht vor, dass zukünftig auf allen Autobahnen in Deutschland eine Höchstgeschwindigkeit von 130 Kilometern pro Stunde gelten soll, um den Ausstoß von Kohlendioxid zu reduzieren und die Verkehrssicherheit zu erhöhen.'
opposed
  • ' "Diese Klima-Aktivisten blockieren wieder einmal die Straßen und bringen den Verkehr zum Erliegen – als ob das die Welt retten würde!"'
  • 'Die Blockaden von Straßen und Autobahnen durch die Letzte Generation haben in den letzten Wochen zu massiven Behinderungen im Berufsverkehr geführt und die Nerven der Pendler strapaziert.'
  • 'Wer hierzulande die Freiheit auf der Autobahn einschränken will, gefährdet auch die Freizeit und die Urlaubsfahrten vieler Menschen.'
supportive
  • ' Die Aktionen von Klima-Aktivismus-Gruppen wie Fridays for Future oder die Letze Generation zeigen eindrucksvoll, dass junge Menschen bereit sind, für eine lebenswerte Zukunft zu kämpfen.'
  • 'Die Bundesregierung setzt mit dem Heizungsgesetz auf eine entscheidende Weichenstellung, um den Ausstoß von Treibhausgasen in der Gebäudewärme zu reduzieren und gleichzeitig die Abhängigkeit von fossilen Energieträgern zu verringern.'
  • ' Die Aktionen von Gruppen wie Fridays for Future und der Letzten Generation zeigen eindrucksvoll, dass die jüngere Generation bereit ist, Verantwortung für unsere Zukunft zu übernehmen.'

Evaluation

Metrics

Label Accuracy
all 0.9462

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/all-mpnet-base-klimacoder_v0.7")
# Run inference
preds = model(" Diese selbsternannten Klimaretter blockieren wieder einmal die Straßen und sorgen für Chaos, während der Rest der Welt zur Arbeit gehen muss.")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 10 25.6075 57
Label Training Sample Count
neutral 329
opposed 395
supportive 392

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.2421 -
0.0019 50 0.259 -
0.0039 100 0.2536 -
0.0058 150 0.25 -
0.0077 200 0.243 -
0.0097 250 0.2441 -
0.0116 300 0.2377 -
0.0135 350 0.2247 -
0.0155 400 0.2031 -
0.0174 450 0.1656 -
0.0193 500 0.1383 -
0.0213 550 0.1383 -
0.0232 600 0.1155 -
0.0251 650 0.1007 -
0.0271 700 0.0741 -
0.0290 750 0.063 -
0.0309 800 0.0428 -
0.0329 850 0.0304 -
0.0348 900 0.0243 -
0.0367 950 0.0189 -
0.0387 1000 0.0135 -
0.0406 1050 0.0089 -
0.0425 1100 0.0115 -
0.0445 1150 0.0071 -
0.0464 1200 0.0068 -
0.0483 1250 0.0057 -
0.0503 1300 0.0052 -
0.0522 1350 0.0063 -
0.0541 1400 0.0064 -
0.0561 1450 0.006 -
0.0580 1500 0.0035 -
0.0599 1550 0.008 -
0.0619 1600 0.0069 -
0.0638 1650 0.0021 -
0.0657 1700 0.0037 -
0.0677 1750 0.0034 -
0.0696 1800 0.0049 -
0.0715 1850 0.0024 -
0.0735 1900 0.0085 -
0.0754 1950 0.0075 -
0.0773 2000 0.0073 -
0.0793 2050 0.0031 -
0.0812 2100 0.0031 -
0.0831 2150 0.0017 -
0.0851 2200 0.0024 -
0.0870 2250 0.0026 -
0.0889 2300 0.0033 -
0.0909 2350 0.0097 -
0.0928 2400 0.0079 -
0.0947 2450 0.0028 -
0.0967 2500 0.0021 -
0.0986 2550 0.0015 -
0.1005 2600 0.0018 -
0.1025 2650 0.0028 -
0.1044 2700 0.0045 -
0.1063 2750 0.0029 -
0.1083 2800 0.0007 -
0.1102 2850 0.0 -
0.1121 2900 0.0008 -
0.1141 2950 0.0017 -
0.1160 3000 0.0018 -
0.1179 3050 0.0014 -
0.1199 3100 0.0012 -
0.1218 3150 0.001 -
0.1237 3200 0.0016 -
0.1257 3250 0.0043 -
0.1276 3300 0.0001 -
0.1295 3350 0.0017 -
0.1315 3400 0.0003 -
0.1334 3450 0.0004 -
0.1353 3500 0.0014 -
0.1373 3550 0.0001 -
0.1392 3600 0.0 -
0.1411 3650 0.0012 -
0.1431 3700 0.0005 -
0.1450 3750 0.0 -
0.1469 3800 0.0 -
0.1489 3850 0.0 -
0.1508 3900 0.0 -
0.1527 3950 0.0 -
0.1547 4000 0.0061 -
0.1566 4050 0.0014 -
0.1585 4100 0.0005 -
0.1605 4150 0.0005 -
0.1624 4200 0.0001 -
0.1643 4250 0.0003 -
0.1663 4300 0.0033 -
0.1682 4350 0.0049 -
0.1701 4400 0.0012 -
0.1721 4450 0.0 -
0.1740 4500 0.0012 -
0.1759 4550 0.0006 -
0.1779 4600 0.0 -
0.1798 4650 0.0 -
0.1817 4700 0.0 -
0.1837 4750 0.0 -
0.1856 4800 0.0 -
0.1875 4850 0.0 -
0.1895 4900 0.0 -
0.1914 4950 0.0 -
0.1933 5000 0.0 -
0.1953 5050 0.0 -
0.1972 5100 0.0 -
0.1991 5150 0.0 -
0.2011 5200 0.0 -
0.2030 5250 0.0 -
0.2049 5300 0.0091 -
0.2069 5350 0.0118 -
0.2088 5400 0.0032 -
0.2107 5450 0.0009 -
0.2127 5500 0.0011 -
0.2146 5550 0.0015 -
0.2165 5600 0.0026 -
0.2185 5650 0.0016 -
0.2204 5700 0.0 -
0.2223 5750 0.0019 -
0.2243 5800 0.0039 -
0.2262 5850 0.0005 -
0.2281 5900 0.0006 -
0.2301 5950 0.0015 -
0.2320 6000 0.0018 -
0.2339 6050 0.0012 -
0.2359 6100 0.0042 -
0.2378 6150 0.0016 -
0.2397 6200 0.0011 -
0.2417 6250 0.0 -
0.2436 6300 0.0 -
0.2455 6350 0.0025 -
0.2475 6400 0.0012 -
0.2494 6450 0.0 -
0.2513 6500 0.0 -
0.2533 6550 0.0 -
0.2552 6600 0.0 -
0.2571 6650 0.0 -
0.2591 6700 0.0 -
0.2610 6750 0.0 -
0.2629 6800 0.0 -
0.2649 6850 0.0 -
0.2668 6900 0.0 -
0.2687 6950 0.0 -
0.2707 7000 0.0 -
0.2726 7050 0.0 -
0.2745 7100 0.0 -
0.2765 7150 0.0 -
0.2784 7200 0.0 -
0.2803 7250 0.0 -
0.2823 7300 0.0 -
0.2842 7350 0.0 -
0.2861 7400 0.0 -
0.2881 7450 0.0 -
0.2900 7500 0.0 -
0.2919 7550 0.0 -
0.2939 7600 0.0 -
0.2958 7650 0.0 -
0.2977 7700 0.0 -
0.2997 7750 0.0 -
0.3016 7800 0.0 -
0.3035 7850 0.0 -
0.3055 7900 0.0 -
0.3074 7950 0.0 -
0.3093 8000 0.0 -
0.3113 8050 0.0 -
0.3132 8100 0.0 -
0.3151 8150 0.0 -
0.3171 8200 0.0 -
0.3190 8250 0.0 -
0.3209 8300 0.0 -
0.3229 8350 0.0 -
0.3248 8400 0.0 -
0.3267 8450 0.0 -
0.3287 8500 0.0 -
0.3306 8550 0.0 -
0.3325 8600 0.0 -
0.3345 8650 0.0 -
0.3364 8700 0.0 -
0.3383 8750 0.0 -
0.3403 8800 0.0 -
0.3422 8850 0.0 -
0.3441 8900 0.0 -
0.3461 8950 0.0 -
0.3480 9000 0.0 -
0.3499 9050 0.0 -
0.3519 9100 0.0 -
0.3538 9150 0.0 -
0.3557 9200 0.0 -
0.3577 9250 0.0 -
0.3596 9300 0.0 -
0.3615 9350 0.0 -
0.3635 9400 0.0 -
0.3654 9450 0.0081 -
0.3673 9500 0.0078 -
0.3693 9550 0.0104 -
0.3712 9600 0.0034 -
0.3731 9650 0.0009 -
0.3751 9700 0.0006 -
0.3770 9750 0.0033 -
0.3789 9800 0.0007 -
0.3809 9850 0.0 -
0.3828 9900 0.0 -
0.3847 9950 0.0 -
0.3867 10000 0.0006 -
0.3886 10050 0.0 -
0.3905 10100 0.0 -
0.3925 10150 0.0 -
0.3944 10200 0.0 -
0.3963 10250 0.0 -
0.3983 10300 0.0 -
0.4002 10350 0.0 -
0.4021 10400 0.0 -
0.4041 10450 0.0019 -
0.4060 10500 0.0035 -
0.4080 10550 0.0012 -
0.4099 10600 0.0 -
0.4118 10650 0.0 -
0.4138 10700 0.0 -
0.4157 10750 0.0 -
0.4176 10800 0.0 -
0.4196 10850 0.0 -
0.4215 10900 0.0 -
0.4234 10950 0.0006 -
0.4254 11000 0.0 -
0.4273 11050 0.0 -
0.4292 11100 0.0 -
0.4312 11150 0.0 -
0.4331 11200 0.0 -
0.4350 11250 0.0 -
0.4370 11300 0.0 -
0.4389 11350 0.0 -
0.4408 11400 0.0 -
0.4428 11450 0.0 -
0.4447 11500 0.0 -
0.4466 11550 0.0 -
0.4486 11600 0.0 -
0.4505 11650 0.0 -
0.4524 11700 0.0 -
0.4544 11750 0.0 -
0.4563 11800 0.0 -
0.4582 11850 0.0 -
0.4602 11900 0.0 -
0.4621 11950 0.0 -
0.4640 12000 0.0 -
0.4660 12050 0.0 -
0.4679 12100 0.0 -
0.4698 12150 0.0 -
0.4718 12200 0.0 -
0.4737 12250 0.0 -
0.4756 12300 0.0 -
0.4776 12350 0.0 -
0.4795 12400 0.0 -
0.4814 12450 0.0 -
0.4834 12500 0.0 -
0.4853 12550 0.0 -
0.4872 12600 0.0 -
0.4892 12650 0.0 -
0.4911 12700 0.0 -
0.4930 12750 0.0 -
0.4950 12800 0.0 -
0.4969 12850 0.0 -
0.4988 12900 0.0 -
0.5008 12950 0.0 -
0.5027 13000 0.0 -
0.5046 13050 0.0 -
0.5066 13100 0.0 -
0.5085 13150 0.0 -
0.5104 13200 0.0 -
0.5124 13250 0.0 -
0.5143 13300 0.0 -
0.5162 13350 0.0 -
0.5182 13400 0.0 -
0.5201 13450 0.0 -
0.5220 13500 0.0 -
0.5240 13550 0.0 -
0.5259 13600 0.0 -
0.5278 13650 0.0 -
0.5298 13700 0.0 -
0.5317 13750 0.0 -
0.5336 13800 0.0 -
0.5356 13850 0.0 -
0.5375 13900 0.0 -
0.5394 13950 0.0 -
0.5414 14000 0.0 -
0.5433 14050 0.0 -
0.5452 14100 0.0 -
0.5472 14150 0.0 -
0.5491 14200 0.0 -
0.5510 14250 0.0 -
0.5530 14300 0.0 -
0.5549 14350 0.0 -
0.5568 14400 0.0 -
0.5588 14450 0.0 -
0.5607 14500 0.0 -
0.5626 14550 0.0 -
0.5646 14600 0.0 -
0.5665 14650 0.0 -
0.5684 14700 0.0 -
0.5704 14750 0.0 -
0.5723 14800 0.0 -
0.5742 14850 0.0 -
0.5762 14900 0.0 -
0.5781 14950 0.0 -
0.5800 15000 0.0 -
0.5820 15050 0.0 -
0.5839 15100 0.0 -
0.5858 15150 0.0 -
0.5878 15200 0.0 -
0.5897 15250 0.0 -
0.5916 15300 0.0 -
0.5936 15350 0.0 -
0.5955 15400 0.0 -
0.5974 15450 0.0 -
0.5994 15500 0.0 -
0.6013 15550 0.0 -
0.6032 15600 0.0 -
0.6052 15650 0.0 -
0.6071 15700 0.0 -
0.6090 15750 0.0 -
0.6110 15800 0.0 -
0.6129 15850 0.0 -
0.6148 15900 0.0 -
0.6168 15950 0.0 -
0.6187 16000 0.0 -
0.6206 16050 0.0 -
0.6226 16100 0.0 -
0.6245 16150 0.0 -
0.6264 16200 0.0 -
0.6284 16250 0.0 -
0.6303 16300 0.0 -
0.6322 16350 0.0 -
0.6342 16400 0.0 -
0.6361 16450 0.0 -
0.6380 16500 0.0 -
0.6400 16550 0.0 -
0.6419 16600 0.0 -
0.6438 16650 0.0 -
0.6458 16700 0.0 -
0.6477 16750 0.0 -
0.6496 16800 0.0 -
0.6516 16850 0.0 -
0.6535 16900 0.0 -
0.6554 16950 0.0 -
0.6574 17000 0.0 -
0.6593 17050 0.0 -
0.6612 17100 0.0 -
0.6632 17150 0.0 -
0.6651 17200 0.0 -
0.6670 17250 0.0 -
0.6690 17300 0.0 -
0.6709 17350 0.0 -
0.6728 17400 0.0 -
0.6748 17450 0.0 -
0.6767 17500 0.0 -
0.6786 17550 0.0 -
0.6806 17600 0.0 -
0.6825 17650 0.0 -
0.6844 17700 0.0 -
0.6864 17750 0.0 -
0.6883 17800 0.0 -
0.6902 17850 0.0 -
0.6922 17900 0.0 -
0.6941 17950 0.0 -
0.6960 18000 0.0 -
0.6980 18050 0.0 -
0.6999 18100 0.0 -
0.7018 18150 0.0 -
0.7038 18200 0.0 -
0.7057 18250 0.0 -
0.7076 18300 0.0 -
0.7096 18350 0.0 -
0.7115 18400 0.0 -
0.7134 18450 0.0 -
0.7154 18500 0.0 -
0.7173 18550 0.0 -
0.7192 18600 0.0 -
0.7212 18650 0.0 -
0.7231 18700 0.0 -
0.7250 18750 0.0 -
0.7270 18800 0.0 -
0.7289 18850 0.0 -
0.7308 18900 0.0 -
0.7328 18950 0.0 -
0.7347 19000 0.0 -
0.7366 19050 0.0 -
0.7386 19100 0.0 -
0.7405 19150 0.0 -
0.7424 19200 0.0 -
0.7444 19250 0.0 -
0.7463 19300 0.0 -
0.7482 19350 0.0 -
0.7502 19400 0.0 -
0.7521 19450 0.0 -
0.7540 19500 0.0 -
0.7560 19550 0.0 -
0.7579 19600 0.0 -
0.7598 19650 0.0 -
0.7618 19700 0.0 -
0.7637 19750 0.0 -
0.7656 19800 0.0 -
0.7676 19850 0.0 -
0.7695 19900 0.0 -
0.7714 19950 0.0 -
0.7734 20000 0.0 -
0.7753 20050 0.0 -
0.7772 20100 0.0 -
0.7792 20150 0.0 -
0.7811 20200 0.0 -
0.7830 20250 0.0 -
0.7850 20300 0.0 -
0.7869 20350 0.0 -
0.7888 20400 0.0 -
0.7908 20450 0.0 -
0.7927 20500 0.0 -
0.7946 20550 0.0 -
0.7966 20600 0.0 -
0.7985 20650 0.0 -
0.8004 20700 0.0 -
0.8024 20750 0.0 -
0.8043 20800 0.0 -
0.8062 20850 0.0 -
0.8082 20900 0.0 -
0.8101 20950 0.0 -
0.8120 21000 0.0 -
0.8140 21050 0.0 -
0.8159 21100 0.0 -
0.8178 21150 0.0 -
0.8198 21200 0.0002 -
0.8217 21250 0.0027 -
0.8236 21300 0.0019 -
0.8256 21350 0.0 -
0.8275 21400 0.0 -
0.8294 21450 0.0 -
0.8314 21500 0.0 -
0.8333 21550 0.0011 -
0.8352 21600 0.0 -
0.8372 21650 0.0 -
0.8391 21700 0.0 -
0.8410 21750 0.0 -
0.8430 21800 0.0 -
0.8449 21850 0.0 -
0.8468 21900 0.0 -
0.8488 21950 0.0006 -
0.8507 22000 0.0 -
0.8526 22050 0.0 -
0.8546 22100 0.0002 -
0.8565 22150 0.0 -
0.8584 22200 0.0011 -
0.8604 22250 0.0 -
0.8623 22300 0.0 -
0.8642 22350 0.0 -
0.8662 22400 0.0 -
0.8681 22450 0.0 -
0.8700 22500 0.0 -
0.8720 22550 0.0 -
0.8739 22600 0.0 -
0.8758 22650 0.0 -
0.8778 22700 0.0 -
0.8797 22750 0.0 -
0.8816 22800 0.0 -
0.8836 22850 0.0 -
0.8855 22900 0.0 -
0.8874 22950 0.0 -
0.8894 23000 0.0 -
0.8913 23050 0.0 -
0.8932 23100 0.0 -
0.8952 23150 0.0 -
0.8971 23200 0.0 -
0.8990 23250 0.0 -
0.9010 23300 0.0 -
0.9029 23350 0.0 -
0.9048 23400 0.0 -
0.9068 23450 0.0 -
0.9087 23500 0.0 -
0.9106 23550 0.0 -
0.9126 23600 0.0 -
0.9145 23650 0.0 -
0.9164 23700 0.0 -
0.9184 23750 0.0 -
0.9203 23800 0.0 -
0.9222 23850 0.0 -
0.9242 23900 0.0 -
0.9261 23950 0.0 -
0.9280 24000 0.0 -
0.9300 24050 0.0 -
0.9319 24100 0.0 -
0.9338 24150 0.0 -
0.9358 24200 0.0 -
0.9377 24250 0.0 -
0.9396 24300 0.0 -
0.9416 24350 0.0 -
0.9435 24400 0.0 -
0.9454 24450 0.0 -
0.9474 24500 0.0 -
0.9493 24550 0.0 -
0.9512 24600 0.0 -
0.9532 24650 0.0 -
0.9551 24700 0.0 -
0.9570 24750 0.0 -
0.9590 24800 0.0 -
0.9609 24850 0.0 -
0.9628 24900 0.0 -
0.9648 24950 0.0 -
0.9667 25000 0.0 -
0.9686 25050 0.0 -
0.9706 25100 0.0 -
0.9725 25150 0.0 -
0.9744 25200 0.0 -
0.9764 25250 0.0 -
0.9783 25300 0.0 -
0.9802 25350 0.0 -
0.9822 25400 0.0 -
0.9841 25450 0.0 -
0.9860 25500 0.0 -
0.9880 25550 0.0 -
0.9899 25600 0.0 -
0.9918 25650 0.0 -
0.9938 25700 0.0 -
0.9957 25750 0.0 -
0.9976 25800 0.0 -
0.9996 25850 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
109M 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/all-mpnet-base-klimacoder_v0.7

Finetuned
(188)
this model

Evaluation results