CoolFace
Modelpublic

w11wo/bge-small-en-v1.5-isarcasm

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes13downloads
Model Card

SetFit with BAAI/bge-small-en-v1.5

This is a SetFit model that can be used for Text Classification. This SetFit model uses BAAI/bge-small-en-v1.5 as the Sentence Transformer embedding model. A SetFitHead 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 Type: SetFit
  • —Sentence Transformer body: BAAI/bge-small-en-v1.5
  • —Classification head: a SetFitHead instance
  • —Maximum Sequence Length: 512 tokens
  • —Number of Classes: 2 classes <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Model Labels

LabelExamples
NON_SARCASTIC<ul><li>'so the newer devices have the ios screenshot i m still on ios but my ipad mini 1 st gen shows the ios screenshot . odd .'</li><li>'why do amazon need a test authorisation when i add a new payment card , as well as the authorisation they get when i actually use it ?'</li><li>'waterboarding sounds like a lot of fun until you find out what it is'</li></ul>
SARCASTIC<ul><li>"have you been reading long ? you are not very good at it . it has nothing to do with who i like , especially since i am not a fan of corbyn anyway . it ' s that in one case someone was literally slapped in the face , and in the other someone wore a milkshake . battery > being annoying"</li><li>'wish one of the many people dressed as killers were actually one n killed me'</li><li>'is it even christmas if there isn t a fight with neighbours and a broken wrist ?'</li></ul>

Evaluation

Metrics

LabelAccuracyF1PrecisionRecall
all0.66180.39520.28910.6242

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("w11wo/bge-small-en-v1.5-isarcasm")
# Run inference
preds = model("last day in my twenties")

<!--

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 count219.848963
LabelTraining Sample Count
NON_SARCASTIC609
SARCASTIC609

Training Hyperparameters

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

Training Results

EpochStepTraining LossValidation Loss
0.000310.2571-
0.0172500.251-
0.03441000.2556-
0.05171500.2513-
0.06892000.2531-
0.08612500.2518-
0.10333000.2553-
0.12063500.2501-
0.13784000.2546-
0.15504500.2506-
0.17225000.2317-
0.18955500.093-
0.20676000.0139-
0.22396500.0166-
0.24117000.0053-
0.25847500.0013-
0.27568000.0121-
0.29288500.0096-
0.31009000.0043-
0.32729500.0014-
0.344510000.0009-
0.361710500.0117-
0.378911000.0144-
0.396111500.0084-
0.413412000.0006-
0.430612500.0005-
0.447813000.0081-
0.465013500.0144-
0.482314000.0045-
0.499514500.0042-
0.516715000.0005-
0.533915500.003-
0.551216000.0004-
0.568416500.0005-
0.585617000.0004-
0.602817500.0004-
0.620018000.0026-
0.637318500.0004-
0.654519000.0004-
0.671719500.0003-
0.688920000.0014-
0.706220500.0004-
0.723421000.0003-
0.740621500.0003-
0.757822000.0004-
0.775122500.0003-
0.792323000.0003-
0.809523500.0003-
0.826724000.0003-
0.844024500.0003-
0.861225000.0003-
0.878425500.0003-
0.895626000.0003-
0.912826500.0003-
0.930127000.0003-
0.947327500.0004-
0.964528000.0003-
0.981728500.0003-
0.999029000.0036-
1.016229500.0003-
1.033430000.0003-
1.050630500.0002-
1.067931000.0002-
1.085131500.0002-
1.102332000.0002-
1.119532500.0002-
1.136833000.0003-
1.154033500.0004-
1.171234000.0002-
1.188434500.0002-
1.205635000.0002-
1.222935500.0002-
1.240136000.0002-
1.257336500.0009-
1.274537000.0002-
1.291837500.0002-
1.309038000.0002-
1.326238500.0002-
1.343439000.0002-
1.360739500.0002-
1.377940000.0002-
1.395140500.0002-
1.412341000.0002-
1.429641500.0002-
1.446842000.0003-
1.464042500.0002-
1.481243000.0002-
1.498443500.0002-
1.515744000.0002-
1.532944500.0002-
1.550145000.0002-
1.567345500.0002-
1.584646000.0002-
1.601846500.0002-
1.619047000.0002-
1.636247500.0002-
1.653548000.0002-
1.670748500.0002-
1.687949000.0002-
1.705149500.0002-
1.722450000.0003-
1.739650500.0002-
1.756851000.0002-
1.774051500.0002-
1.791352000.0002-
1.808552500.0002-
1.825753000.0038-
1.842953500.0002-
1.860154000.0002-
1.877454500.0002-
1.894655000.0002-
1.911855500.0002-
1.929056000.0005-
1.946356500.0002-
1.963557000.0002-
1.980757500.0002-
1.997958000.0002-
2.015258500.0001-
2.032459000.0002-
2.049659500.0002-
2.066860000.0002-
2.084160500.0002-
2.101361000.0002-
2.118561500.0002-
2.135762000.0001-
2.152962500.0002-
2.170263000.0002-
2.187463500.0001-
2.204664000.0001-
2.221864500.0001-
2.239165000.0001-
2.256365500.0001-
2.273566000.0001-
2.290766500.0001-
2.308067000.0001-
2.325267500.0001-
2.342468000.0001-
2.359668500.0001-
2.376969000.0001-
2.394169500.0001-
2.411370000.0001-
2.428570500.0001-
2.445771000.0001-
2.463071500.0001-
2.480272000.0001-
2.497472500.0001-
2.514673000.0001-
2.531973500.0001-
2.549174000.0001-
2.566374500.0001-
2.583575000.0001-
2.600875500.0001-
2.618076000.0001-
2.635276500.0001-
2.652477000.0001-
2.669777500.0001-
2.686978000.0001-
2.704178500.0001-
2.721379000.0001-
2.738579500.0001-
2.755880000.0001-
2.773080500.0001-
2.790281000.0001-
2.807481500.0001-
2.824782000.0001-
2.841982500.0001-
2.859183000.0001-
2.876383500.0001-
2.893684000.0001-
2.910884500.0001-
2.928085000.0001-
2.945285500.0001-
2.962586000.0001-
2.979786500.0001-
2.996987000.0001-

Framework Versions

  • —Python: 3.10.12
  • —SetFit: 1.0.1
  • —Sentence Transformers: 2.2.2
  • —Transformers: 4.32.0
  • —PyTorch: 2.1.1+cu121
  • —Datasets: 2.14.5
  • —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. -->