SetFit with microsoft/harrier-oss-v1-0.6b

This is a SetFit model that can be used for Text Classification. This SetFit model uses microsoft/harrier-oss-v1-0.6b 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
negative
  • 'North Korea on Tuesday test-fired multiple missiles toward its eastern waters.'
  • 'If the meteorite was as large as it seems to have been, we can compare it to the Hiroshima bomb.'
  • 'China Joins Race to Mine Moon for Resources'
positive
  • 'The spokesperson continued: “We call on the DPRK and Russia to cease unlawful arms transfers and urge the DPRK to take concrete steps toward abandoning all nuclear weapons, ballistic missiles, and related programs.”'
  • 'Iran currently plans to build a heavy-water reactor at Arak in central in Iran, which could be used to convert uranium into plutonium, an element used to build atomic bombs.'
  • 'The signatories urge the U.S. and Russia to look into new approaches to address the development of new weapons; and state that China and other nuclear weapons states should promote work on strategic stability.'

Evaluation

Metrics

Label F1_Macro F1_Binary
all 0.9027 0.9021

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("fefofico/nuclear_trained_harrier_end-end-false")
# Run inference
preds = model("Meanwhile, Israel has repeatedly said it will not allow Iran to develop a nuclear weapon.")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 5 23.5620 45
Label Training Sample Count
negative 57
positive 64

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (1, 1)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 20
  • body_learning_rate: (2e-05, 2e-05)
  • head_learning_rate: 0.0001
  • 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.0033 1 0.2442 -
0.0660 20 0.2417 -
0.1320 40 0.2423 -
0.1980 60 0.2245 -
0.2640 80 0.2055 -
0.3300 100 0.1319 -
0.3960 120 0.0541 -
0.4620 140 0.0222 -
0.5281 160 0.0079 -
0.5941 180 0.0056 -
0.6601 200 0.0051 -
0.7261 220 0.0052 -
0.7921 240 0.0044 -
0.8581 260 0.0038 -
0.9241 280 0.0045 -
0.9901 300 0.0038 -
1.0 303 - 0.1244

Framework Versions

  • Python: 3.13.16
  • SetFit: 1.2.0
  • Sentence Transformers: 6.3.0
  • Transformers: 5.24.0
  • PyTorch: 2.14.1+cu130
  • Datasets: 5.2.0
  • Tokenizers: 0.23.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
-
Safetensors
Model size
0.6B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for fefofico/nuclear_trained_harrier_end-end-false

Finetuned
(21)
this model

Paper for fefofico/nuclear_trained_harrier_end-end-false

Evaluation results