CoolFace
Modelpublic

MiguelRod/SetFit-Chemical-Biomaterials-Classifier

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes5downloads
Model Card

SetFit with cambridgeltl/SapBERT-from-PubMedBERT-fulltext

This is a SetFit model that can be used for Text Classification. This SetFit model uses cambridgeltl/SapBERT-from-PubMedBERT-fulltext as the Sentence Transformer embedding model. A MultiOutputClassifier 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: cambridgeltl/SapBERT-from-PubMedBERT-fulltext
  • Classification head: a MultiOutputClassifier instance
  • Maximum Sequence Length: 512 tokens <!-- - Number of Classes: Unknown --> <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Evaluation

Metrics

LabelAccuracy
all0.1757

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("setfit_model_id")
# Run inference
preds = model("caspases")

<!--

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

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (3, 3)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 15
  • bodylearningrate: (2e-05, 2e-05)
  • headlearningrate: 2e-05
  • loss: CosineSimilarityLoss
  • distancemetric: cosinedistance
  • margin: 0.25
  • endtoend: False
  • use_amp: False
  • warmup_proportion: 0.1
  • l2_weight: 0.01
  • seed: 42
  • evalmaxsteps: -1
  • loadbestmodelatend: False

Training Results

EpochStepTraining LossValidation Loss
0.000910.2361-
0.0463500.2377-
0.09271000.2269-
0.13901500.2104-
0.18542000.1871-
0.23172500.1437-
0.27803000.1322-
0.32443500.1365-
0.37074000.1155-
0.41714500.1144-
0.46345000.1068-
0.50975500.1011-
0.55616000.095-
0.60246500.0933-
0.64877000.1063-
0.69517500.0999-
0.74148000.0823-
0.78788500.0877-
0.83419000.0767-
0.88049500.0849-
0.926810000.0796-
0.973110500.0877-
1.019511000.0759-
1.065811500.0705-
1.112112000.0728-
1.158512500.0738-
1.204813000.0767-
1.251213500.0692-
1.297514000.0697-
1.343814500.0639-
1.390215000.0729-
1.436515500.0759-
1.482916000.0786-
1.529216500.0618-
1.575517000.0722-
1.621917500.0719-
1.668218000.072-
1.714618500.0654-
1.760919000.0683-
1.807219500.0654-
1.853620000.0679-
1.899920500.0643-
1.946221000.0662-
1.992621500.0642-
2.038922000.0812-
2.085322500.068-
2.131623000.0583-
2.177923500.0627-
2.224324000.0654-
2.270624500.0571-
2.317025000.0623-
2.363325500.0639-
2.409626000.059-
2.456026500.0637-
2.502327000.0675-
2.548727500.0696-
2.595028000.0669-
2.641328500.0633-
2.687729000.0606-
2.734029500.0609-
2.780430000.054-
2.826730500.0598-
2.873031000.0597-
2.919431500.0618-
2.965732000.065-

Framework Versions

  • Python: 3.10.12
  • SetFit: 1.1.0
  • Sentence Transformers: 3.1.1
  • Transformers: 4.39.0
  • PyTorch: 2.4.1+cu121
  • Datasets: 3.0.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. -->