---
library_name: setfit
metrics:
- accuracy
pipeline_tag: text-classification
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: Point out any dull descriptions that need more color
- text: Find places where I repeat my main points unnecessarily
- text: What's a compelling method to reveal a secret in my plot
- text: How do I handle flashbacks in a non-linear story
- text: Suggest some comedic elements to lighten a dark plot
inference: true
---
# SetFit
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. A LinearDiscriminantAnalysis 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
- **Classification head:** a LinearDiscriminantAnalysis instance
- **Maximum Sequence Length:** 512 tokens
- **Number of Classes:** 3 classes
### 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 |
- 'Can you identify specific areas that need improvement in my text'
- 'Point out the flaws in my writing style, please'
- 'Which parts of my draft are the weakest'
|
| 0 | - "How do I make my character's driving force more compelling"
- "Any tips to deepen my protagonist's underlying goals"
- "Suggestions for strengthening the reasons behind my character's actions"
|
| 2 | - 'How does the Pro version elevate my writing experience'
- 'Could you list the premium perks of Quarkle Pro'
- 'What special advantages come with upgrading to Pro'
|
## 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("setfit_model_id")
# Run inference
preds = model("How do I handle flashbacks in a non-linear story")
```
## Training Details
### Training Set Metrics
| Training set | Min | Median | Max |
|:-------------|:----|:-------|:----|
| Word count | 1 | 8.7947 | 14 |
| Label | Training Sample Count |
|:------|:----------------------|
| 0 | 153 |
| 1 | 144 |
| 2 | 117 |
### Framework Versions
- Python: 3.10.15
- SetFit: 1.2.0.dev0
- Sentence Transformers: 3.3.1
- Transformers: 4.47.1
- PyTorch: 2.5.1
- 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}
}
```