--- 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.9666666666666667 name: Accuracy --- # SetFit with Sahajtomar/french_semantic This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [Sahajtomar/french_semantic](https://huggingface.co/Sahajtomar/french_semantic) as the Sentence Transformer embedding model. A [SetFitHead](huggingface.co/docs/setfit/reference/main#setfit.SetFitHead) 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:** [Sahajtomar/french_semantic](https://huggingface.co/Sahajtomar/french_semantic) - **Classification head:** a [SetFitHead](huggingface.co/docs/setfit/reference/main#setfit.SetFitHead) instance - **Maximum Sequence Length:** 514 tokens - **Number of Classes:** 18 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 | |:------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 14 | | | 11 | | | 1 | | | 8 | | | 0 | | | 16 | | | 2 | | | 13 | | | 12 | | | 7 | | | 4 | | | 5 | | | 10 | | | 6 | | | 9 | | | 17 | | | 3 | | | 15 | | ## Evaluation ### Metrics | Label | Accuracy | |:--------|:---------| | **all** | 0.9667 | ## 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("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.5053 | 28 | | Label | Training Sample Count | |:------|:----------------------| | 0 | 16 | | 1 | 16 | | 2 | 16 | | 3 | 16 | | 4 | 16 | | 5 | 16 | | 6 | 15 | | 7 | 16 | | 8 | 16 | | 9 | 16 | | 10 | 15 | | 11 | 16 | | 12 | 16 | | 13 | 16 | | 14 | 16 | | 15 | 16 | | 16 | 16 | | 17 | 15 | ### 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 - max_length: 256 - seed: 42 - eval_max_steps: -1 - load_best_model_at_end: True ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:-------:|:-------:|:-------------:|:---------------:| | 0.0014 | 1 | 0.1659 | - | | 0.0701 | 50 | 0.044 | - | | 0.1403 | 100 | 0.0374 | - | | 0.2104 | 150 | 0.0624 | - | | 0.2805 | 200 | 0.005 | - | | 0.3506 | 250 | 0.0022 | - | | 0.4208 | 300 | 0.0042 | - | | 0.4909 | 350 | 0.0012 | - | | 0.5610 | 400 | 0.0016 | - | | 0.6311 | 450 | 0.001 | - | | 0.7013 | 500 | 0.0006 | - | | 0.7714 | 550 | 0.0006 | - | | 0.8415 | 600 | 0.0009 | - | | 0.9116 | 650 | 0.0005 | - | | 0.9818 | 700 | 0.0006 | - | | **1.0** | **713** | **-** | **0.0202** | * 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 ```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} } ```