SetFit with google/embeddinggemma-300m

This is a SetFit model that can be used for Text Classification. This SetFit model uses google/embeddinggemma-300m 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
neutral
  • 'in this context, canadian authorities are co-operating closely to monitor the financial situation of the household sector, and are responding appropriately.'
  • 'in contrast to the united states, canada’s economy continues to operate with material excess capacity.'
  • 'the july projection also incorporates the estimated impact of tariffs on steel and aluminum recently imposed by the united states, as well as the countermeasures enacted by canada.'
dovish
  • 'in the face of strong global demand for goods, pandemic-related disruptions to production and transportation are constraining growth.'
  • 'business investment in the energy-producing sector will decline.'
  • 'as higher interest rates continue to work their way through the economy, the bank expects economic growth to slow, averaging around 1% through the second half of this year and the first half of next year.'
hawkish
  • 'over the next few months, inflation is expected to rise temporarily to around the top of the 1-3 percent inflation-control range.'
  • 'the three main upside risks relate to the possibility of stronger-than-expected inflationary pressures in the global economy, stronger momentum in canadian household spending, and the possibility of a faster-than-expected rebound in business and consumer confidence, due to more decisive policy action in the major advanced economies.'
  • 'moreover, with three-month rates of core inflation running around 3½-4% since last september, underlying price pressures appear to be more persistent than anticipated.'
irrelevant
  • 'the situation calls for special actions by the central bank.'
  • 'canada has not been immune to these developments.'
  • 'both of these programs will be put in place in the coming weeks.'

Evaluation

Metrics

Label Accuracy
all 0.9892

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("beethogedeon/stance-boc-google-embed-300m")
# Run inference
preds = model("these factors are weighing on growth in many emerging markets and some other economies.")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 4 21.0398 57
Label Training Sample Count
dovish 288
hawkish 249
irrelevant 12
neutral 432

Training Hyperparameters

  • batch_size: (16, 2)
  • num_epochs: (1, 16)
  • max_steps: 500
  • 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.002 1 0.2742 -
0.1 50 0.2427 -
0.2 100 0.2168 -
0.3 150 0.1799 -
0.4 200 0.1462 -
0.5 250 0.1066 -
0.6 300 0.0723 -
0.7 350 0.0435 -
0.8 400 0.029 -
0.9 450 0.0196 -
1.0 500 0.0101 -

Framework Versions

  • Python: 3.12.12
  • SetFit: 1.1.3
  • Sentence Transformers: 5.2.0
  • Transformers: 4.57.3
  • PyTorch: 2.9.0+cu126
  • Datasets: 4.0.0
  • Tokenizers: 0.22.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}
}
Downloads last month
3
Safetensors
Model size
0.3B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for beethogedeon/stance-boc-google-embed-300m

Finetuned
(171)
this model

Paper for beethogedeon/stance-boc-google-embed-300m

Evaluation results