Aurore32's picture
Push model using huggingface_hub.
82884af verified
metadata
base_model: sentence-transformers/paraphrase-mpnet-base-v2
library_name: setfit
metrics:
  - accuracy
pipeline_tag: text-classification
tags:
  - setfit
  - sentence-transformers
  - text-classification
  - generated_from_setfit_trainer
widget:
  - text: >-
      handling washing radiation precaution long leaving scientist tongs source
      effective nature air range row laboratory low experiment keeping sealed
      temperature opening protect
  - text: nucleus proton element charge isotope
  - text: >-
      size mean al time sound tuning frequency every marked last second length
      note directly produced fork number travel
  - text: >-
      distance circle surface stick frequency water dipped correct vertical
      longitudinal three produced statement two amplitude wave
  - text: >-
      rate electromagnetic radiation source correct form stream radioactive
      penetrating detector statement highly
inference: true
model-index:
  - name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
    results:
      - task:
          type: text-classification
          name: Text Classification
        dataset:
          name: Unknown
          type: unknown
          split: test
        metrics:
          - type: accuracy
            value: 0.9387755102040817
            name: Accuracy

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. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

Model Labels

Label Examples
wave
  • 'sound infrared wave ultraviolet transverse list diagram light'
  • 'size mean al time sound tuning frequency every marked last second length note directly produced fork number travel'
  • 'nearby series sound higher frequency air rarefaction correctly pressure amplitude compression row certain lower wave'
forces
  • 'extension diagram spring free load three applied handle'
  • 'different extension spring elastic student proportional length directly object weight diagram cord mass much hung'
  • 'distance plank long ground load force beam mass value'
electricity
  • 'two diagram circuit parallel connected'
  • 'lamp resistance student various thermistor current circuit parallel happen'
  • 'resistance student two shown reading ammeter resistor identical circuit voltmeter determine'
magnetism
  • 'bar suitable two across made magnet metal electromagnet diagram permanent core'
  • 'magnetic student hard magnet rod iron material magnetism correct use statement steel permanent soft make'
  • 'magnetic bar student two hard magnet rod iron material close nickel use steel permanent soft make'
nuclear
  • 'nucleus proton element charge isotope'
  • 'different five'
  • 'rate electromagnetic radiation source correct form stream radioactive penetrating detector statement highly'
thermal
  • 'cooling air top unit stay density transfer correct near thermal move diagram statement refrigerator energy movement'
  • 'dense position air cold warmer heater flask two room fit less hot possible fitted diagram warm throughout um liquid better'
  • 'power balance copper student thermometer heat heater substance watch calculate need specific initially solid mass apparatus block capacity electrical key'

Evaluation

Metrics

Label Accuracy
all 0.9388

Uses

Direct Use for Inference

First install the SetFit library:

pip install setfit

Then you can load this model and run inference.

from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("Aurore32/physics-classifier-model")
# Run inference
preds = model("nucleus proton element charge isotope")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 2 13.375 35
Label Training Sample Count
wave 8
wave 8
magnetism 8
wave 8
magnetism 8
thermal 8
thermal 8
thermal 8
nuclear 8
thermal 8
nuclear 8
electricity 8
nuclear 8
forces 8
wave 8
nuclear 8
forces 8
thermal 8
wave 8
nuclear 8
thermal 8
nuclear 8
thermal 8
thermal 8
thermal 8
electricity 8
electricity 8
thermal 8
forces 8
electricity 8
nuclear 8
thermal 8
magnetism 8
thermal 8
thermal 8
forces 8
wave 8
nuclear 8
nuclear 8
wave 8
thermal 8
magnetism 8
forces 8
magnetism 8
electricity 8
nuclear 8
magnetism 8
wave 8
thermal 8
wave 8
thermal 8
thermal 8
wave 8
magnetism 8
wave 8
nuclear 8
nuclear 8
magnetism 8
electricity 8
wave 8
nuclear 8
electricity 8
magnetism 8
magnetism 8
forces 8
electricity 8
wave 8
nuclear 8
nuclear 8
nuclear 8
electricity 8
thermal 8
wave 8
thermal 8
thermal 8
nuclear 8
wave 8
wave 8
forces 8
wave 8
electricity 8
nuclear 8
wave 8
magnetism 8
wave 8
thermal 8
electricity 8
thermal 8
thermal 8
wave 8
magnetism 8
thermal 8
wave 8
magnetism 8
wave 8
forces 8
nuclear 8
thermal 8
thermal 8
magnetism 8
electricity 8
nuclear 8
magnetism 8
magnetism 8
wave 8
electricity 8
forces 8
magnetism 8
wave 8
magnetism 8
electricity 8
thermal 8
magnetism 8
forces 8
magnetism 8
magnetism 8
magnetism 8
thermal 8
electricity 8
thermal 8
nuclear 8
wave 8
thermal 8
nuclear 8
magnetism 8
wave 8
thermal 8
electricity 8
thermal 8
thermal 8
magnetism 8
thermal 8
magnetism 8
electricity 8
forces 8
nuclear 8
nuclear 8
wave 8
magnetism 8
wave 8
thermal 8
thermal 8
wave 8
nuclear 8
electricity 8
forces 8
wave 8
forces 8
thermal 8
thermal 8
thermal 8
nuclear 8
electricity 8
wave 8
thermal 8
electricity 8
thermal 8
electricity 8
electricity 8
magnetism 8
wave 8
thermal 8
nuclear 8
nuclear 8
magnetism 8
thermal 8
electricity 8
thermal 8
electricity 8
nuclear 8
electricity 8
wave 8
forces 8
nuclear 8
wave 8
nuclear 8
forces 8
thermal 8
forces 8
thermal 8
wave 8
thermal 8
wave 8
thermal 8
forces 8
thermal 8
thermal 8
forces 8
forces 8
wave 8
thermal 8
nuclear 8
magnetism 8
electricity 8
wave 8
forces 8
thermal 8
wave 8
magnetism 8
magnetism 8
wave 8
electricity 8
wave 8
wave 8
electricity 8
magnetism 8
wave 8
electricity 8
forces 8
electricity 8
thermal 8
magnetism 8
nuclear 8
thermal 8
wave 8
wave 8
thermal 8
electricity 8
electricity 8
wave 8
forces 8
thermal 8
thermal 8
thermal 8
wave 8
magnetism 8
thermal 8
electricity 8
magnetism 8
electricity 8
magnetism 8
nuclear 8
electricity 8
electricity 8
wave 8
thermal 8
wave 8
nuclear 8
nuclear 8
wave 8
thermal 8
thermal 8
nuclear 8
electricity 8
magnetism 8
nuclear 8
wave 8
thermal 8
wave 8
thermal 8
nuclear 8
thermal 8
magnetism 8
magnetism 8
electricity 8
thermal 8
thermal 8
wave 8
magnetism 8
nuclear 8
electricity 8
electricity 8
electricity 8
magnetism 8
electricity 8
thermal 8
electricity 8
thermal 8
electricity 8
wave 8
wave 8
wave 8
wave 8
wave 8
wave 8
nuclear 8
wave 8
forces 8
wave 8
electricity 8
forces 8
forces 8
wave 8
thermal 8
thermal 8
thermal 8
wave 8
thermal 8
wave 8
thermal 8
magnetism 8
electricity 8
forces 8
forces 8
thermal 8
magnetism 8
forces 8
magnetism 8
magnetism 8
thermal 8
electricity 8
forces 8
electricity 8
magnetism 8
thermal 8
forces 8
magnetism 8
nuclear 8
nuclear 8
nuclear 8
electricity 8
nuclear 8
wave 8
nuclear 8
magnetism 8
wave 8
thermal 8
wave 8
nuclear 8
nuclear 8
nuclear 8
magnetism 8
electricity 8
magnetism 8
forces 8
wave 8
wave 8
thermal 8
wave 8
wave 8
wave 8
magnetism 8
wave 8
thermal 8
forces 8
magnetism 8
nuclear 8
thermal 8
magnetism 8
magnetism 8
magnetism 8
magnetism 8
thermal 8
thermal 8
electricity 8
wave 8
magnetism 8
thermal 8
magnetism 8
wave 8
forces 8
thermal 8
thermal 8
electricity 8
thermal 8
forces 8
nuclear 8
wave 8
electricity 8
wave 8
wave 8
magnetism 8
electricity 8
wave 8
electricity 8
thermal 8
nuclear 8
wave 8
magnetism 8
thermal 8
wave 8
thermal 8
nuclear 8
thermal 8
wave 8
wave 8
thermal 8
electricity 8
electricity 8
thermal 8
electricity 8
magnetism 8
magnetism 8
thermal 8
electricity 8
magnetism 8
thermal 8
thermal 8
magnetism 8
magnetism 8
wave 8
electricity 8
thermal 8
magnetism 8
nuclear 8
wave 8
wave 8
wave 8
wave 8
wave 8
electricity 8
forces 8
forces 8
electricity 8
magnetism 8
thermal 8
magnetism 8
thermal 8
nuclear 8
thermal 8
magnetism 8
electricity 8
nuclear 8
forces 8
wave 8
thermal 8
wave 8
forces 8
thermal 8
magnetism 8
electricity 8
magnetism 8
wave 8
nuclear 8
wave 8
forces 8
thermal 8
magnetism 8
forces 8
thermal 8
wave 8
magnetism 8
thermal 8
thermal 8
electricity 8
nuclear 8
wave 8
nuclear 8
magnetism 8
magnetism 8
thermal 8
magnetism 8
electricity 8
magnetism 8
magnetism 8
thermal 8
wave 8
nuclear 8
nuclear 8
thermal 8
wave 8
magnetism 8
nuclear 8
nuclear 8
thermal 8
forces 8
wave 8
forces 8
wave 8
nuclear 8
forces 8
wave 8
magnetism 8
nuclear 8
wave 8
magnetism 8
electricity 8
electricity 8
wave 8
nuclear 8
electricity 8
electricity 8
wave 8
wave 8
forces 8
nuclear 8
nuclear 8
magnetism 8
thermal 8
nuclear 8
nuclear 8
thermal 8
wave 8
nuclear 8
forces 8
nuclear 8
thermal 8
magnetism 8
wave 8
nuclear 8
thermal 8
thermal 8
magnetism 8
electricity 8
wave 8
wave 8
electricity 8
wave 8
thermal 8
thermal 8
thermal 8
nuclear 8
forces 8
wave 8
electricity 8
wave 8
forces 8
thermal 8
thermal 8
magnetism 8
wave 8
electricity 8
nuclear 8
thermal 8
thermal 8
thermal 8
thermal 8
thermal 8
electricity 8
nuclear 8
thermal 8
nuclear 8
wave 8
wave 8
forces 8
electricity 8
thermal 8
wave 8
nuclear 8
nuclear 8
thermal 8
wave 8
magnetism 8
nuclear 8
wave 8
nuclear 8
wave 8
wave 8
magnetism 8
nuclear 8
forces 8
magnetism 8
magnetism 8
wave 8
nuclear 8
forces 8
magnetism 8
thermal 8
wave 8
magnetism 8
thermal 8
nuclear 8
wave 8
electricity 8
wave 8
magnetism 8
electricity 8
magnetism 8
thermal 8
forces 8
forces 8
thermal 8
wave 8
electricity 8
wave 8
electricity 8
wave 8
thermal 8
thermal 8
nuclear 8
electricity 8
forces 8
nuclear 8
magnetism 8
magnetism 8
wave 8
nuclear 8
forces 8
wave 8
forces 8
magnetism 8
thermal 8
nuclear 8
thermal 8
electricity 8

Training Hyperparameters

  • batch_size: (16, 2)
  • num_epochs: (1, 16)
  • max_steps: -1
  • sampling_strategy: oversampling
  • body_learning_rate: (2e-05, 1e-05)
  • head_learning_rate: 0.01
  • loss: CosineSimilarityLoss
  • distance_metric: cosine_distance
  • margin: 0.25
  • end_to_end: False
  • use_amp: False
  • warmup_proportion: 0.1
  • l2_weight: 0.01
  • seed: 42
  • eval_max_steps: -1
  • load_best_model_at_end: False

Training Results

Epoch Step Training Loss Validation Loss
0.0083 1 0.1733 -
0.4167 50 0.075 -
0.8333 100 0.0056 -

Framework Versions

  • Python: 3.12.4
  • SetFit: 1.1.1
  • Sentence Transformers: 3.4.0
  • Transformers: 4.44.2
  • PyTorch: 2.5.1+cpu
  • Datasets: 3.2.0
  • Tokenizers: 0.19.1

Citation

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