Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_el20 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_el20")How to use mini1013/master_cate_el20 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_el20")
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 |
|---|---|
| 1 |
|
| 18 |
|
| 5 |
|
| 4 |
|
| 14 |
|
| 8 |
|
| 0 |
|
| 6 |
|
| 12 |
|
| 11 |
|
| 2 |
|
| 15 |
|
| 16 |
|
| 3 |
|
| 7 |
|
| 17 |
|
| 9 |
|
| 10 |
|
| 13 |
|
| Label | Metric |
|---|---|
| all | 0.8190 |
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_el20")
# Run inference
preds = model("185CM 카메라 스마트폰 삼각대 SEL-ML185K 주식회사 셀루미")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 9.9389 | 25 |
| Label | Training Sample Count |
|---|---|
| 0 | 50 |
| 1 | 50 |
| 2 | 50 |
| 3 | 50 |
| 4 | 50 |
| 5 | 50 |
| 6 | 50 |
| 7 | 50 |
| 8 | 50 |
| 9 | 50 |
| 10 | 50 |
| 11 | 50 |
| 12 | 50 |
| 13 | 50 |
| 14 | 50 |
| 15 | 50 |
| 16 | 50 |
| 17 | 50 |
| 18 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0067 | 1 | 0.4972 | - |
| 0.3356 | 50 | 0.3162 | - |
| 0.6711 | 100 | 0.178 | - |
| 1.0067 | 150 | 0.1148 | - |
| 1.3423 | 200 | 0.0596 | - |
| 1.6779 | 250 | 0.0503 | - |
| 2.0134 | 300 | 0.0288 | - |
| 2.3490 | 350 | 0.03 | - |
| 2.6846 | 400 | 0.0227 | - |
| 3.0201 | 450 | 0.0219 | - |
| 3.3557 | 500 | 0.022 | - |
| 3.6913 | 550 | 0.0127 | - |
| 4.0268 | 600 | 0.007 | - |
| 4.3624 | 650 | 0.0098 | - |
| 4.6980 | 700 | 0.0037 | - |
| 5.0336 | 750 | 0.0044 | - |
| 5.3691 | 800 | 0.0041 | - |
| 5.7047 | 850 | 0.0003 | - |
| 6.0403 | 900 | 0.0022 | - |
| 6.3758 | 950 | 0.0002 | - |
| 6.7114 | 1000 | 0.0053 | - |
| 7.0470 | 1050 | 0.0006 | - |
| 7.3826 | 1100 | 0.0006 | - |
| 7.7181 | 1150 | 0.0003 | - |
| 8.0537 | 1200 | 0.0002 | - |
| 8.3893 | 1250 | 0.0002 | - |
| 8.7248 | 1300 | 0.0002 | - |
| 9.0604 | 1350 | 0.0002 | - |
| 9.3960 | 1400 | 0.0002 | - |
| 9.7315 | 1450 | 0.0001 | - |
| 10.0671 | 1500 | 0.0002 | - |
| 10.4027 | 1550 | 0.0002 | - |
| 10.7383 | 1600 | 0.0001 | - |
| 11.0738 | 1650 | 0.0002 | - |
| 11.4094 | 1700 | 0.0001 | - |
| 11.7450 | 1750 | 0.0001 | - |
| 12.0805 | 1800 | 0.0001 | - |
| 12.4161 | 1850 | 0.0001 | - |
| 12.7517 | 1900 | 0.0001 | - |
| 13.0872 | 1950 | 0.0001 | - |
| 13.4228 | 2000 | 0.0001 | - |
| 13.7584 | 2050 | 0.0001 | - |
| 14.0940 | 2100 | 0.0001 | - |
| 14.4295 | 2150 | 0.0001 | - |
| 14.7651 | 2200 | 0.0001 | - |
| 15.1007 | 2250 | 0.0001 | - |
| 15.4362 | 2300 | 0.0001 | - |
| 15.7718 | 2350 | 0.0001 | - |
| 16.1074 | 2400 | 0.0001 | - |
| 16.4430 | 2450 | 0.0001 | - |
| 16.7785 | 2500 | 0.0001 | - |
| 17.1141 | 2550 | 0.0001 | - |
| 17.4497 | 2600 | 0.0001 | - |
| 17.7852 | 2650 | 0.0001 | - |
| 18.1208 | 2700 | 0.0001 | - |
| 18.4564 | 2750 | 0.0001 | - |
| 18.7919 | 2800 | 0.0001 | - |
| 19.1275 | 2850 | 0.0001 | - |
| 19.4631 | 2900 | 0.0001 | - |
| 19.7987 | 2950 | 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}
}