CoolFace
Modelpublic

richie-ghost/setfit-mental-bert-base-uncased-MH-Topic-Check

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

SetFit with mental/mental-bert-base-uncased

This is a SetFit model that can be used for Text Classification. This SetFit model uses mental/mental-bert-base-uncased 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 Type: SetFit
  • Sentence Transformer body: mental/mental-bert-base-uncased
  • 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
True<ul><li>'I have so many issues to address. I have a history of sexual abuse, I’m a breast cancer survivor and I am a lifetime insomniac. I have a long history of depression and I’m beginning to have anxiety. I have low self esteem but I’ve been happily married for almost 35 years.\n I’ve never had counseling about any of this. Do I have too many issues to address in counseling?'</li><li>'I have so many issues to address. I have a history of sexual abuse, I’m a breast cancer survivor and I am a lifetime insomniac. I have a long history of depression and I’m beginning to have anxiety. I have low self esteem but I’ve been happily married for almost 35 years.\n I’ve never had counseling about any of this. Do I have too many issues to address in counseling?'</li><li>'Experiencing extreme mood swings not related to external circumstances.'</li></ul>
False<ul><li>'Guide to learning a new language'</li><li>'Learning about the historical significance of the Silk Road.'</li><li>'Exploring historical landmarks in Europe'</li></ul>

Evaluation

Metrics

LabelAccuracy
all0.9882

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("richie-ghost/setfit-mental-bert-base-uncased-MH-Topic-Check")
# Run inference
preds = model("Planning a DIY home renovation project.")

<!--

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 count433.7092111
LabelTraining Sample Count
True138
False58

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (3, 3)
  • max_steps: -1
  • sampling_strategy: oversampling
  • 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.2132-
0.0354500.1508-
0.07081000.0193-
0.10621500.0075-
0.14152000.0025-
0.17692500.0009-
0.21233000.0003-
0.24773500.0005-
0.28314000.0004-
0.31854500.0004-
0.35395000.0002-
0.38925500.0004-
0.42466000.0001-
0.46006500.0003-
0.49547000.0001-
0.53087500.0001-
0.56628000.0001-
0.60168500.0002-
0.63699000.0001-
0.67239500.0001-
0.707710000.0001-
0.743110500.0-
0.778511000.0001-
0.813911500.0001-
0.849312000.0001-
0.884612500.0001-
0.920013000.0001-
0.955413500.0001-
0.990814000.0001-
1.01413-0.017
1.026214500.0001-
1.061615000.0001-
1.097015500.0-
1.132316000.0001-
1.167716500.0001-
1.203117000.0001-
1.238517500.0-
1.273918000.0001-
1.309318500.0-
1.344719000.0-
1.380019500.0-
1.415420000.0-
1.450820500.0-
1.486221000.0-
1.521621500.0-
1.557022000.0-
1.592422500.0-
1.627723000.0-
1.663123500.0-
1.698524000.0-
1.733924500.0-
1.769325000.0-
1.804725500.0-
1.840126000.0-
1.875426500.0-
1.910827000.0001-
1.946227500.0-
1.981628000.0-
2.02826-0.018
2.017028500.0-
2.052429000.0-
2.087829500.0-
2.123130000.0-
2.158530500.0-
2.193931000.0-
2.229331500.0-
2.264732000.0-
2.300132500.0-
2.335533000.0-
2.370833500.0-
2.406234000.0-
2.441634500.0-
2.477035000.0-
2.512435500.0-
2.547836000.0-
2.583236500.0-
2.618537000.0-
2.653937500.0-
2.689338000.0-
2.724738500.0-
2.760139000.0-
2.795539500.0-
2.830940000.0-
2.866240500.0001-
2.901641000.0-
2.937041500.0-
2.972442000.0001-
3.04239-0.0182
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.10.12
  • SetFit: 1.0.3
  • Sentence Transformers: 2.7.0
  • Transformers: 4.40.0
  • PyTorch: 2.2.1+cu121
  • Datasets: 2.19.0
  • Tokenizers: 0.19.1

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