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 MultiOutputClassifier instance is used for classification.
The model has been trained using an efficient few-shot learning technique that involves:
- Fine-tuning a Sentence Transformer with contrastive learning.
- Training a classification head with features from the fine-tuned Sentence Transformer.
Model Details
Model Description
- Model Type: SetFit
- Sentence Transformer body: sentence-transformers/all-mpnet-base-v2
- Classification head: a MultiOutputClassifier instance
- Maximum Sequence Length: 384 tokens
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.84 |
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("osmedi/LLM_response_evaluator")
# Run inference
preds = model("
Human: 2. Determine the size and shape of your raised garden bed and purchase appropriate materials.
Assistant: <sep> The size and shape of your raised garden bed will depend on your available space and the type of plants you want to grow. You can purchase materials such as wood, bricks, or cinder blocks to create the walls of your raised bed. Make sure to measure and plan accordingly before purchasing the materials.")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 7 | 280.0747 | 15755 |
Training Hyperparameters
- batch_size: (8, 8)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 2
- body_learning_rate: (2e-05, 2e-05)
- head_learning_rate: 2e-05
- 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.0011 | 1 | 0.593 | - |
0.0526 | 50 | 0.3063 | - |
0.1053 | 100 | 0.2582 | - |
0.1579 | 150 | 0.2625 | - |
0.2105 | 200 | 0.2477 | - |
0.2632 | 250 | 0.2553 | - |
0.3158 | 300 | 0.2473 | - |
0.3684 | 350 | 0.2442 | - |
0.4211 | 400 | 0.2368 | - |
0.4737 | 450 | 0.2291 | - |
0.5263 | 500 | 0.229 | - |
0.5789 | 550 | 0.224 | - |
0.6316 | 600 | 0.1974 | - |
0.6842 | 650 | 0.2138 | - |
0.7368 | 700 | 0.208 | - |
0.7895 | 750 | 0.1936 | - |
0.8421 | 800 | 0.2061 | - |
0.8947 | 850 | 0.1931 | - |
0.9474 | 900 | 0.1868 | - |
1.0 | 950 | 0.186 | - |
Framework Versions
- Python: 3.10.12
- SetFit: 1.1.0
- Sentence Transformers: 3.3.1
- Transformers: 4.44.2
- PyTorch: 2.5.1+cu121
- Datasets: 3.2.0
- Tokenizers: 0.19.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
- 0
Inference API (serverless) has been turned off for this model.
Model tree for osmedi/LLM_response_evaluator
Base model
sentence-transformers/all-mpnet-base-v2