CoolFace
Modelpublic

pacoreyes/StanceFit

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes11downloads
Model Card

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. 1.Fine-tuning a Sentence Transformer with contrastive learning.
  2. 2.Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

Model Labels

LabelExamples
0<ul><li>'We in the United States believe if we can promote democracy around the world, there will be more peace.'</li><li>'We recognise the transformative power of technology, including digital public infrastructure, to support sustainable development in the Indo-Pacific and deliver economic and social benefits.'</li><li>'This program strengthens democracy, transparency, and the rule of law in developing nations, and I ask you to fully fund this important initiative.'</li></ul>
1<ul><li>'I do not ever want to ever fight a war that is unconstitutional and I am the dangerous person.'</li><li>"And so, we are at a moment where I really think threats to our democracy, threats to our core freedoms are very much on people's minds."</li><li>'My views in opposition to the cancellation of the war debt are a matter of detailed record in many public statements and in a recent message to the Congress.'</li></ul>

Uses

Direct Use for Inference

First install the SetFit library:

bash
pip install setfit

Then you can load this model and run inference.

python
from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("setfit_model_id")
# Run inference
preds = model("We cannot allow the world's leading sponsor of terrorism to possess the planet's most dangerous weapons.")

<!--

Downstream Use

List how someone could finetune this model on their own dataset. -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Set Metrics

Training setMinMedianMax
Word count323.439346
LabelTraining Sample Count
0486
1486

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (1, 1)
  • max_steps: -1
  • sampling_strategy: oversampling
  • bodylearningrate: (1.003444469523018e-06, 1.003444469523018e-06)
  • headlearningrate: 0.01
  • loss: CosineSimilarityLoss
  • distancemetric: cosinedistance
  • margin: 0.25
  • endtoend: False
  • use_amp: False
  • warmup_proportion: 0.1
  • seed: 37
  • evalmaxsteps: -1
  • loadbestmodelatend: True

Training Results

EpochStepTraining LossValidation Loss
0.000010.3295-
0.0017500.3132-
0.00341000.274-
0.00511500.2774-
0.00682000.2578-
0.00842500.2536-
0.01013000.3353-
0.01183500.253-
0.01354000.2865-
0.01524500.2894-
0.01695000.25540.2632
0.01865500.2487-
0.02036000.2713-
0.02206500.2841-
0.02377000.2251-
0.02537500.2534-
0.02708000.2489-
0.02878500.2297-
0.03049000.2288-
0.03219500.211-
0.033810000.1880.2073
0.035510500.1488-
0.037211000.2103-
0.038911500.1607-
0.040612000.0793-
0.042212500.0968-
0.043913000.0987-
0.045613500.0786-
0.047314000.0267-
0.049014500.0432-
0.050715000.02620.064
0.052415500.1269-
0.054116000.039-
0.055816500.0266-
0.057517000.0455-
0.059117500.0175-
0.060818000.0157-
0.062518500.0063-
0.064219000.0146-
0.065919500.0046-
0.067620000.00460.0464
0.069320500.0035-
0.071021000.0073-
0.072721500.0012-
0.074422000.0025-
0.076022500.0023-
0.077723000.0017-
0.079423500.0012-
0.081124000.0017-
0.082824500.0016-
0.084525000.00140.0535
0.086225500.0011-
0.087926000.0021-
0.089626500.0009-
0.091327000.0008-
0.092927500.0006-
0.094628000.0007-
0.096328500.0012-
0.098029000.001-
0.099729500.0005-
0.101430000.00060.0575
0.103130500.0006-
0.104831000.0004-
0.106531500.0006-
0.108232000.0005-
0.109832500.0006-
0.111533000.0005-
0.113233500.0008-
0.114934000.0003-
0.116634500.0005-
0.118335000.00040.0642
0.120035500.0006-
0.121736000.0003-
0.123436500.0009-
0.125137000.0002-
0.126737500.0003-
0.128438000.0005-
0.130138500.0002-
0.131839000.0002-
0.133539500.0005-
0.135240000.00030.0697
0.136940500.0002-
0.138641000.0002-
0.140341500.0004-
0.142042000.0012-
0.143642500.0002-
0.145343000.0002-
0.147043500.0001-
0.148744000.0002-
0.150444500.0002-
0.152145000.00030.0718
0.153845500.0003-
0.155546000.0002-
0.157246500.0002-
0.158947000.0003-
0.160547500.0002-
0.162248000.0002-
0.163948500.0002-
0.165649000.0002-
0.167349500.0002-
0.169050000.00020.0684
0.170750500.0002-
0.172451000.0002-
0.174151500.0002-
0.175852000.0003-
0.177452500.0002-
0.179153000.0001-
0.180853500.0002-
0.182554000.0001-
0.184254500.0001-
0.185955000.00010.0731
0.187655500.0002-
0.189356000.0002-
0.191056500.0001-
0.192757000.0001-
0.194357500.0001-
0.196058000.0002-
0.197758500.0001-
0.199459000.0003-
0.201159500.0002-
0.202860000.00020.0724
0.204560500.0001-
0.206261000.0001-
0.207961500.0001-
0.209662000.0001-
0.211262500.0001-
0.212963000.0002-
0.214663500.0001-
0.216364000.0001-
0.218064500.0001-
0.219765000.00010.0784
0.221465500.0001-
0.223166000.0001-
0.224866500.0001-
0.226567000.0001-
0.228167500.0001-
0.229868000.0001-
0.231568500.0001-
0.233269000.0001-
0.234969500.0002-
0.236670000.00010.0672
0.238370500.0001-
0.240071000.0001-
0.241771500.0001-
0.243472000.0001-
0.245072500.0001-
0.246773000.0001-
0.248473500.0001-
0.250174000.0001-
0.251874500.0001-
0.253575000.00010.0627
0.255275500.0001-
0.256976000.0001-
0.258676500.0-
0.260377000.0001-
0.261977500.0-
0.263678000.0001-
0.265378500.0001-
0.267079000.0001-
0.268779500.0001-
0.270480000.00.0754
0.272180500.0001-
0.273881000.0001-
0.275581500.0-
0.277282000.0-
0.278882500.0-
0.280583000.0001-
0.282283500.0001-
0.283984000.0001-
0.285684500.0-
0.287385000.00.0748
0.289085500.0-
0.290786000.0-
0.292486500.0-
0.294187000.0-
0.295787500.0001-
0.297488000.0001-
0.299188500.0001-
0.300889000.0-
0.302589500.0001-
0.304290000.00010.057
0.305990500.0-
0.307691000.0-
0.309391500.0002-
0.311092000.0-
0.312692500.0-
0.314393000.0-
0.316093500.0001-
0.317794000.0002-
0.319494500.0-
0.321195000.00.0781
0.322895500.0-
0.324596000.0-
0.326296500.0-
0.327997000.0-
0.329597500.0-
0.331298000.0-
0.332998500.0-
0.334699000.0001-
0.336399500.0-
0.3380100000.00.0698
0.3397100500.0-
0.3414101000.0-
0.3431101500.0-
0.3448102000.0-
0.3464102500.0022-
0.3481103000.0-
0.3498103500.0001-
0.3515104000.0-
0.3532104500.0-
0.3549105000.00.0698
0.3566105500.0-
0.3583106000.0-
0.3600106500.0-
0.3617107000.0-
0.3633107500.0-
0.3650108000.0-
0.3667108500.0-
0.3684109000.0001-
0.3701109500.0-
0.3718110000.00.0746
0.3735110500.0-
0.3752111000.0-
0.3769111500.0001-
0.3786112000.0-
0.3802112500.0-
0.3819113000.0-
0.3836113500.0-
0.3853114000.0-
0.3870114500.0-
0.3887115000.00.0753
0.3904115500.0-
0.3921116000.0001-
0.3938116500.0-
0.3955117000.0-
0.3971117500.0-
0.3988118000.0-
0.4005118500.0-
0.4022119000.0-
0.4039119500.0-
0.4056120000.00.0743
0.4073120500.0-
0.4090121000.0-
0.4107121500.0-
0.4124122000.0-
0.4140122500.0-
0.4157123000.0-
0.4174123500.0-
0.4191124000.0-
0.4208124500.0-
0.4225125000.00.0733
0.4242125500.0-
0.4259126000.0-
0.4276126500.0-
0.4293127000.0-
0.4309127500.0-
0.4326128000.0-
0.4343128500.0-
0.4360129000.0-
0.4377129500.0-
0.4394130000.00.072
0.4411130500.0-
0.4428131000.0-
0.4445131500.0-
0.4462132000.0-
0.4478132500.0-
0.4495133000.0-
0.4512133500.0-
0.4529134000.0-
0.4546134500.0-
0.4563135000.00.0753
0.4580135500.0-
0.4597136000.0-
0.4614136500.0-
0.4631137000.0-
0.4647137500.0-
0.4664138000.0-
0.4681138500.0-
0.4698139000.0-
0.4715139500.0-
0.4732140000.00.0756
0.4749140500.0-
0.4766141000.0-
0.4783141500.0-
0.4800142000.0-
0.4816142500.0-
0.4833143000.0-
0.4850143500.0-
0.4867144000.0-
0.4884144500.0-
0.4901145000.00.0622
0.4918145500.0-
0.4935146000.0-
0.4952146500.0-
0.4969147000.0-
0.4985147500.0-
0.5002148000.0-
0.5019148500.0-
0.5036149000.0-
0.5053149500.0-
0.5070150000.00.0676
0.5087150500.0-
0.5104151000.0-
0.5121151500.0-
0.5138152000.0-
0.5154152500.0-
0.5171153000.0-
0.5188153500.0-
0.5205154000.0-
0.5222154500.0-
0.5239155000.00.0668
0.5256155500.0-
0.5273156000.0-
0.5290156500.0-
0.5307157000.0-
0.5323157500.0-
0.5340158000.0-
0.5357158500.0-
0.5374159000.0-
0.5391159500.0-
0.5408160000.00.0707
0.5425160500.0-
0.5442161000.0-
0.5459161500.0-
0.5476162000.0-
0.5492162500.0-
0.5509163000.0-
0.5526163500.0-
0.5543164000.0-
0.5560164500.0-
0.5577165000.00.0644
0.5594165500.0-
0.5611166000.0-
0.5628166500.0-
0.5645167000.0-
0.5661167500.0-
0.5678168000.0-
0.5695168500.0-
0.5712169000.0-
0.5729169500.0-
0.5746170000.00.0742
0.5763170500.0-
0.5780171000.0-
0.5797171500.0-
0.5814172000.0-
0.5830172500.0-
0.5847173000.0-
0.5864173500.0-
0.5881174000.0-
0.5898174500.0-
0.5915175000.00.0738
0.5932175500.0-
0.5949176000.0-
0.5966176500.0-
0.5983177000.0-
0.5999177500.0-
0.6016178000.0-
0.6033178500.0-
0.6050179000.0-
0.6067179500.0-
0.6084180000.00.0725
0.6101180500.0-
0.6118181000.0-
0.6135181500.0-
0.6152182000.0-
0.6168182500.0-
0.6185183000.0-
0.6202183500.0-
0.6219184000.0-
0.6236184500.0-
0.6253185000.00.0724
0.6270185500.0-
0.6287186000.0-
0.6304186500.0-
0.6321187000.0-
0.6337187500.0-
0.6354188000.0-
0.6371188500.0-
0.6388189000.0-
0.6405189500.0-
0.6422190000.00.0622
0.6439190500.0-
0.6456191000.0-
0.6473191500.0-
0.6490192000.0-
0.6506192500.0-
0.6523193000.0-
0.6540193500.0-
0.6557194000.0-
0.6574194500.0-
0.6591195000.00.0754
0.6608195500.0-
0.6625196000.0-
0.6642196500.0-
0.6659197000.0-
0.6675197500.0-
0.6692198000.0-
0.6709198500.0-
0.6726199000.0-
0.6743199500.0-
0.6760200000.00.0723
0.6777200500.0-
0.6794201000.0-
0.6811201500.0-
0.6828202000.0-
0.6844202500.0-
0.6861203000.0-
0.6878203500.0-
0.6895204000.0-
0.6912204500.0-
0.6929205000.00.0741
0.6946205500.0-
0.6963206000.0-
0.6980206500.0-
0.6997207000.0-
0.7013207500.0-
0.7030208000.0-
0.7047208500.0-
0.7064209000.0-
0.7081209500.0-
0.7098210000.00.0733
0.7115210500.0-
0.7132211000.0-
0.7149211500.0-
0.7166212000.0-
0.7182212500.0-
0.7199213000.0-
0.7216213500.0-
0.7233214000.0-
0.7250214500.0-
0.7267215000.00.0757
0.7284215500.0-
0.7301216000.0-
0.7318216500.0-
0.7335217000.0-
0.7351217500.0-
0.7368218000.0-
0.7385218500.0-
0.7402219000.0-
0.7419219500.0-
0.7436220000.00.0766
0.7453220500.0-
0.7470221000.0-
0.7487221500.0-
0.7504222000.0-
0.7520222500.0-
0.7537223000.0-
0.7554223500.0-
0.7571224000.0-
0.7588224500.0-
0.7605225000.00.0757
0.7622225500.0-
0.7639226000.0-
0.7656226500.0-
0.7673227000.0-
0.7689227500.0-
0.7706228000.0-
0.7723228500.0-
0.7740229000.0-
0.7757229500.0-
0.7774230000.00.0755
0.7791230500.0-
0.7808231000.0-
0.7825231500.0-
0.7842232000.0-
0.7858232500.0-
0.7875233000.0-
0.7892233500.0-
0.7909234000.0-
0.7926234500.0-
0.7943235000.00.076
0.7960235500.0-
0.7977236000.0-
0.7994236500.0-
0.8011237000.0-
0.8027237500.0-
0.8044238000.0-
0.8061238500.0-
0.8078239000.0-
0.8095239500.0-
0.8112240000.00.0756
0.8129240500.0-
0.8146241000.0-
0.8163241500.0-
0.8180242000.0-
0.8196242500.0-
0.8213243000.0-
0.8230243500.0-
0.8247244000.0-
0.8264244500.0-
0.8281245000.00.0759
0.8298245500.0-
0.8315246000.0-
0.8332246500.0-
0.8349247000.0-
0.8365247500.0-
0.8382248000.0-
0.8399248500.0-
0.8416249000.0-
0.8433249500.0-
0.8450250000.00.0762
0.8467250500.0-
0.8484251000.0-
0.8501251500.0-
0.8518252000.0-
0.8534252500.0-
0.8551253000.0-
0.8568253500.0-
0.8585254000.0-
0.8602254500.0-
0.8619255000.00.0733
0.8636255500.0-
0.8653256000.0-
0.8670256500.0-
0.8687257000.0-
0.8703257500.0-
0.8720258000.0-
0.8737258500.0-
0.8754259000.0-
0.8771259500.0-
0.8788260000.00.0742
0.8805260500.0-
0.8822261000.0-
0.8839261500.0-
0.8856262000.0-
0.8872262500.0-
0.8889263000.0-
0.8906263500.0-
0.8923264000.0-
0.8940264500.0-
0.8957265000.00.0756
0.8974265500.0-
0.8991266000.0-
0.9008266500.0-
0.9025267000.0-
0.9041267500.0-
0.9058268000.0-
0.9075268500.0-
0.9092269000.0-
0.9109269500.0-
0.9126270000.00.0751
0.9143270500.0-
0.9160271000.0-
0.9177271500.0-
0.9194272000.0-
0.9210272500.0-
0.9227273000.0-
0.9244273500.0-
0.9261274000.0-
0.9278274500.0-
0.9295275000.00.075
0.9312275500.0-
0.9329276000.0-
0.9346276500.0-
0.9363277000.0-
0.9379277500.0-
0.9396278000.0-
0.9413278500.0-
0.9430279000.0-
0.9447279500.0-
0.9464280000.00.0725
0.9481280500.0-
0.9498281000.0-
0.9515281500.0-
0.9532282000.0-
0.9548282500.0-
0.9565283000.0-
0.9582283500.0-
0.9599284000.0-
0.9616284500.0-
0.9633285000.00.0761
0.9650285500.0-
0.9667286000.0-
0.9684286500.0-
0.9701287000.0-
0.9717287500.0-
0.9734288000.0-
0.9751288500.0-
0.9768289000.0-
0.9785289500.0-
0.9802290000.00.0759
0.9819290500.0-
0.9836291000.0-
0.9853291500.0-
0.9870292000.0-
0.9886292500.0-
0.9903293000.0-
0.9920293500.0-
0.9937294000.0-
0.9954294500.0-
0.9971295000.00.0761
0.9988295500.0-
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.10.11
  • SetFit: 1.0.1
  • Sentence Transformers: 2.2.2
  • Transformers: 4.25.1
  • PyTorch: 2.1.2
  • Datasets: 2.15.0
  • Tokenizers: 0.13.3

Citation

BibTeX

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}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->