Ghofranem's picture
Add SetFit model
aeb2673 verified
---
library_name: setfit
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
metrics:
- accuracy
widget:
- text: ' oui le problème est plus psychologique, je suis d''accord avec vous, et
je pense que si l''état mettait en place des suivis psychologiques vraiment poussés,
il n''y aurait pas d''opération, moi j''ai eu un bypass, j''ai repris une quinzaine
de kilos bien malheureusement, et l''aide pour l''addiction n''est pas prise en
charge, genre thérapie, et moi je sais que c''est cela mon problème, quand on
n''a pas une bonne image de soi même, c''est très difficile de gagner la partie'
- text: Ouaw je me suis totalement reconnue, c’est exactement ce que je vis après
être sortie d’une sorte d’orthorexie qui a duré plus d’un an et demi (limite anorexie
mentale), pleine de frustrations j’ai donc repris une dizaine de kilos et ma vie
est rythmée de privation et d’hyperphagie.. j’essaye de ne pas trop me priver
mais j’ai l’impression d’être constamment frustrée.. merci pour ta vidéo ❤️
- text: Mdr mais faut pas être médecin pour savoir comment fonctionne le corps humain
tu donne meme pas d'argument. Tu dis que c'est une maladie bah parle en dis moi
pourquoi comment ??? Parce que la j'entends que des tu dis de la merde t médecin
nanani nanana. Toi en tout cas tu dois pas être Einstein. Moi j'ai donné tout
les argument qui faut en plus ils sont prouvé. Tu mange tu grossit tu mange pas
tu minci. Tu fais pas de sport tu maigrit pas tu fais du sport tu maigris bref
sa sert a rien de parler si ta meme pas la repartie de donner des argument à ce
que tu dis.
- text: pour moi ce qui a fonctioner pour me libere de cette obsession, c'est mon
esprit critique. j'ai bien observee comment on se fout de moi pour que je consome
toujours plus de poison. apres j'ai bien vu comment on se fout de la soufrance
des animaux. et comment on nous eloigne de la nature et du naturel et saludable.
c'est un tres long processus d'observation sincere qui m'a aider a me liberer
peut a peut. aujourd'huit je suis vegan, je pratique la relaxation et la respiration
avec ou sans hypnose. il y a encore des moments ou je suis hanter par l'idee de
la bouffe, je ralentie, je respire lentement et profondement, je regarde le ciel,
les arbres, les chats, et je me demande comment l'etre humain arrive a etre tellement
miserable...
- text: Comme je te comprend 🙏 mes tca ont commencé alors que j'avais 11 ans. J'espère
que tu vas mieux maintenant
pipeline_tag: text-classification
inference: false
base_model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
model-index:
- name: SetFit with sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: Unknown
type: unknown
split: test
metrics:
- type: accuracy
value: 0.6115702479338843
name: Accuracy
---
# SetFit with sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2) as the Sentence Transformer embedding model. A OneVsRestClassifier 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:** [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2)
- **Classification head:** a OneVsRestClassifier instance
- **Maximum Sequence Length:** 128 tokens
<!-- - **Number of Classes:** Unknown -->
<!-- - **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)
## Evaluation
### Metrics
| Label | Accuracy |
|:--------|:---------|
| **all** | 0.6116 |
## 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("Ghofranem/setfit-paraphrase-multilingual-MiniLM-L12-v2-ed-balanced-fr-AI4ED")
# Run inference
preds = model("Comme je te comprend 🙏 mes tca ont commencé alors que j'avais 11 ans. J'espère que tu vas mieux maintenant")
```
<!--
### 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 | 4 | 95.7314 | 694 |
### Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 10
- body_learning_rate: (2e-05, 2e-05)
- head_learning_rate: 2e-05
- loss: CosineSimilarityLoss
- distance_metric: cosine_distance
- margin: 0.25
- end_to_end: False
- use_amp: False
- warmup_proportion: 0.1
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: False
### Training Results
| Epoch | Step | Training Loss | Validation Loss |
|:------:|:----:|:-------------:|:---------------:|
| 0.0017 | 1 | 0.2843 | - |
| 0.0826 | 50 | 0.2442 | - |
| 0.1653 | 100 | 0.2095 | - |
| 0.2479 | 150 | 0.193 | - |
| 0.3306 | 200 | 0.0896 | - |
| 0.4132 | 250 | 0.1439 | - |
| 0.4959 | 300 | 0.1234 | - |
| 0.5785 | 350 | 0.1074 | - |
| 0.6612 | 400 | 0.1135 | - |
| 0.7438 | 450 | 0.0982 | - |
| 0.8264 | 500 | 0.0392 | - |
| 0.9091 | 550 | 0.02 | - |
| 0.9917 | 600 | 0.043 | - |
### Framework Versions
- Python: 3.10.12
- SetFit: 1.0.3
- Sentence Transformers: 2.5.1
- Transformers: 4.38.2
- PyTorch: 2.2.1+cu121
- Datasets: 2.18.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.*
-->