Edit model card

SetFit with BAAI/bge-small-en-v1.5

This is a SetFit model that can be used for Text Classification. This SetFit model uses BAAI/bge-small-en-v1.5 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
not_minor
  • 'A young manager in her very first leadership position.'
  • 'A detail-oriented student who excels in organizing group study sessions in the library'
  • 'A fellow student involved in a book club who prefers physical copies for annotation and discussion'
minor
  • 'A teenage girl from a disadvantaged background who is empowered by the health education programs'
  • "A young child from a diverse family background who is involved in the candidate's research studies"
  • 'A child with a passion for music who learns best through creative and interactive activities'

Evaluation

Metrics

Label Accuracy
all 0.96

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("A cartoonist specializing in educational materials")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 3 14.34 26
Label Training Sample Count
not_minor 100
minor 100

Training Hyperparameters

  • batch_size: (64, 64)
  • num_epochs: (4, 4)
  • 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: True

Training Results

Epoch Step Training Loss Validation Loss
0.0032 1 0.2636 -
0.1582 50 0.2471 -
0.3165 100 0.2067 -
0.4747 150 0.0207 -
0.6329 200 0.0021 -
0.7911 250 0.0015 -
0.9494 300 0.0013 -
1.0 316 - 0.0825
1.1076 350 0.0011 -
1.2658 400 0.001 -
1.4241 450 0.0009 -
1.5823 500 0.0008 -
1.7405 550 0.0008 -
1.8987 600 0.0007 -
2.0 632 - 0.0813
2.0570 650 0.001 -
2.2152 700 0.0007 -
2.3734 750 0.0007 -
2.5316 800 0.0006 -
2.6899 850 0.0006 -
2.8481 900 0.0006 -
3.0 948 - 0.0736
3.0063 950 0.0006 -
3.1646 1000 0.0006 -
3.3228 1050 0.0005 -
3.4810 1100 0.0006 -
3.6392 1150 0.0005 -
3.7975 1200 0.0006 -
3.9557 1250 0.0005 -
4.0 1264 - 0.0754

Framework Versions

  • Python: 3.12.4
  • SetFit: 1.1.0
  • Sentence Transformers: 3.2.1
  • Transformers: 4.45.2
  • PyTorch: 2.5.1
  • Datasets: 3.1.0
  • Tokenizers: 0.20.3

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
23
Safetensors
Model size
33.4M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for ychen/minor-persona-detection-en

Finetuned
(107)
this model

Evaluation results