Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_lh0 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_lh0")How to use mini1013/master_cate_lh0 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_lh0")
sentences = [
"The weather is lovely today.",
"It's so sunny outside!",
"He drove to the stadium."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]This is a SetFit model that can be used for Text Classification. This SetFit model uses mini1013/master_domain 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:
| Label | Examples |
|---|---|
| 4.0 |
|
| 9.0 |
|
| 14.0 |
|
| 12.0 |
|
| 5.0 |
|
| 8.0 |
|
| 16.0 |
|
| 6.0 |
|
| 13.0 |
|
| 3.0 |
|
| 1.0 |
|
| 10.0 |
|
| 2.0 |
|
| 0.0 |
|
| 15.0 |
|
| 11.0 |
|
| 7.0 |
|
| Label | Metric |
|---|---|
| all | 0.9110 |
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("mini1013/master_cate_lh0")
# Run inference
preds = model("부푸 브이메이트맥스 액상입호흡입문전자담배 오닉스블랙 토이베이프")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 10.4659 | 31 |
| Label | Training Sample Count |
|---|---|
| 0.0 | 50 |
| 1.0 | 50 |
| 2.0 | 25 |
| 3.0 | 50 |
| 4.0 | 50 |
| 5.0 | 50 |
| 6.0 | 50 |
| 7.0 | 50 |
| 8.0 | 50 |
| 9.0 | 50 |
| 10.0 | 28 |
| 11.0 | 50 |
| 12.0 | 24 |
| 13.0 | 50 |
| 14.0 | 50 |
| 15.0 | 50 |
| 16.0 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0082 | 1 | 0.4305 | - |
| 0.4098 | 50 | 0.347 | - |
| 0.8197 | 100 | 0.1694 | - |
| 1.2295 | 150 | 0.0708 | - |
| 1.6393 | 200 | 0.0363 | - |
| 2.0492 | 250 | 0.0314 | - |
| 2.4590 | 300 | 0.0411 | - |
| 2.8689 | 350 | 0.0414 | - |
| 3.2787 | 400 | 0.0175 | - |
| 3.6885 | 450 | 0.0267 | - |
| 4.0984 | 500 | 0.0184 | - |
| 4.5082 | 550 | 0.0085 | - |
| 4.9180 | 600 | 0.0185 | - |
| 5.3279 | 650 | 0.0094 | - |
| 5.7377 | 700 | 0.0022 | - |
| 6.1475 | 750 | 0.0078 | - |
| 6.5574 | 800 | 0.0104 | - |
| 6.9672 | 850 | 0.004 | - |
| 7.3770 | 900 | 0.0081 | - |
| 7.7869 | 950 | 0.0058 | - |
| 8.1967 | 1000 | 0.0045 | - |
| 8.6066 | 1050 | 0.0021 | - |
| 9.0164 | 1100 | 0.0079 | - |
| 9.4262 | 1150 | 0.0021 | - |
| 9.8361 | 1200 | 0.0002 | - |
| 10.2459 | 1250 | 0.0001 | - |
| 10.6557 | 1300 | 0.0001 | - |
| 11.0656 | 1350 | 0.0001 | - |
| 11.4754 | 1400 | 0.002 | - |
| 11.8852 | 1450 | 0.0002 | - |
| 12.2951 | 1500 | 0.0039 | - |
| 12.7049 | 1550 | 0.0001 | - |
| 13.1148 | 1600 | 0.0001 | - |
| 13.5246 | 1650 | 0.002 | - |
| 13.9344 | 1700 | 0.0005 | - |
| 14.3443 | 1750 | 0.0002 | - |
| 14.7541 | 1800 | 0.0001 | - |
| 15.1639 | 1850 | 0.0001 | - |
| 15.5738 | 1900 | 0.0001 | - |
| 15.9836 | 1950 | 0.0001 | - |
| 16.3934 | 2000 | 0.0001 | - |
| 16.8033 | 2050 | 0.0001 | - |
| 17.2131 | 2100 | 0.0001 | - |
| 17.6230 | 2150 | 0.0001 | - |
| 18.0328 | 2200 | 0.0001 | - |
| 18.4426 | 2250 | 0.0001 | - |
| 18.8525 | 2300 | 0.0001 | - |
| 19.2623 | 2350 | 0.0 | - |
| 19.6721 | 2400 | 0.0001 | - |
@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}
}