setfit safetensors bert sentence-transformers text-classification generated_from_setfit_trainer arxiv:2209.11055 base_model:BAAI/bge-base-en-v1.5 base_model:finetune:BAAI/bge-base-en-v1.5 region:us
---
base_model: BAAI/bge-base-en-v1.5
library_name: setfit
metrics:
- accuracy
pipeline_tag: text-classification
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: 'fails  and '
- text: 'into parent article per ,  and '
- text: 'per  and . There are plenty of references, they just need to be added to
    the article. In furtherance of my vaguewave: http://books.google.com.au/books?id=owcCXZAVZ60C&pg=PA87&dq=steep+turn&hl=en&sa=X&ei=YO2AVLKlLcXbmgWfpIKIDg&ved=0CDMQ6AEwBA#v=onepage&q=steep%20turn&f=false,
    http://books.google.com.au/books?id=_4nGtx-_jHUC, http://books.google.com.au/books?id=RRcnAgAAQBAJ,
    http://flighttraining.aopa.org/students/maneuvers/skills/steepturns.html, and
    http://www.langleyflyingschool.com/Pages/Turns,%20Steep%20Turns,%20and%20Collision%20Avoidance%20Manoeuvering.html.
    That''s from the first Google results page'
- text: Fails  criteria
- text: '"If I may ask, why do you think the encounter is minor, when it has been
    stated that the battle is ""believed to be the first time recently that British
    naval service personnel have been involved in a confrontation that resulted in
    deaths"", and ""the first time the Royal Navy had been engaged in a fatal shoot-out
    on the high seas in living memory""?  As for no lasting notability, according
    to , notability is not temporary.  Thank you in advance if you respond to my query"'
inference: true
---

# SetFit with BAAI/bge-base-en-v1.5

This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) 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](https://www.sbert.net) 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-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5)
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
- **Maximum Sequence Length:** 512 tokens
- **Number of Classes:** 4 classes
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->

### Model Sources

- **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)

### Model Labels
| Label | Examples                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1     | <ul><li>"Fails : 'It has been the subject of multiple non-trivial published works whose source is independent from the musician/ensemble itself and reliable"</li><li>'cant see the point of this article per '</li><li>'more non-notable 40K cruft. This is about as |indiscriminate as information gets'</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| 2     | <ul><li>"doesn't just contain plot summary, therefore does not violate . &mdash"</li><li>"A fairly notable bill.  Whether it will eventually pass isn't the question, it's whether it's notable.  The article could be sourced better, I suppose, but it meets all of the criteria at "</li><li>"It clearly meets the  criteria so should be kept. We currently don't have sources to pass WP:GNG but it is rule of thumb to find someone who passes WP:GNG or not. Resources are always not online they could be found in local newspapers and cricket books, magazines"</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 3     | <ul><li>'to Vancouver School Board per precedent as stated at '</li><li>'to Monk (season 4), per  and . No delete reason has been articulated above that precludes a merge or redirection'</li><li>"The |notability guidelines for future films stipulate that a stand-alone article for a film should not be created until a project enters production.  This is because many factors such as budget issues, scripting issues, and casting issues can interfere with the project. There's enough information on this one for a merge-redirect, though. The full article can be recreated when principal photography is confirmed to have begun"</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 0     | <ul><li>'"Reasonably well published"" seems a bit subjective.  The subject has been co-author on five papers, but lead author on only one.  This is a fairly typical (i.e. |run of the mill) doctoral and post-doc publishing career.  And yes, given the information in the http://www.forbes.com/forbes-life-magazine/1999/0308/063.html Forbes article about \'\'Marquis Who\'s Who\'\', I\'d say that Wikipedia\'s guidelines of |notability are considerably more stringent"'</li><li>'Does this then verifiably fall under '</li><li>"I ran a bit quick yesterday, as I really don't like speedy deletions, {{reply|Insertcleverphrasehere}} I believe articles with any citations available and that have had a long period before being recreated should be given a fair trial and shouldn't ever be speedy deleted. Anyway, from looking at previous AfD and thefa.com website they registered two years ago to play in the FA Vase for the first time in the clubs existence, but they failed FA ground rules policy by having no lights. I am surprised there is no local news source for this on the article. If that issue with their ground has been fixed and the fact they gained promotion they will most likely have to register this coming season, this gives them a chance to enter FA Vase or FA Cup again. If we are going by the criteria that they need to play in an FA sanctioned cup competition to pass then they currently still fail Wikipedia guidelines to have an article. That could change by August know, but that's playing "</li></ul> |

## Uses

### Direct Use for Inference

First install the SetFit library:

```bash
pip install setfit
```

Then you can load this model and run inference.

```python
from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("research-dump/bge-base-en-v1.5_wikipedia_stance_wikipedia_stance")
# Run inference
preds = model("fails  and ")
```

<!--
### Downstream Use

*List how someone could finetune this model on their own dataset.*
-->

<!--
### Out-of-Scope Use

*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->

<!--
## Bias, Risks and Limitations

*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->

<!--
### Recommendations

*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->

## Training Details

### Training Set Metrics
| Training set | Min | Median | Max |
|:-------------|:----|:-------|:----|
| Word count   | 2   | 39.499 | 482 |

| Label | Training Sample Count |
|:------|:----------------------|
| 0     | 71                    |
| 1     | 637                   |
| 2     | 247                   |
| 3     | 45                    |

### Training Hyperparameters
- batch_size: (8, 2)
- num_epochs: (5, 5)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 10
- body_learning_rate: (1e-05, 1e-05)
- head_learning_rate: 5e-05
- loss: CosineSimilarityLoss
- distance_metric: cosine_distance
- margin: 0.25
- end_to_end: True
- use_amp: True
- 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.0004 | 1     | 0.2788        | -               |
| 0.2    | 500   | 0.2355        | 0.1984          |
| 0.4    | 1000  | 0.1157        | 0.1949          |
| 0.6    | 1500  | 0.0543        | 0.2121          |
| 0.8    | 2000  | 0.0331        | 0.1751          |
| 1.0    | 2500  | 0.0244        | 0.1868          |
| 1.2    | 3000  | 0.0159        | 0.1976          |
| 1.4    | 3500  | 0.0153        | 0.1794          |
| 1.6    | 4000  | 0.0144        | 0.1921          |
| 1.8    | 4500  | 0.0127        | 0.1830          |
| 2.0    | 5000  | 0.0115        | 0.1822          |
| 2.2    | 5500  | 0.012         | 0.1753          |
| 2.4    | 6000  | 0.0096        | 0.1868          |
| 2.6    | 6500  | 0.0095        | 0.1771          |
| 2.8    | 7000  | 0.0092        | 0.2017          |
| 3.0    | 7500  | 0.0101        | 0.1865          |
| 3.2    | 8000  | 0.0086        | 0.1906          |
| 3.4    | 8500  | 0.01          | 0.1820          |
| 3.6    | 9000  | 0.0087        | 0.1864          |
| 3.8    | 9500  | 0.0093        | 0.1949          |
| 4.0    | 10000 | 0.0097        | 0.1906          |
| 4.2    | 10500 | 0.0097        | 0.1962          |
| 4.4    | 11000 | 0.0091        | 0.1925          |
| 4.6    | 11500 | 0.0086        | 0.1892          |
| 4.8    | 12000 | 0.0076        | 0.1964          |
| 5.0    | 12500 | 0.0096        | 0.1953          |

### Framework Versions
- Python: 3.12.7
- SetFit: 1.1.1
- Sentence Transformers: 3.4.1
- Transformers: 4.48.2
- PyTorch: 2.6.0+cu124
- Datasets: 3.2.0
- Tokenizers: 0.21.0

## Citation

### BibTeX
```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}
}
```

<!--
## Glossary

*Clearly define terms in order to be accessible across audiences.*
-->

<!--
## Model Card Authors

*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->

<!--
## Model Card Contact

*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->