CoolFace
Modelpublic

anismahmahi/appeal-to-authority-setfit-model

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes9downloads
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
0<ul><li>'“They know this is one of the great scandals in the history of our country because basically what they did is, they used [former Trump campaign aide] Carter Page, who nobody even knew, who I feel very badly for, I think he’s been treated very badly.\n'</li><li>'The Guardian did not make a mistake in vilifying Assange without a shred of evidence.\n'</li><li>'He himself said: “No one defends Islam like Arab Christians.” It is to defend Islam that Western clerics do not raise their voice against such acts of brutality.\n'</li></ul>
1<ul><li>'As the political scientist Richard Neustadt said, political elites are constantly evaluating and re-evaluating the president.\n'</li><li>'“I can tell you 100% this is not that kind of guy,” said Rick, adding that he would see Paddock every other day and that the two would go to a local bar and play slot machines.\n'</li><li>'Now, new information released by investigative reporter Laura Loomer proves that authorities have directly lied to the American people about the case at least once by claiming that supposed shooter Stephen Paddock checked into the Mandalay Bay Hotel on September 28th when valet records (with photos) prove he actually arrived three days earlier.\n'</li></ul>

Evaluation

Metrics

LabelF1
all0.2237

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/appeal-to-authority-setfit-model")
# Run inference
preds = model("Ganesh makes wild leaps and inferences.
")

<!--

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 count228.8867111
LabelTraining Sample Count
0452
1113

Training Hyperparameters

  • —batch_size: (16, 16)
  • —num_epochs: (2, 2)
  • —max_steps: -1
  • —sampling_strategy: oversampling
  • —num_iterations: 20
  • —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.000710.3148-
0.0354500.2792-
0.07081000.1707-
0.10621500.1197-
0.14152000.0768-
0.17692500.0406-
0.21233000.0053-
0.24773500.0571-
0.28314000.0324-
0.31854500.001-
0.35395000.077-
0.38925500.0002-
0.42466000.0011-
0.46006500.003-
0.49547000.0004-
0.53087500.0004-
0.56628000.0006-
0.60168500.0002-
0.63699000.0002-
0.67239500.0003-
0.707710000.0116-
0.743110500.0059-
0.778511000.0002-
0.813911500.0001-
0.849312000.0001-
0.884612500.0003-
0.920013000.0001-
0.955413500.0-
0.990814000.0125-
1.01413-0.2868
1.026214500.0003-
1.061615000.0002-
1.097015500.0001-
1.132316000.0002-
1.167716500.0001-
1.203117000.0001-
1.238517500.0038-
1.273918000.0001-
1.309318500.0065-
1.344719000.0002-
1.380019500.0002-
1.415420000.0197-
1.450820500.0061-
1.486221000.0001-
1.521621500.0-
1.557022000.0321-
1.592422500.0002-
1.627723000.0331-
1.663123500.0069-
1.698524000.0001-
1.733924500.0-
1.769325000.0-
1.804725500.0337-
1.840126000.0347-
1.875426500.0612-
1.910827000.0398-
1.946227500.0001-
1.981628000.0001-
2.02826-0.2926
  • —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. -->