CoolFace
Modelpublic

anismahmahi/G1-setfit-model

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes6downloads
Model Card

SetFit

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

Model Sources

Model Labels

LabelExamples
0.0<ul><li>'A Jewish student at McGill University has been kicked off the student government board for having “conflicts of interest” due to his pro-Israel activism.\n'</li><li>'How else to describe the decision by Big Brother USA and junior sidekick South Korea to stage major air force exercises on North Korea’s border.\n'</li><li>'DB: It was hysterical to watch these four armed guards who kept shouting “Stop resisting, stop resisting!” and they are beating the hell out of him!\n'</li></ul>
1.0<ul><li>'The UK should never become a stage for inflammatory speakers who promote hate."\n'</li><li>'In a nation guided by fairness and law, a person is innocent until proven guilty.\n'</li><li>'Speaking of Mastercard, the David Horowitz Freedom Center just recently won a major battle with the credit card, defeating well-financed leftwing groups that are trying to run the Center out of business and suffocate free speech in America.\n'</li></ul>

Evaluation

Metrics

LabelF1
all0.7514

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("anismahmahi/G1-setfit-model")
# Run inference
preds = model("Are you people serious?
")

<!--

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 count126.2775129
LabelTraining Sample Count
03919
1240

Training Hyperparameters

  • —batch_size: (16, 16)
  • —num_epochs: (2, 2)
  • —max_steps: -1
  • —sampling_strategy: oversampling
  • —num_iterations: 5
  • —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.000410.3542-
0.0192500.2957-
0.03851000.2509-
0.05771500.1691-
0.07692000.2145-
0.09622500.0861-
0.11543000.0677-
0.13463500.0554-
0.15384000.0169-
0.17314500.0621-
0.19235000.0024-
0.21155500.0405-
0.23086000.0724-
0.256500.0557-
0.26927000.0007-
0.28857500.0011-
0.30778000.0005-
0.32698500.0103-
0.34629000.0618-
0.36549500.0003-
0.384610000.0046-
0.403810500.0006-
0.423111000.0003-
0.442311500.0004-
0.461512000.0006-
0.480812500.0002-
0.513000.0001-
0.519213500.0002-
0.538514000.0003-
0.557714500.0002-
0.576915000.0002-
0.596215500.0003-
0.615416000.0001-
0.634616500.0067-
0.653817000.0003-
0.673117500.0001-
0.692318000.0003-
0.711518500.0001-
0.730819000.0001-
0.7519500.0006-
0.769220000.0001-
0.788520500.0001-
0.807721000.0-
0.826921500.0-
0.846222000.0-
0.865422500.0-
0.884623000.0002-
0.903823500.0001-
0.923124000.0001-
0.942324500.0003-
0.961525000.0001-
0.980825500.0005-
1.026000.00.1875
1.019226500.0-
1.038527000.0003-
1.057727500.0-
1.076928000.0001-
1.096228500.0472-
1.115429000.0-
1.134629500.0-
1.153830000.0001-
1.173130500.0001-
1.192331000.0-
1.211531500.0003-
1.230832000.0-
1.2532500.0-
1.269233000.0245-
1.288533500.0-
1.307734000.0-
1.326934500.0-
1.346235000.0001-
1.365435500.0-
1.384636000.0-
1.403836500.0-
1.423137000.0-
1.442337500.0-
1.461538000.0-
1.480838500.0-
1.539000.0-
1.519239500.0-
1.538540000.0-
1.557740500.0-
1.576941000.0-
1.596241500.0-
1.615442000.0-
1.634642500.0001-
1.653843000.0-
1.673143500.0-
1.692344000.0-
1.711544500.0-
1.730845000.0-
1.7545500.0-
1.769246000.0-
1.788546500.0-
1.807747000.0-
1.826947500.0-
1.846248000.0001-
1.865448500.0-
1.884649000.0-
1.903849500.0-
1.923150000.0-
1.942350500.0-
1.961551000.0-
1.980851500.0-
2.052000.00.1393
  • —The bold row denotes the saved checkpoint.

Framework Versions

  • —Python: 3.10.12
  • —SetFit: 1.0.1
  • —Sentence Transformers: 2.2.2
  • —Transformers: 4.35.2
  • —PyTorch: 2.1.0+cu121
  • —Datasets: 2.16.1
  • —Tokenizers: 0.15.0

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