Team Ai
Modelpublic

SOUMYADEEPSAR/Setfit_designed_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
1<ul><li>'Gone are the days when they led the world in recession-busting'</li><li>'Who so mean that he will not himself be taxed, who so mindful of wealth that he will not favor increasing the popular taxes, in aid of these defective children?'</li><li>'That state has sixty-two counties and sixty cities … In addition there are 932 towns, 507 villages, and, at the last count, 9,600 school districts … Just try to render efficient service … amid the diffused identities and inevitable jealousies of, roughly, 11,000 independent administrative officers or boards!'</li></ul>
0<ul><li>'Is this a warning of what’s to come?'</li><li>'This unique set of circumstances has brought PCL back into focus as the safe haven of choice for global players seeking somewhere to stash their cash.'</li><li>'Socialists believe that, if everyone cannot have something, no one shall.'</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_designed_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 count336.532797
LabelTraining Sample Count
0100
1114

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-
0.000310.326-
0.0172500.2514-
0.03451000.434-
0.05171500.1265-
0.06892000.125-
0.08612500.2375-
0.10343000.0014-
0.12063500.1192-
0.13784000.0166-
0.15514500.0002-
0.17235000.0001-
0.18955500.0-
0.20686000.0-
0.22406500.0001-
0.24127000.0-
0.25847500.0-
0.27578000.0-
0.29298500.0-
0.31019000.0-
0.32749500.0001-
0.344610000.0-
0.361810500.0001-
0.379011000.0-
0.396311500.0001-
0.413512000.0-
0.430712500.0001-
0.448013000.0-
0.465213500.0-
0.482414000.0-
0.499714500.0-
0.516915000.0-
0.534115500.0001-
0.551316000.0-
0.568616500.0-
0.585817000.0-
0.603017500.0-
0.620318000.0-
0.637518500.0-
0.654719000.0001-
0.672019500.0001-
0.689220000.0-
0.706420500.0-
0.723621000.0-
0.740921500.0-
0.758122000.0-
0.775322500.0-
0.792623000.0-
0.809823500.0-
0.827024000.0-
0.844224500.0001-
0.861525000.0-
0.878725500.0-
0.895926000.0-
0.913226500.0-
0.930427000.0-
0.947627500.0-
0.964928000.0-
0.982128500.0-
0.999329000.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. -->