Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_lh10 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_lh10")How to use mini1013/master_cate_lh10 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_lh10")
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.0 |
|
| 21.0 |
|
| 14.0 |
|
| 12.0 |
|
| 13.0 |
|
| 3.0 |
|
| 10.0 |
|
| 0.0 |
|
| 2.0 |
|
| 6.0 |
|
| 25.0 |
|
| 16.0 |
|
| 15.0 |
|
| 22.0 |
|
| 11.0 |
|
| 18.0 |
|
| 17.0 |
|
| 23.0 |
|
| 24.0 |
|
| 9.0 |
|
| 7.0 |
|
| 5.0 |
|
| 4.0 |
|
| 8.0 |
|
| Label | Metric |
|---|---|
| all | 0.7383 |
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_lh10")
# Run inference
preds = model("강아지하네스 원피스 꽃무늬 애견가슴줄 애견 공주옷 옷 고양이 그린 연청색_L 고고마트")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 10.0792 | 28 |
| Label | Training Sample Count |
|---|---|
| 0.0 | 50 |
| 1.0 | 50 |
| 2.0 | 50 |
| 3.0 | 50 |
| 4.0 | 50 |
| 5.0 | 50 |
| 6.0 | 50 |
| 7.0 | 50 |
| 8.0 | 50 |
| 9.0 | 50 |
| 10.0 | 50 |
| 11.0 | 50 |
| 12.0 | 50 |
| 13.0 | 50 |
| 14.0 | 50 |
| 15.0 | 50 |
| 16.0 | 50 |
| 17.0 | 50 |
| 18.0 | 50 |
| 21.0 | 50 |
| 22.0 | 50 |
| 23.0 | 50 |
| 24.0 | 50 |
| 25.0 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0053 | 1 | 0.4146 | - |
| 0.2660 | 50 | 0.3778 | - |
| 0.5319 | 100 | 0.315 | - |
| 0.7979 | 150 | 0.2096 | - |
| 1.0638 | 200 | 0.146 | - |
| 1.3298 | 250 | 0.0963 | - |
| 1.5957 | 300 | 0.0549 | - |
| 1.8617 | 350 | 0.049 | - |
| 2.1277 | 400 | 0.0339 | - |
| 2.3936 | 450 | 0.0339 | - |
| 2.6596 | 500 | 0.0322 | - |
| 2.9255 | 550 | 0.0263 | - |
| 3.1915 | 600 | 0.0179 | - |
| 3.4574 | 650 | 0.0202 | - |
| 3.7234 | 700 | 0.0127 | - |
| 3.9894 | 750 | 0.0293 | - |
| 4.2553 | 800 | 0.0116 | - |
| 4.5213 | 850 | 0.0264 | - |
| 4.7872 | 900 | 0.012 | - |
| 5.0532 | 950 | 0.009 | - |
| 5.3191 | 1000 | 0.0139 | - |
| 5.5851 | 1050 | 0.0116 | - |
| 5.8511 | 1100 | 0.024 | - |
| 6.1170 | 1150 | 0.0046 | - |
| 6.3830 | 1200 | 0.0046 | - |
| 6.6489 | 1250 | 0.0081 | - |
| 6.9149 | 1300 | 0.0099 | - |
| 7.1809 | 1350 | 0.0108 | - |
| 7.4468 | 1400 | 0.0006 | - |
| 7.7128 | 1450 | 0.01 | - |
| 7.9787 | 1500 | 0.0098 | - |
| 8.2447 | 1550 | 0.0099 | - |
| 8.5106 | 1600 | 0.0063 | - |
| 8.7766 | 1650 | 0.006 | - |
| 9.0426 | 1700 | 0.0016 | - |
| 9.3085 | 1750 | 0.0054 | - |
| 9.5745 | 1800 | 0.0011 | - |
| 9.8404 | 1850 | 0.0056 | - |
| 10.1064 | 1900 | 0.0095 | - |
| 10.3723 | 1950 | 0.0006 | - |
| 10.6383 | 2000 | 0.0081 | - |
| 10.9043 | 2050 | 0.0002 | - |
| 11.1702 | 2100 | 0.0002 | - |
| 11.4362 | 2150 | 0.0041 | - |
| 11.7021 | 2200 | 0.0021 | - |
| 11.9681 | 2250 | 0.0002 | - |
| 12.2340 | 2300 | 0.0021 | - |
| 12.5 | 2350 | 0.004 | - |
| 12.7660 | 2400 | 0.0002 | - |
| 13.0319 | 2450 | 0.0002 | - |
| 13.2979 | 2500 | 0.0021 | - |
| 13.5638 | 2550 | 0.0012 | - |
| 13.8298 | 2600 | 0.0038 | - |
| 14.0957 | 2650 | 0.0072 | - |
| 14.3617 | 2700 | 0.002 | - |
| 14.6277 | 2750 | 0.0018 | - |
| 14.8936 | 2800 | 0.0018 | - |
| 15.1596 | 2850 | 0.0002 | - |
| 15.4255 | 2900 | 0.0007 | - |
| 15.6915 | 2950 | 0.0003 | - |
| 15.9574 | 3000 | 0.0002 | - |
| 16.2234 | 3050 | 0.0001 | - |
| 16.4894 | 3100 | 0.0001 | - |
| 16.7553 | 3150 | 0.0001 | - |
| 17.0213 | 3200 | 0.0001 | - |
| 17.2872 | 3250 | 0.0001 | - |
| 17.5532 | 3300 | 0.0001 | - |
| 17.8191 | 3350 | 0.0001 | - |
| 18.0851 | 3400 | 0.0001 | - |
| 18.3511 | 3450 | 0.0001 | - |
| 18.6170 | 3500 | 0.0001 | - |
| 18.8830 | 3550 | 0.0001 | - |
| 19.1489 | 3600 | 0.0001 | - |
| 19.4149 | 3650 | 0.0001 | - |
| 19.6809 | 3700 | 0.0001 | - |
| 19.9468 | 3750 | 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}
}