SetFit with m3hrdadfi/roberta-zwnj-wnli-mean-tokens
This is a SetFit model that can be used for Text Classification. This SetFit model uses m3hrdadfi/roberta-zwnj-wnli-mean-tokens as the Sentence Transformer embedding model. A LogisticRegression 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: m3hrdadfi/roberta-zwnj-wnli-mean-tokens
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 128 tokens
- Number of Classes: 11 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 |
---|---|
7 |
|
4 |
|
3 |
|
5 |
|
0 |
|
8 |
|
6 |
|
2 |
|
9 |
|
1 |
|
10 |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.1364 |
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("keivan/roberta-zwnj-wnli-mean-tokens")
# Run inference
preds = model("خوبه ولی کیفیت ظروف مناسب نیست")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 3 | 21.3377 | 72 |
Label | Training Sample Count |
---|---|
0 | 7 |
1 | 7 |
2 | 7 |
3 | 7 |
4 | 7 |
5 | 7 |
6 | 7 |
7 | 7 |
8 | 7 |
9 | 7 |
10 | 7 |
Training Hyperparameters
- batch_size: (8, 8)
- num_epochs: (2, 2)
- 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: False
- 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.0015 | 1 | 0.2836 | - |
0.0742 | 50 | 0.2695 | - |
0.1484 | 100 | 0.3017 | - |
0.2226 | 150 | 0.0892 | - |
0.2967 | 200 | 0.0609 | - |
0.3709 | 250 | 0.1121 | - |
0.4451 | 300 | 0.0263 | - |
0.5193 | 350 | 0.0089 | - |
0.5935 | 400 | 0.0072 | - |
0.6677 | 450 | 0.0086 | - |
0.7418 | 500 | 0.0045 | - |
0.8160 | 550 | 0.0039 | - |
0.8902 | 600 | 0.003 | - |
0.9644 | 650 | 0.0006 | - |
1.0 | 674 | - | 0.0285 |
1.0386 | 700 | 0.0011 | - |
1.1128 | 750 | 0.0015 | - |
1.1869 | 800 | 0.0011 | - |
1.2611 | 850 | 0.0011 | - |
1.3353 | 900 | 0.0007 | - |
1.4095 | 950 | 0.0006 | - |
1.4837 | 1000 | 0.0012 | - |
1.5579 | 1050 | 0.0005 | - |
1.6320 | 1100 | 0.0024 | - |
1.7062 | 1150 | 0.0019 | - |
1.7804 | 1200 | 0.0003 | - |
1.8546 | 1250 | 0.0006 | - |
1.9288 | 1300 | 0.0006 | - |
2.0 | 1348 | - | 0.0302 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.10.12
- SetFit: 1.0.1
- Sentence Transformers: 2.2.2
- Transformers: 4.35.2
- PyTorch: 2.1.0+cu121
- Datasets: 2.15.0
- Tokenizers: 0.15.0
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}
}
- Downloads last month
- 5
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.
Model tree for keivan/roberta-zwnj-wnli-mean-tokens
Base model
m3hrdadfi/roberta-zwnj-wnli-mean-tokens