SetFit with sentence-transformers/all-mpnet-base-v2

This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/all-mpnet-base-v2 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
1
  • 'what can your do with your mcp tool db2 schema'
  • 'is this normal?\nGC(47) Pause Young 234M->89M 12.5ms'
  • 'what units is file_size in? what format is mimetype in'
0
  • 'use mongo and postgres mcps to find test data'
  • 'browser screenshot the error page'
  • 'use the linear mcp to find my high priority issues'
2
  • 'java\npublic void process() {\n if (user != null) {\n // stuff\n }\n}\n\nclean this up'
  • "Duplicate class: 'ChunkCacheMetricsTest'"
  • "python\ndef process(data):\n result = []\n for item in data:\n if item['active']:\n result.append(item['value'])\n return result\n\nuse list comprehension"
3
  • 'review security scan then patch critical issues'
  • 'analyze failing tests, group them, fix each group'
  • '\n47 tests failing\n\ncategorize and fix each category'
5
  • 'model architecture not supported, plan alternative approach'
  • 'architecture diagram for wml'
  • 'before we move on let me ask - can we develop a set of documents that break the implementation down into individual tasks - the first one being a simple core set of function that could deliver a a single starting point. and then add layers of function in subsequent tasks to methodically build out th'
4
  • 'yes the linear mcp is finally connected'
  • 'Usually we use a custom linter config here, not the standard one'
  • 'ok it worked after i restarted the postgres mcp server'

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("tmp/best_model")
# Run inference
preds = model("lets fix the issues")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 1 12.3350 125
Label Training Sample Count
0 43
1 80
2 88
3 56
4 61
5 84

Training Hyperparameters

  • batch_size: (8, 8)
  • num_epochs: (1, 1)
  • max_steps: -1
  • sampling_strategy: unique
  • num_iterations: 24
  • body_learning_rate: (5.379125214937585e-05, 5.379125214937585e-05)
  • head_learning_rate: 0.009661295989662243
  • loss: CosineSimilarityLoss
  • distance_metric: cosine_distance
  • margin: 0.25
  • end_to_end: False
  • use_amp: False
  • warmup_proportion: 0.12909445918143356
  • 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.0004 1 0.5108 -
0.0040 10 - 0.3669
0.0081 20 - 0.3571
0.0121 30 - 0.3346
0.0162 40 - 0.2993
0.0202 50 0.3376 0.2637
0.0243 60 - 0.2393
0.0283 70 - 0.2337
0.0324 80 - 0.2334
0.0364 90 - 0.2300
0.0405 100 0.2475 0.2319
0.0445 110 - 0.2254
0.0485 120 - 0.2203
0.0526 130 - 0.2157
0.0566 140 - 0.2324
0.0607 150 0.2205 0.2153
0.0647 160 - 0.2061
0.0688 170 - 0.1946
0.0728 180 - 0.2024
0.0769 190 - 0.1932
0.0809 200 0.1882 0.2088
0.0850 210 - 0.1758
0.0890 220 - 0.1694
0.0930 230 - 0.1885
0.0971 240 - 0.2039
0.1011 250 0.1434 0.1648
0.1052 260 - 0.1499
0.1092 270 - 0.1722
0.1133 280 - 0.1763
0.1173 290 - 0.1768
0.1214 300 0.0993 0.1632
0.1254 310 - 0.1650

Framework Versions

  • Python: 3.12.12
  • SetFit: 1.1.3
  • Sentence Transformers: 3.4.1
  • Transformers: 4.51.3
  • PyTorch: 2.11.0+cu130
  • Datasets: 4.8.4
  • Tokenizers: 0.21.4

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
17
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for linkyeu/intent-routing-sweep-v4

Finetuned
(376)
this model

Paper for linkyeu/intent-routing-sweep-v4