CoolFace
Modelpublic

SOUMYADEEPSAR/Setfit_random_sample_svm_head

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

SetFit

This is a SetFit model that can be used for Text Classification. A SVC 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: Unknown -->
  • —Classification head: a SVC instance
  • —Maximum Sequence Length: 384 tokens
  • —Number of Classes: 2 classes <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Model Labels

LabelExamples
0<ul><li>'ESG funds often charge many times more for investment funds that are nearly indistinguishable from those without the ESG title.'</li><li>'They are California, Florida, Illinois, Nebraska, New York, and Wyoming.'</li><li>'And so it goes.'</li></ul>
1<ul><li>'Republicans attempted to pass a resolution that would have enabled Congress to force workers to accept a deal, which was fortunately blocked by (who else) Senator Bernie Sanders.'</li><li>'No government ever surrenders power, even its emergency powers—not really.'</li><li>'No citizen in a democratic society should want executives from $10trn financial institutions to play a larger role than they already do in defining and implementing social values.'</li></ul>

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("SOUMYADEEPSAR/Setfit_random_sample_svm_head")
# Run inference
preds = model("What could possibly go wrong?")

<!--

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 count323.415968
LabelTraining Sample Count
0136
178

Training Hyperparameters

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

Training Results

EpochStepTraining LossValidation Loss
0.000310.3597-
0.0161500.2693-
0.03231000.2501-
0.04841500.2691-
0.06452000.063-
0.08062500.0179-
0.09683000.0044-
0.11293500.0003-
0.12904000.0005-
0.14524500.0002-
0.16135000.0003-
0.17745500.0001-
0.19356000.0001-
0.20976500.0001-
0.22587000.0001-
0.24197500.0001-
0.25818000.0-
0.27428500.0001-
0.29039000.0002-
0.30659500.0-
0.322610000.0-
0.338710500.0002-
0.354811000.0-
0.371011500.0001-
0.387112000.0001-
0.403212500.0-
0.419413000.0-
0.435513500.0-
0.451614000.0001-
0.467714500.0-
0.483915000.0-
0.515500.0001-
0.516116000.0001-
0.532316500.0-
0.548417000.0-
0.564517500.0-
0.580618000.0-
0.596818500.0-
0.612919000.0-
0.629019500.0001-
0.645220000.0-
0.661320500.0-
0.677421000.0-
0.693521500.0001-
0.709722000.0-
0.725822500.0-
0.741923000.0001-
0.758123500.0001-
0.774224000.0001-
0.790324500.0-
0.806525000.0-
0.822625500.0-
0.838726000.0-
0.854826500.0001-
0.871027000.0001-
0.887127500.0-
0.903228000.0-
0.919428500.0-
0.935529000.0001-
0.951629500.0-
0.967730000.0001-
0.983930500.0-
1.031000.0-

Framework Versions

  • —Python: 3.10.12
  • —SetFit: 1.0.3
  • —Sentence Transformers: 3.0.1
  • —Transformers: 4.39.0
  • —PyTorch: 2.3.0+cu121
  • —Datasets: 2.20.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. -->