You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

SetFit with BAAI/bge-m3

This is a SetFit model that can be used for Text Classification. This SetFit model uses BAAI/bge-m3 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 Type: SetFit
  • Sentence Transformer body: BAAI/bge-m3
  • Classification head: a LogisticRegression instance
  • Maximum Sequence Length: 8192 tokens
  • Number of Classes: 2 classes

Model Sources

Model Labels

Label Examples
Flood related topic
  • 'National Hurricane Center tracker map shows exact times Storm Idalia will hit Florida'
  • 'Flood defence boost for Hull as £42m upgrade reaches important milestone'
  • 'Parts of the Caribbean braced for arrival of Tropical Storm Bret'
No flood related topic
  • 'Disasters most likely to affect our household are – Talk Vietnam'
  • 'Dog runs away from owner to sneak into Pets at Home store because he loves the guinea pigs'
  • 'What PM Modi has figured out that Donald Trump never has'

Evaluation

Metrics

Label F1
all 0.9266

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("setfit_model_id")
# Run inference
preds = model("Elbpegel in Dresden steigt wieder")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 5 11.375 18
Label Training Sample Count
Flood related topic 16
No flood related topic 16

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (2, 2)
  • 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.0294 1 0.3099 -
1.4706 50 0.0867 -

Framework Versions

  • Python: 3.13.5
  • SetFit: 1.1.3
  • Sentence Transformers: 5.6.0
  • Transformers: 4.56.1
  • PyTorch: 2.8.0
  • Datasets: 5.0.0
  • Tokenizers: 0.22.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}
}
Downloads last month
4
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ValkB/bge-m3_flood_title_classification

Base model

BAAI/bge-m3
Finetuned
(605)
this model

Paper for ValkB/bge-m3_flood_title_classification

Evaluation results