Swag-multi-class-6 / README.md
HelgeKn's picture
Add SetFit model
467ab7c
metadata
library_name: setfit
tags:
  - setfit
  - sentence-transformers
  - text-classification
  - generated_from_setfit_trainer
metrics:
  - accuracy
widget:
  - text: >-
      Someone comes out of the shack and shoves one of the kids to the ground.
      He
  - text: He approaches the object and reads a plaque on its side. Someone
  - text: >-
      Later at someone's family farm, someone sees the lights on in the hangar.
      Someone
  - text: >-
      Someone stands looking over some of the old photographs as someone goes
      through the mess on the desk. Someone
  - text: Snow blows around a city of towering crystalline structures. A warrior
pipeline_tag: text-classification
inference: true
base_model: sentence-transformers/paraphrase-mpnet-base-v2
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.12786885245901639
            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 SetFitHead 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
4
  • "On the shop floor, his little helper helps himself to an expensive handbag from a display cabinet, then some women's designer shoes, all of which are detailed on a list. He"
  • "He finds someone's records in a box. Someone"
  • 'With a nod, the man hands it over to the defeated boy. Someone'
1
  • 'A lot of people are sitting on terraces in a big field and people is walking in the entrance of a big stadium. men'
  • 'We see a man dunk the ball twice. We'
  • 'Several people use different methods to perform trick shots. They continue performing impressive shots'
6
  • 'A young child is moving back and fourth on a swing while laughing and smiling to the camera. The child'
  • 'The son of Poseidon holds the water at bay on either side of himself. Someone'
  • 'The guy pours product in a container and uses a brush to put the liquid on the surface of a metal object. The guy'
8
  • 'A woman smiles at the camera. The woman'
  • 'A girl is shown several times running on a track. She'
  • 'Someone peers out from the cabin. As she emerges, someone'
2
  • 'As our view retracts through the star map a holographic line sets out from the gunner chair and targets hologram of the planet earth. She'
  • 'Together, they wander a few steps without taking their eyes off of him. Now in the car as someone drives, someone'
  • 'People stand by the wall, laughing. He'
0
  • 'Someone steps outside and opens an umbrella. Someone halts,'
  • 'He shows a water bottle he has along with a brush, and uses the brush to remove snow from the dash window of a car and the water to remove any excess snow left on the windshield. Once finished, he'
  • 'She opens a small metal box on a desk and pushes a button inside. Someone'
5
  • 'Now in the eating quarters, someone faces a husky, larged - nosed cook. The cook'
  • 'She forces a smile, then watches him place his hand on her hand. He caresses her cheek, and she'
  • 'Someone stirs the cookie dough in a bowl. The dough'
3
  • 'A kid in blue shorts is vacuuming the floor. A kid in a red shirt'
  • 'The official extends a red flag. As Master someone'
  • 'The girls flips, then runs, flips and dismounts. The cloud'
7
  • 'She flinches, but quickly composes herself and moves on. The crowd of onlookers'
  • 'He eyes someone with a furrowed brow, then springs up and hurries after her. Someone and someone'
  • 'Now, someone stands below an overcast sky. Strands of his greasy black hair'

Evaluation

Metrics

Label Accuracy
all 0.1279

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("HelgeKn/Swag-multi-class-6")
# Run inference
preds = model("He approaches the object and reads a plaque on its side. Someone")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 6 14.3148 40
Label Training Sample Count
0 6
1 6
2 6
3 6
4 6
5 6
6 6
7 6
8 6

Training Hyperparameters

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

Training Results

Epoch Step Training Loss Validation Loss
0.0074 1 0.303 -
0.3704 50 0.1185 -
0.7407 100 0.0656 -
1.1111 150 0.0179 -
1.4815 200 0.0109 -
1.8519 250 0.0076 -

Framework Versions

  • Python: 3.9.13
  • SetFit: 1.0.1
  • Sentence Transformers: 2.2.2
  • Transformers: 4.36.0
  • PyTorch: 2.1.1+cpu
  • Datasets: 2.15.0
  • Tokenizers: 0.15.0

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