CoolFace
Modelpublic

konsman/setfit-messages-generated-test

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes11downloads
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
2<ul><li>'Rapid onset of confusion and weakness, urgent evaluation needed.'</li><li>'Unconscious patient found, immediate medical response required.'</li><li>'Urgent: Suspected heart attack, immediate medical attention required.'</li></ul>
1<ul><li>'Reminder: Your dental check-up is scheduled for Monday, February 05.'</li><li>'Reminder: Your dental check-up is scheduled for Saturday, February 24.'</li><li>'Nutritionist appointment reminder for Sunday, January 21.'</li></ul>
0<ul><li>'Could you verify your lifestyle contact details in our records?'</li><li>'Kindly update your emergency contact list at your earliest convenience.'</li><li>'We request you to update your wellness information for our records.'</li></ul>

Evaluation

Metrics

LabelAccuracy
all0.85

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("konsman/setfit-messages-generated-test")
# Run inference
preds = model("Sudden severe chest pain, suspecting a cardiac emergency.")

<!--

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 count710.12512
LabelTraining Sample Count
016
116
216

Training Hyperparameters

  • batch_size: (8, 8)
  • num_epochs: (2, 2)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 40
  • bodylearningrate: (2.2041595048800003e-05, 2.2041595048800003e-05)
  • headlearningrate: 2.2041595048800003e-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.002110.2841-
0.1042500.0603-
0.20831000.0017-
0.31251500.0003-
0.41672000.0004-
0.52082500.0003-
0.6253000.0003-
0.72923500.0002-
0.83334000.0003-
0.93754500.0001-
1.04175000.0002-
1.14585500.0003-
1.256000.0002-
1.35426500.0002-
1.45837000.0001-
1.56257500.0002-
1.66678000.0001-
1.77088500.0001-
1.8759000.0001-
1.97929500.0002-

Framework Versions

  • Python: 3.10.12
  • SetFit: 1.0.3
  • 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. -->