CoolFace
Modelpublic

subham18/setfit-paraphrase-mpnet-base-v2-twitter-sentiment-cleaned-73

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes6downloads
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
neutral<ul><li>'ordered my new shirt'</li><li>'Yay got the Internet on my itouch working'</li><li>'Getting ready for work and the sun is shining plus its the w e Bgt tonight what am I gon na do after its finished '</li></ul>
positive<ul><li>'Finally home after a night of dinner and drinking with friends Going to sleep now hoping the bed doesnt spin too much '</li><li>' Thank you I love my tattoos they are all very special to me My feet ones are beautiful '</li><li>'Day is going well so far Meeting until four though '</li></ul>
negative<ul><li>' Oh final msg Why didnt you review my boardgame BookchaseA AA12 when you were on telly We didnt even get a nice letter '</li><li>'have to wear my glasses today cos my right eye is swollen and i dont know why'</li><li>' how crappy for him'</li></ul>

Evaluation

Metrics

LabelAccuracy
all0.7301

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("subham18/setfit-paraphrase-mpnet-base-v2-twitter-sentiment-cleaned-73")
# Run inference
preds = model("I still miss him And i do nt think hes coming back")

<!--

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 count213.931
LabelTraining Sample Count
Negative0
Positive0
Neutral0

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.001110.3222-
0.0533500.223-
0.10661000.2817-
0.15991500.1102-
0.21322000.1271-
0.26652500.0307-
0.31983000.0013-
0.37313500.0006-
0.42644000.0006-
0.47974500.0004-
0.53305000.0006-
0.58645500.0002-
0.63976000.0003-
0.69306500.0002-
0.74637000.0002-
0.79967500.0002-
0.85298000.0002-
0.90628500.0002-
0.95959000.0005-
1.0938-0.2816
1.01289500.0001-
1.066110000.0027-
1.119410500.0002-
1.172711000.0002-
1.226011500.0001-
1.279312000.0003-
1.332612500.0001-
1.385913000.0002-
1.439213500.0001-
1.492514000.0001-
1.545814500.0001-
1.599115000.0001-
1.652515500.0001-
1.705816000.0001-
1.759116500.0001-
1.812417000.0001-
1.865717500.0002-
1.919018000.0001-
1.972318500.0001-
2.01876-0.2846
2.025619000.0001-
2.078919500.0001-
2.132220000.0001-
2.185520500.0001-
2.238821000.0001-
2.292121500.0001-
2.345422000.0002-
2.398722500.0001-
2.452023000.0001-
2.505323500.0001-
2.558624000.0001-
2.611924500.0007-
2.665225000.0001-
2.718625500.0001-
2.771926000.0002-
2.825226500.0001-
2.878527000.0001-
2.931827500.0001-
2.985128000.0001-
3.02814-0.2843
3.038428500.0001-
3.091729000.0001-
3.145029500.0001-
3.198330000.0001-
3.251630500.0002-
3.304931000.0001-
3.358231500.0001-
3.411532000.0001-
3.464832500.0001-
3.518133000.0-
3.571433500.0001-
3.624734000.0-
3.678034500.0-
3.731335000.0001-
3.784635500.0001-
3.838036000.0002-
3.891336500.0001-
3.944637000.0002-
3.997937500.0-
4.03752-0.2861
  • —The bold row denotes the saved checkpoint.

Framework Versions

  • —Python: 3.12.3
  • —SetFit: 1.0.3
  • —Sentence Transformers: 3.0.1
  • —Transformers: 4.39.0
  • —PyTorch: 2.4.0+cu121
  • —Datasets: 2.21.0
  • —Tokenizers: 0.15.2

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