---
library_name: setfit
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
metrics:
- accuracy
widget:
- text: frais douane import vehicule usa carte usd commission
- text: debit automatique assurance chien fido protect
- text: facture carte du cabinet architecte plan maison est carte
- text: achat le monde des oiseaux carte
- text: abonnement mensuel salle de sport life fitness club carte
pipeline_tag: text-classification
inference: true
model-index:
- name: SetFit
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: Unknown
type: unknown
split: test
metrics:
- type: accuracy
value: 0.18181818181818182
name: Accuracy
---
# SetFit
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. 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
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
- **Maximum Sequence Length:** 128 tokens
- **Number of Classes:** 44 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 |
|:-------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|
| Shopping / electronics & multimedia |
- 'achat amazon eu s a r l carte lux'
- 'retrait achat b h photo carte usa usd commission'
|
| Other / kids | - 'paiement carte babyland equipements carte'
- 'achat carte couture kids atelier carte'
|
| Bank services / other | - 'paiement frais demande rib iban supplémentaires carte'
- 'frais emission chequier carte'
|
| Housing / rent | - 'paiement loyer maison campagne carte'
- 'prlv sepa sarl habitatplus loyer mars carte'
|
| Transportation / other | - 'abonnement annual parking municipal villetown carte'
- 'frais douane import vehicule usa carte usd commission'
|
| Bank services / transfers | - 'reception transfert remboursement prêt amis carte'
- 'transfer location vacances famille roux carte'
|
| Investment / retirement & savings | - 'investissement fonds de pension carte'
- 'souscription sicav monétaire retraite carte'
|
| Other / taxes | - 'contribution sociales csg crds securite soc frsso'
- 'prelevement impots sur le revenu fiscale fr'
|
| Healthy & Beauty / other | - 'achat en ligne produits aromatherapie naturesence carte'
- 'session floating therapie apezen carte'
|
| Investment / securities | - 'achat obligations tesla carte usd'
- 'transaction opcvm european funds carte'
|
| Housing / other | - 'facture carte du ikea velizy carte'
- 'prlv sepa du alarmes securitas direct'
|
| Housing / house loan | - 'prelevement sepa pret habitation hsbc france'
- 'remboursement emprunt immobilier caisse d epargne echeance'
|
| Housing / utilities & bills | - 'prlv sepa free mobile'
- 'prlv sepa total direct energie elec'
|
| Bank services / general fees | - 'frais operation non europeenne carte'
- 'commission intervention depassement decouvert'
|
| Leisure & Entertainment / culture & events | - 'facture carte du opera de paris carte'
- 'reservation carte nuit des musees carte'
|
| Transportation / taxi & carpool | - 'prlv sepa lyft carte usa usd commission'
- 'facture carte du yandex taxi moscow carte rus rub commission'
|
| Shopping / other | - 'prlv sepa amzn mktp fr mjk amz com bill lu carte'
- 'achat arts et decoration bleneau carte'
|
| Recurrent Payments / loans | - 'retrait auto emma pret familial emmaprt carte'
- 'virement sortant lcl pret travaux rth'
|
| Healthy & Beauty / doctor fees | - 'paiement cabinet kinesitherapie dubois carte'
- 'prlv sepa cabinet dermatologie dupont frzzz cdc hjke'
|
| Bank services / withdrawal | - 'retrait dab banque express toulouse carte fr'
- 'retrait dab banque rapide clermont ferrand carte fr commission'
|
| Other / other | - 'achat billets loterie nationale'
- 'cotisation associative lumieres de la ville'
|
| Healthy & Beauty / pharmacy | - 'paiement pharmacie du parc carte'
- 'achat pharmacie du centre ville carte'
|
| Transportation / fuel | - 'reglement carbu elf bordeaux carte'
- 'prlv automatique station total nantes'
|
| Shopping / sporting goods | - 'achat en ligne sport fr carte'
- 'achat reebok fitness bordeaux carte'
|
| Food & Drinks / groceries | - 'prlv sepa marche local de provence carte'
- 'facture carte du magasin asiatique lee carte'
|
| Other / pets | - 'debit automatique assurance chien fido protect'
- 'achat le monde des oiseaux carte'
|
| Investment / real estate | - 'renovation maison nanterre carte'
- 'facture carte du cabinet architecte plan maison est carte'
|
| Shopping / clothing | - 'achat primark lyon carte'
- 'achat zara carte esp'
|
| Shopping / housing equipment | - 'paiement par carte decathlon pour camping carte'
- 'paiement par carte zara home paris carte'
|
| Transportation / maitenance | - 'facture carte batteries et plus marseille carte'
- 'prlv sepa atelier mécanique avancée limoges annuelle'
|
| Recurrent Payments / other | - 'cotisation annuelle club échecs rois et pions date'
- 'souscription mensuelle plateforme éducative kidlearn carte date'
|
| Recurrent Payments / insurance | - 'prelevement sepa assurance multirisque pro mma'
- 'prélèvement mensuel assurance collective cnp'
|
| Healthy & Beauty / veterinary | - 'paiement facture chien veterinaire des lilas carte'
- 'soins dentaires cheval equivet clinic strasbourg carte'
|
| Transportation / public transportation | - 'achat titres v ville de lille carte'
- 'billet rer versailles ratp carte'
|
| Healthy & Beauty / beauty & self-care | - 'facture carte du salon manucure instant beaute carte'
- 'achat parfumerie senteurs du monde carte'
|
| Leisure & Entertainment / other | - 'achat carte du netflix carte'
- 'facture carte du hbo max carte usa'
|
| Food & Drinks / eating out | - 'facture carte du cafeteria los amigos carte spa'
- 'facture carte du le petit cafe carte'
|
| Housing / services & maintenance | - 'virement recu soldes tuyauterie moderne'
- 'prlv sepa chauffage central bernier'
|
| Leisure & Entertainment / travel | - 'prlv sepa eurostar'
- 'virement recu airbnb stay paris frzzz date'
|
| Leisure & Entertainment / sports & hobbies | - 'paiement en ligne du nike com carte usd commission'
- 'achat en magasin du rebel sport carte aud'
|
| Investment / other | - 'participation crowdfunding waterclean projet'
- 'achat actions ia revolution carte'
|
| Transportation / car loan & leasing | - 'prlv sepa dacia lodgy crdit auto'
- 'prelevement mensuel mercedes classe a financement frzzzmerce'
|
| Recurrent Payments / subscription | - 'facture carte du amazon prime carte'
- 'abonnement mensuel salle de sport life fitness club carte'
|
| Food & Drinks / other | - 'debit epicerie bio vitanature carte'
- 'payment carte salon de thé carte'
|
## Evaluation
### Metrics
| Label | Accuracy |
|:--------|:---------|
| **all** | 0.1818 |
## 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("HEN10/setfit-particular-transaction-solon-embeddings-labels-large-kaggle-automatisation-v1")
# Run inference
preds = model("achat le monde des oiseaux carte")
```
## Training Details
### Training Set Metrics
| Training set | Min | Median | Max |
|:-------------|:----|:-------|:----|
| Word count | 3 | 6.2727 | 11 |
| Label | Training Sample Count |
|:-------------------------------------------|:----------------------|
| Housing / rent | 2 |
| Housing / house loan | 2 |
| Housing / utilities & bills | 2 |
| Housing / services & maintenance | 2 |
| Housing / other | 2 |
| Food & Drinks / groceries | 2 |
| Food & Drinks / eating out | 2 |
| Food & Drinks / other | 2 |
| Leisure & Entertainment / sports & hobbies | 2 |
| Leisure & Entertainment / culture & events | 2 |
| Leisure & Entertainment / travel | 2 |
| Leisure & Entertainment / other | 2 |
| Transportation / car loan & leasing | 2 |
| Transportation / fuel | 2 |
| Transportation / public transportation | 2 |
| Transportation / taxi & carpool | 2 |
| Transportation / maitenance | 2 |
| Transportation / other | 2 |
| Recurrent Payments / loans | 2 |
| Recurrent Payments / insurance | 2 |
| Recurrent Payments / subscription | 2 |
| Recurrent Payments / other | 2 |
| Investment / securities | 2 |
| Investment / retirement & savings | 2 |
| Investment / real estate | 2 |
| Investment / other | 2 |
| Shopping / clothing | 2 |
| Shopping / electronics & multimedia | 2 |
| Shopping / sporting goods | 2 |
| Shopping / housing equipment | 2 |
| Shopping / other | 2 |
| Healthy & Beauty / doctor fees | 2 |
| Healthy & Beauty / pharmacy | 2 |
| Healthy & Beauty / beauty & self-care | 2 |
| Healthy & Beauty / veterinary | 2 |
| Healthy & Beauty / other | 2 |
| Bank services / transfers | 2 |
| Bank services / withdrawal | 2 |
| Bank services / general fees | 2 |
| Bank services / other | 2 |
| Other / taxes | 2 |
| Other / kids | 2 |
| Other / pets | 2 |
| Other / other | 2 |
### Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- body_learning_rate: (2e-05, 1e-05)
- head_learning_rate: 0.01
- loss: CosineSimilarityLoss
- distance_metric: cosine_distance
- margin: 0.25
- end_to_end: True
- use_amp: False
- warmup_proportion: 0.1
- seed: 6
- eval_max_steps: -1
- load_best_model_at_end: False
### Training Results
| Epoch | Step | Training Loss | Validation Loss |
|:------:|:----:|:-------------:|:---------------:|
| 0.0021 | 1 | 0.1221 | - |
| 0.1057 | 50 | 0.1337 | - |
| 0.2114 | 100 | 0.0617 | - |
| 0.3171 | 150 | 0.0397 | - |
| 0.4228 | 200 | 0.0377 | - |
| 0.5285 | 250 | 0.0133 | - |
| 0.6342 | 300 | 0.012 | - |
| 0.7400 | 350 | 0.0191 | - |
| 0.8457 | 400 | 0.0118 | - |
| 0.9514 | 450 | 0.0083 | - |
### Framework Versions
- Python: 3.10.13
- SetFit: 1.0.3
- Sentence Transformers: 2.6.1
- Transformers: 4.39.3
- PyTorch: 2.1.2+cpu
- Datasets: 2.17.0
- Tokenizers: 0.15.2
## 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}
}
```