CoolFace
Modelpublic

lucienbaumgartner/moralizedMP

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes7downloads
Model Card

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

This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/paraphrase-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
Linguistic (in)felicity<ul><li>'because the second statement negates what was stated in the first part of the sentence'</li><li>'there is a logic conflict in the statement that renders it bizarre and nonsensical.'</li><li>'there was a contradiction of statements if read at face value, however, it could be read that being homeless is not right in which case the statement would make sense. it is unclear.'</li></ul>
Enrichment / reinterpretation<ul><li>'the statement recognised the objective compassion but the opinion contradicted it'</li><li>"because while it is compassionate to help the homeless people don't always do it out of compassion."</li><li>'it could be the way how homeless are helped. there could be better ways to handle that'</li></ul>
Lack of understanding / clear misunderstanding<ul><li>'it simply sounded stupid. i doubt it makes any sense'</li><li>'it statement didnt make any sense, for us to better understand, tom needs to further explain his reason for stating why its not cruel after first saying it is'</li><li>'it sounds very contradictory'</li></ul>

Evaluation

Metrics

LabelAccuracyPrecisionRecallF1
all0.86840.56430.56290.5626

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("it contradicted itself")

<!--

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 count216.644792
LabelTraining Sample Count
Enrichment / reinterpretation31
Lack of understanding / clear misunderstanding10
Linguistic (in)felicity111

Training Hyperparameters

  • —batch_size: (16, 16)
  • —num_epochs: (10, 10)
  • —max_steps: -1
  • —sampling_strategy: oversampling
  • —num_iterations: 20
  • —bodylearningrate: (2e-05, 2e-05)
  • —headlearningrate: 2e-05
  • —loss: CosineSimilarityLoss
  • —distancemetric: cosinedistance
  • —margin: 0.25
  • —endtoend: False
  • —use_amp: False
  • —warmup_proportion: 0.1
  • —l2_weight: 0.01
  • —seed: 3786
  • —evalmaxsteps: -1
  • —loadbestmodelatend: False

Training Results

EpochStepTraining LossValidation Loss
0.002610.2539-
0.1316500.2248-
0.26321000.1681-
0.39471500.0854-
0.52632000.0128-
0.65792500.0074-
0.78953000.0017-
0.92113500.0021-
1.05264000.0024-
1.18424500.0004-
1.31585000.0011-
1.44745500.0016-
1.57896000.0003-
1.71056500.0002-
1.84217000.0002-
1.97377500.0002-
2.10538000.0002-
2.23688500.0002-
2.36849000.0002-
2.59500.0001-
2.631610000.0001-
2.763210500.0001-
2.894711000.0001-
3.026311500.0001-
3.157912000.0001-
3.289512500.0001-
3.421113000.0001-
3.552613500.0001-
3.684214000.0001-
3.815814500.0001-
3.947415000.0001-
4.078915500.0001-
4.210516000.0001-
4.342116500.0001-
4.473717000.0001-
4.605317500.0001-
4.736818000.0001-
4.868418500.0001-
5.019000.0001-
5.131619500.0001-
5.263220000.0001-
5.394720500.0001-
5.526321000.0001-
5.657921500.0001-
5.789522000.0001-
5.921122500.0001-
6.052623000.0001-
6.184223500.0001-
6.315824000.0001-
6.447424500.0001-
6.578925000.0001-
6.710525500.0001-
6.842126000.0001-
6.973726500.0001-
7.105327000.0001-
7.236827500.0001-
7.368428000.0001-
7.528500.0001-
7.631629000.0001-
7.763229500.0001-
7.894730000.0001-
8.026330500.0001-
8.157931000.0001-
8.289531500.0001-
8.421132000.0001-
8.552632500.0001-
8.684233000.0001-
8.815833500.0001-
8.947434000.0012-
9.078934500.0003-
9.210535000.0001-
9.342135500.0001-
9.473736000.0001-
9.605336500.0001-
9.736837000.0001-
9.868437500.0001-
10.038000.0-

Framework Versions

  • —Python: 3.11.9
  • —SetFit: 1.1.3
  • —Sentence Transformers: 5.1.0
  • —Transformers: 4.55.2
  • —PyTorch: 2.8.0
  • —Datasets: 4.0.0
  • —Tokenizers: 0.21.4

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