CoolFace
Modelpublic

dendimaki/emotionSample

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes13downloads
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
sadness<ul><li>'i am from new jersey and this first drink was consumed at a post prom party so i feel it s appropriately lame'</li><li>'i am the one feeling punished'</li><li>'i wouldn t feel submissive which has it s place but not in the work environment'</li></ul>
love<ul><li>'i would rather take my chances on keeping my heart and getting it broken again and again then to stop feeling to stop caring to be bitter cross cynical'</li><li>'i still love to run and plan to keep it up but i don t want to once again register for so many races that i feel like every exercise moment needs to be devoted to running'</li><li>'i suddenly feel that this is more than a sweet love song that every girls could sing in front of their boyfriends'</li></ul>
surprise<ul><li>'i was feeling an act of god at work in my life and it was an amazing feeling'</li><li>'i tween sat for my moms boss year old and year old boys this weekend id say babysit but that feels weird considering there were n'</li><li>'i started feeling funny and then friday i woke up sick as a dog'</li></ul>
anger<ul><li>'i could of course go on with it feeling resentful of him with him being blissfully unaware of anything being wrong'</li><li>'i feel tortured because i am not allowed to enjoy food the way my friend can'</li><li>'i feel like i should be offended but yawwwn'</li></ul>
joy<ul><li>'i was feeling over eager and hopped on to the tube to ride the eye of london'</li><li>'i am not feeling particularly creative'</li><li>'i woke on saturday feeling a little brighter and was very keen to get outdoors after spending all day friday wallowing in self pity'</li></ul>
fear<ul><li>'im feeling pretty shaken at the moment'</li><li>'i know he is totally trainable and can be free of his arm chewing habits i feel that the kids would be too nervous around him during the training process'</li><li>'i am feeling pretty restless right now while typing this'</li></ul>

Evaluation

Metrics

LabelAccuracy
all0.4584

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("dendimaki/apeiron-v4")
# Run inference
preds = model("i feel for you despite the bitterness and longing")

<!--

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 count417.645855
LabelTraining Sample Count
sadness8
joy8
love8
anger8
fear8
surprise8

Training Hyperparameters

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

Training Results

EpochStepTraining LossValidation Loss
0.008310.2802-
0.4167500.1302-
0.83331000.0121-
1.0120-0.2668
1.251500.003-
1.66672000.0007-
2.0240-0.2562
2.08332500.0008-
2.53000.0009-
2.91673500.0007-
3.0360-0.2572
3.33334000.0005-
3.754500.0005-
4.0480-0.2571
  • —The bold row denotes the saved checkpoint.

Framework Versions

  • —Python: 3.10.12
  • —SetFit: 1.0.1
  • —Sentence Transformers: 2.2.2
  • —Transformers: 4.35.2
  • —PyTorch: 2.1.0+cu121
  • —Datasets: 2.16.0
  • —Tokenizers: 0.15.0

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