metadata
library_name: setfit
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
metrics:
- accuracy
widget:
- text: Tiong Bahru Plaza, DDC-L2-5, AHU-L2-03 trip alarm
- text: >-
Tiong Bahru Plaza, DDC L4-1, PAU-L4-03 supply air temperature (Units:
°C).2
- text: Tiong Bahru Plaza, DDC-L20, AHU 20-1 VSD CONTROL
- text: 'Tiong Bahru Plaza, VAV 19-7, Discharge Air Flow (Units: m3/h)'
- text: Tiong Bahru Plaza, DDC-L2-5, PAU-L2-02 VSD control
pipeline_tag: text-classification
inference: true
base_model: sentence-transformers/paraphrase-MiniLM-L3-v2
model-index:
- name: SetFit with sentence-transformers/paraphrase-MiniLM-L3-v2
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: Unknown
type: unknown
split: test
metrics:
- type: accuracy
value: 0.9777227722772277
name: Accuracy
SetFit with sentence-transformers/paraphrase-MiniLM-L3-v2
This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/paraphrase-MiniLM-L3-v2 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: sentence-transformers/paraphrase-MiniLM-L3-v2
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 128 tokens
- Number of Classes: 44 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 |
---|---|
2 |
|
32 |
|
1 |
|
30 |
|
42 |
|
13 |
|
35 |
|
21 |
|
19 |
|
14 |
|
20 |
|
12 |
|
39 |
|
0 |
|
9 |
|
18 |
|
16 |
|
8 |
|
3 |
|
28 |
|
10 |
|
38 |
|
43 |
|
36 |
|
31 |
|
26 |
|
27 |
|
37 |
|
34 |
|
29 |
|
11 |
|
7 |
|
22 |
|
4 |
|
15 |
|
25 |
|
23 |
|
41 |
|
17 |
|
5 |
|
40 |
|
33 |
|
24 |
|
6 |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.9777 |
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("Varun1010/all-MiniLM-L6-v2-polaris-tiaongBaruPlaza")
# Run inference
preds = model("Tiong Bahru Plaza, DDC-L20, AHU 20-1 VSD CONTROL")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 3 | 8.6310 | 12 |
Label | Training Sample Count |
---|---|
0 | 2 |
1 | 2 |
2 | 2 |
3 | 2 |
4 | 2 |
5 | 2 |
6 | 2 |
7 | 2 |
8 | 2 |
9 | 2 |
10 | 2 |
11 | 2 |
12 | 2 |
13 | 2 |
14 | 2 |
15 | 2 |
16 | 2 |
17 | 2 |
18 | 2 |
19 | 2 |
20 | 2 |
21 | 2 |
22 | 2 |
23 | 1 |
24 | 1 |
25 | 2 |
26 | 2 |
27 | 2 |
28 | 2 |
29 | 2 |
30 | 2 |
31 | 2 |
32 | 2 |
33 | 2 |
34 | 2 |
35 | 2 |
36 | 2 |
37 | 2 |
38 | 2 |
39 | 2 |
40 | 1 |
41 | 1 |
42 | 2 |
43 | 2 |
Training Hyperparameters
- batch_size: (64, 64)
- num_epochs: (5, 5)
- 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: False
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0093 | 1 | 0.1514 | - |
0.4630 | 50 | 0.0387 | - |
0.9259 | 100 | 0.0369 | - |
1.3889 | 150 | 0.014 | - |
1.8519 | 200 | 0.0161 | - |
2.3148 | 250 | 0.018 | - |
2.7778 | 300 | 0.0181 | - |
3.2407 | 350 | 0.0156 | - |
3.7037 | 400 | 0.0145 | - |
4.1667 | 450 | 0.0186 | - |
4.6296 | 500 | 0.0124 | - |
Framework Versions
- Python: 3.10.12
- SetFit: 1.0.3
- Sentence Transformers: 2.6.1
- Transformers: 4.38.2
- PyTorch: 2.2.1+cu121
- Datasets: 2.18.0
- Tokenizers: 0.15.2
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}
}