|
--- |
|
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: prlv sepa soins veterinaires urgences |
|
- text: virement recu vente local commercial nice carte |
|
- text: achat académie dressage canin carte |
|
- text: facture carte du adobe creative cloud photo 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.25 |
|
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 |
|
<!-- - **Sentence Transformer:** [Unknown](https://huggingface.co/unknown) --> |
|
- **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 |
|
<!-- - **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 | |
|
|:-------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------| |
|
| Shopping / electronics & multimedia | <ul><li>'achat dji technology carte chn'</li><li>'facture carte samsung paris opera carte'</li></ul> | |
|
| Other / kids | <ul><li>'virement sortant cadeau anniversaire neveu'</li><li>'paiement carte lunapark family fun carte'</li></ul> | |
|
| Bank services / other | <ul><li>'paiement frais demande rib iban supplémentaires carte'</li><li>'frais changement de pin carte'</li></ul> | |
|
| Housing / rent | <ul><li>'paiement loyer rue des oliviers carte'</li><li>'sepa regl loyer resid les ormeaux carte'</li></ul> | |
|
| Transportation / other | <ul><li>'parking aeroport charles de gaulle carte'</li><li>'frais douane import vehicule usa carte usd commission'</li></ul> | |
|
| Bank services / transfers | <ul><li>'transfer location vacances famille roux carte'</li><li>'virement sepa entrant de loyer mars carte'</li></ul> | |
|
| Investment / retirement & savings | <ul><li>'alimentation plan epargne logement carte'</li><li>'allocation retraite complémentaire carte'</li></ul> | |
|
| Other / taxes | <ul><li>'contribution economique territoriale siret frcte'</li><li>'taxe apprentissage siret frapp'</li></ul> | |
|
| Healthy & Beauty / other | <ul><li>'adhésion club randonnée plein air'</li><li>'achat en ligne produits aromatherapie naturesence carte'</li></ul> | |
|
| Investment / securities | <ul><li>'investissement silver etf carte silver oz'</li><li>'transaction actions netflix carte usd'</li></ul> | |
|
| Housing / other | <ul><li>'virement recu du remboursement depot de garantie'</li><li>'prlv sepa du alarmes securitas direct'</li></ul> | |
|
| Housing / house loan | <ul><li>'solde emprunt habitat fortuneo pret'</li><li>'prelevement sepa pret habitation hsbc france'</li></ul> | |
|
| Housing / utilities & bills | <ul><li>'prlv sepa grdf'</li><li>'prlv sepa total direct energie elec'</li></ul> | |
|
| Bank services / general fees | <ul><li>'frais opposition cheque perdu'</li><li>'frais de gestion portefeuille titres'</li></ul> | |
|
| Leisure & Entertainment / culture & events | <ul><li>'prlv sepa cinema cgr lille'</li><li>'achat carte festival rock en seine carte'</li></ul> | |
|
| Transportation / taxi & carpool | <ul><li>'prlv sepa blablacar carte'</li><li>'facture carte du kakao taxi seoul carte kor krw commission'</li></ul> | |
|
| Shopping / other | <ul><li>'achat coffrets cadeaux pandore carte'</li><li>'facture carte du magasin l unique montpellier carte'</li></ul> | |
|
| Recurrent Payments / loans | <ul><li>'retrait auto emma pret familial emmaprt carte'</li><li>'paiement échéance axa pret professionnel carte'</li></ul> | |
|
| Healthy & Beauty / doctor fees | <ul><li>'facture carte du dr pierre neurologue carte'</li><li>'facture carte du dr marchand orthopediste carte'</li></ul> | |
|
| Bank services / withdrawal | <ul><li>'retrait dab banque express toulouse carte fr'</li><li>'retrait dab ecobanque lyon carte fr'</li></ul> | |
|
| Other / other | <ul><li>'facture carte du cinema rexy paris carte'</li><li>'don association sos villages enfants'</li></ul> | |
|
| Healthy & Beauty / pharmacy | <ul><li>'prlv sepa pharmacie azureech'</li><li>'debit carte pharmacie grand ciel carte'</li></ul> | |
|
| Transportation / fuel | <ul><li>'facture carte du total energies paris carte'</li><li>'prlv sepa du q bruxelles carte bel'</li></ul> | |
|
| Shopping / sporting goods | <ul><li>'pmt carte fitnessboutique lyon carte'</li><li>'paiement carte go sport montpellier carte'</li></ul> | |
|
| Food & Drinks / groceries | <ul><li>'facture carte du magasin asiatique lee carte'</li><li>'debit charcuterie gourmets carte'</li></ul> | |
|
| Other / pets | <ul><li>'prlv sepa soins veterinaires urgences'</li><li>'achat académie dressage canin carte'</li></ul> | |
|
| Investment / real estate | <ul><li>'virement sortant investissement immobilier crowdfunding carte'</li><li>'virement recu vente local commercial nice carte'</li></ul> | |
|
| Shopping / clothing | <ul><li>'achat decathlon carte'</li><li>'achat carte nike store carte usa usd commission'</li></ul> | |
|
| Shopping / housing equipment | <ul><li>'facture carte du conforama montpellier carte'</li><li>'paiement par carte ambiances matieres marseille carte'</li></ul> | |
|
| Transportation / maitenance | <ul><li>'facture du vitres teintees luxe bordeaux carte'</li><li>'debit du garage turbo moteurs strasbourg carte remise a neuf'</li></ul> | |
|
| Recurrent Payments / other | <ul><li>'abonnement annuel magazine interstellar transaction date'</li><li>'cotisation annuelle club échecs rois et pions date'</li></ul> | |
|
| Recurrent Payments / insurance | <ul><li>'prelevement sepa assurance multirisque pro mma'</li><li>'prélèvement mensuel assurance collective cnp'</li></ul> | |
|
| Healthy & Beauty / veterinary | <ul><li>'deworming petcare lyon carte'</li><li>'prlv sepa hospital vet duval limoges'</li></ul> | |
|
| Transportation / public transportation | <ul><li>'achat titres v ville de lille carte'</li><li>'abonnement tram strasbourg cts carte'</li></ul> | |
|
| Healthy & Beauty / beauty & self-care | <ul><li>'prlv sepa abonnement biotyfull box'</li><li>'facture carte du mac cosmetics nice carte'</li></ul> | |
|
| Leisure & Entertainment / other | <ul><li>'paiement en ligne du amazon prime video carte usa'</li><li>'facture carte du spotify premium carte usa'</li></ul> | |
|
| Food & Drinks / eating out | <ul><li>'facture carte du cafe de flore carte'</li><li>'facture carte du mcdonald s carte usa usd commission'</li></ul> | |
|
| Housing / services & maintenance | <ul><li>'prlv sepa electricite generale flash'</li><li>'virement recu soldes tuyauterie moderne'</li></ul> | |
|
| Leisure & Entertainment / travel | <ul><li>'prlv sepa eurostar'</li><li>'achat carte hertz location carte usa usd commission'</li></ul> | |
|
| Leisure & Entertainment / sports & hobbies | <ul><li>'paiement en ligne du adidas fr carte'</li><li>'facture carte du culture velo lyon carte'</li></ul> | |
|
| Investment / other | <ul><li>'souscription part sociale coop biolocal'</li><li>'participation crowdfunding waterclean projet'</li></ul> | |
|
| Transportation / car loan & leasing | <ul><li>'virement mensualite bmw x debmwx'</li><li>'prlv sepa dacia lodgy crdit auto'</li></ul> | |
|
| Recurrent Payments / subscription | <ul><li>'prlv sepa microsoft office svc carte'</li><li>'facture carte du adobe creative cloud photo carte'</li></ul> | |
|
| Food & Drinks / other | <ul><li>'facture carte du café de flore carte'</li><li>'debit carte caviste le grand cru carte'</li></ul> | |
|
|
|
## Evaluation |
|
|
|
### Metrics |
|
| Label | Accuracy | |
|
|:--------|:---------| |
|
| **all** | 0.25 | |
|
|
|
## 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 académie dressage canin carte") |
|
``` |
|
|
|
<!-- |
|
### 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 | 3 | 6.0455 | 10 | |
|
|
|
| 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.1662 | - | |
|
| 0.1057 | 50 | 0.1483 | - | |
|
| 0.2114 | 100 | 0.0681 | - | |
|
| 0.3171 | 150 | 0.0298 | - | |
|
| 0.4228 | 200 | 0.0245 | - | |
|
| 0.5285 | 250 | 0.0117 | - | |
|
| 0.6342 | 300 | 0.032 | - | |
|
| 0.7400 | 350 | 0.0112 | - | |
|
| 0.8457 | 400 | 0.0072 | - | |
|
| 0.9514 | 450 | 0.0176 | - | |
|
|
|
### Framework Versions |
|
- Python: 3.10.13 |
|
- SetFit: 1.0.3 |
|
- Sentence Transformers: 2.6.1 |
|
- Transformers: 4.39.3 |
|
- PyTorch: 2.1.2 |
|
- 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} |
|
} |
|
``` |
|
|
|
<!-- |
|
## 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.* |
|
--> |