Edit model card

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

This is a SetFit model trained on the jakeazcona/short-text-multi-labeled-emotion-classification dataset 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. 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
2
  • 'i could do was feel i felt thankful that her battle was over thankful that she was now in a place of serenity'
  • 'i feel that i m indulging him at times nor does it help that when we started talking his approach was more friend zone friendly than an i want to date you approach'
  • 'i was i might be buying stuff from there but i feel the clothes are too casual'
5
  • 'Me too, except there’s no hookup. (I’m so lonely) '
  • 'Due to work, gotta stay legal. Edibles aren’t legal yet sadly. Fortunately not taking it for cancer though, just pain.'
  • 'I don’t understand the point you’re making sorry'
3
  • 'i feel most passionate about that arouse my emotions seem to be the things i need to learn something about my emotion tells me there is a need to grow in some direction'
  • 'One of my favorite shows of all time.'
  • 'i really feel like he will never love me he will never be affectionate because he doesnt love me'
4
  • 'This is a restaurant in a hotel so it had a strange vibe.'
  • 'i feel very shocked by how many people i talk to who havent seen this movie'
  • "I thought you only get to be a wizard after you're 30yo and still virgin"
1
  • 'i can t help but feeling weird when opening every closet in an apartment that somebody s still living in so i didn t'
  • 'i want to stop taking it one day but also feel terrified that lots of feelings of anxiety panic will come flooding back'
  • 'i have crossed over and i am on safe footing yet still feel this way fearful for the unknown shaky uncertain'
0
  • "??? Where the hell is this article getting it's data from..."
  • 'i feel like i meet the most subtly obnoxious annoying people in the universe'
  • 'This is so cruel. I literally feel physically sick.'

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("teagrjohnson/few_shot_emotions_5epochs-20iter-300trainsize")
# Run inference
preds = model("i feel stupid using this name")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 3 16.54 53
Label Training Sample Count
0 47
1 28
2 86
3 29
4 23
5 87

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (5, 5)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 20
  • body_learning_rate: (2e-05, 2e-05)
  • head_learning_rate: 2e-05
  • loss: CosineSimilarityLoss
  • distance_metric: cosine_distance
  • margin: 0.25
  • end_to_end: False
  • use_amp: False
  • warmup_proportion: 0.1
  • seed: 42
  • eval_max_steps: -1
  • load_best_model_at_end: False

Training Results

Epoch Step Training Loss Validation Loss
0.0013 1 0.2647 -
0.0667 50 0.1911 -
0.1333 100 0.2146 -
0.2 150 0.1469 -
0.2667 200 0.1151 -
0.3333 250 0.1102 -
0.4 300 0.0334 -
0.4667 350 0.0291 -
0.5333 400 0.0057 -
0.6 450 0.0017 -
0.6667 500 0.0009 -
0.7333 550 0.0013 -
0.8 600 0.0006 -
0.8667 650 0.0005 -
0.9333 700 0.0009 -
1.0 750 0.0005 -
1.0667 800 0.0003 -
1.1333 850 0.0003 -
1.2 900 0.0003 -
1.2667 950 0.0002 -
1.3333 1000 0.0004 -
1.4 1050 0.0003 -
1.4667 1100 0.001 -
1.5333 1150 0.0002 -
1.6 1200 0.0001 -
1.6667 1250 0.0003 -
1.7333 1300 0.0003 -
1.8 1350 0.0002 -
1.8667 1400 0.0003 -
1.9333 1450 0.0002 -
2.0 1500 0.0002 -
2.0667 1550 0.0001 -
2.1333 1600 0.0002 -
2.2 1650 0.0001 -
2.2667 1700 0.0002 -
2.3333 1750 0.0001 -
2.4 1800 0.0001 -
2.4667 1850 0.0003 -
2.5333 1900 0.0001 -
2.6 1950 0.0001 -
2.6667 2000 0.0008 -
2.7333 2050 0.0001 -
2.8 2100 0.0001 -
2.8667 2150 0.0001 -
2.9333 2200 0.0001 -
3.0 2250 0.0002 -
3.0667 2300 0.0002 -
3.1333 2350 0.0001 -
3.2 2400 0.0001 -
3.2667 2450 0.0001 -
3.3333 2500 0.0001 -
3.4 2550 0.0001 -
3.4667 2600 0.0001 -
3.5333 2650 0.0001 -
3.6 2700 0.0001 -
3.6667 2750 0.0001 -
3.7333 2800 0.0001 -
3.8 2850 0.0001 -
3.8667 2900 0.0001 -
3.9333 2950 0.0001 -
4.0 3000 0.0004 -
4.0667 3050 0.0002 -
4.1333 3100 0.0001 -
4.2 3150 0.0001 -
4.2667 3200 0.0001 -
4.3333 3250 0.0001 -
4.4 3300 0.0001 -
4.4667 3350 0.0001 -
4.5333 3400 0.0001 -
4.6 3450 0.0001 -
4.6667 3500 0.0001 -
4.7333 3550 0.0001 -
4.8 3600 0.0001 -
4.8667 3650 0.0001 -
4.9333 3700 0.0001 -
5.0 3750 0.0001 -

Framework Versions

  • Python: 3.10.12
  • SetFit: 1.0.3
  • Sentence Transformers: 2.2.2
  • Transformers: 4.36.1
  • PyTorch: 2.0.1+cu118
  • Datasets: 2.15.0
  • Tokenizers: 0.15.0

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
14
Safetensors
Model size
109M params
Tensor type
F32
·
Inference API
This model can be loaded on Inference API (serverless).

Finetuned from

Dataset used to train teagrjohnson/few_shot_emotions_5epochs-20iter-300trainsize