metadata
library_name: setfit
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
metrics:
- accuracy
widget:
- text: Quelle est la durée typique d'un prêt auto chez la banque CDM?
- text: >-
Y a-t-il des services d'assistance supplémentaires inclus dans l'assurance
décès et invalidité, tels que des conseils juridiques ou financiers en cas
de besoin?
- text: >-
Y a-t-il des restrictions quant au montant maximum couvert par l'assurance
des moyens de paiement ?
- text: >-
Est-il possible de réaliser une simulation de crédit pour différents
montants et durées de prêt chez la banque CDM?
- text: >-
Quels sont les avantages liés à l'utilisation d'une carte de crédit plutôt
qu'une carte de débit?
pipeline_tag: text-classification
inference: true
base_model: Sahajtomar/french_semantic
model-index:
- name: SetFit with Sahajtomar/french_semantic
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: Unknown
type: unknown
split: test
metrics:
- type: accuracy
value: 0.9111111111111111
name: Accuracy
SetFit with Sahajtomar/french_semantic
This is a SetFit model that can be used for Text Classification. This SetFit model uses Sahajtomar/french_semantic as the Sentence Transformer embedding model. A SetFitHead 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: Sahajtomar/french_semantic
- Classification head: a SetFitHead instance
- Maximum Sequence Length: 514 tokens
- Number of Classes: 18 classes
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
Model Labels
Label | Examples |
---|---|
3 |
|
6 |
|
11 |
|
10 |
|
2 |
|
17 |
|
8 |
|
0 |
|
14 |
|
9 |
|
5 |
|
7 |
|
1 |
|
13 |
|
16 |
|
15 |
|
12 |
|
4 |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.9111 |
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("yazidtagnaouti/maes")
# Run inference
preds = model("Quelle est la durée typique d'un prêt auto chez la banque CDM?")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 1 | 14.4563 | 28 |
Label | Training Sample Count |
---|---|
0 | 14 |
1 | 14 |
2 | 14 |
3 | 14 |
4 | 14 |
5 | 14 |
6 | 14 |
7 | 14 |
8 | 14 |
9 | 14 |
10 | 14 |
11 | 14 |
12 | 14 |
13 | 14 |
14 | 14 |
15 | 14 |
16 | 14 |
17 | 14 |
Training Hyperparameters
- batch_size: (16, 2)
- num_epochs: (1, 16)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 20
- 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: 42
- eval_max_steps: -1
- load_best_model_at_end: True
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0016 | 1 | 0.1462 | - |
0.0794 | 50 | 0.0687 | - |
0.1587 | 100 | 0.0139 | - |
0.2381 | 150 | 0.0034 | - |
0.3175 | 200 | 0.0139 | - |
0.3968 | 250 | 0.002 | - |
0.4762 | 300 | 0.0016 | - |
0.5556 | 350 | 0.0009 | - |
0.6349 | 400 | 0.0009 | - |
0.7143 | 450 | 0.0007 | - |
0.7937 | 500 | 0.0008 | - |
0.8730 | 550 | 0.0009 | - |
0.9524 | 600 | 0.0007 | - |
1.0 | 630 | - | 0.0276 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.10.12
- SetFit: 1.0.3
- Sentence Transformers: 2.3.1
- Transformers: 4.35.2
- PyTorch: 2.1.0+cu121
- Datasets: 2.17.0
- Tokenizers: 0.15.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}
}