Team Ai
Modelpublic

SOUMYADEEPSAR/Setfit_designed_sample_random_forest_head

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

SetFit

This is a SetFit model that can be used for Text Classification. A RandomForestClassifier 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 RandomForestClassifier 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_random_forest_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.3958-
0.0172500.343-
0.03451000.2775-
0.05171500.2861-
0.06892000.1937-
0.08612500.0891-
0.10343000.0089-
0.12063500.0179-
0.13784000.0002-
0.15514500.0004-
0.17235000.0002-
0.18955500.0001-
0.20686000.0001-
0.22406500.0002-
0.24127000.0001-
0.25847500.0001-
0.27578000.0001-
0.29298500.0001-
0.31019000.0001-
0.32749500.0002-
0.344610000.0-
0.361810500.0001-
0.379011000.0001-
0.396311500.0001-
0.413512000.0001-
0.430712500.0001-
0.448013000.0001-
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.0-
0.672019500.0-
0.689220000.0-
0.706420500.0-
0.723621000.0-
0.740921500.0-
0.758122000.0-
0.775322500.0-
0.792623000.0001-
0.809823500.0001-
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. -->