Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_ac15 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_ac15")How to use mini1013/master_cate_ac15 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_ac15")
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 |
|---|---|
| 19.0 |
|
| 18.0 |
|
| 17.0 |
|
| 2.0 |
|
| 12.0 |
|
| 5.0 |
|
| 16.0 |
|
| 11.0 |
|
| 9.0 |
|
| 1.0 |
|
| 8.0 |
|
| 15.0 |
|
| 0.0 |
|
| 6.0 |
|
| 10.0 |
|
| 4.0 |
|
| 13.0 |
|
| 3.0 |
|
| 14.0 |
|
| 7.0 |
|
| Label | Metric |
|---|---|
| all | 0.8557 |
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_ac15")
# Run inference
preds = model("고급 골지압박 타이즈 스타킹 유발 면 겨울 베이지 버징가마켓")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 10.322 | 25 |
| 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 |
| 19.0 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0064 | 1 | 0.3967 | - |
| 0.3185 | 50 | 0.3383 | - |
| 0.6369 | 100 | 0.2365 | - |
| 0.9554 | 150 | 0.1145 | - |
| 1.2739 | 200 | 0.0563 | - |
| 1.5924 | 250 | 0.0414 | - |
| 1.9108 | 300 | 0.0377 | - |
| 2.2293 | 350 | 0.0159 | - |
| 2.5478 | 400 | 0.0297 | - |
| 2.8662 | 450 | 0.0258 | - |
| 3.1847 | 500 | 0.0194 | - |
| 3.5032 | 550 | 0.0113 | - |
| 3.8217 | 600 | 0.0108 | - |
| 4.1401 | 650 | 0.0059 | - |
| 4.4586 | 700 | 0.0009 | - |
| 4.7771 | 750 | 0.0059 | - |
| 5.0955 | 800 | 0.0044 | - |
| 5.4140 | 850 | 0.004 | - |
| 5.7325 | 900 | 0.0023 | - |
| 6.0510 | 950 | 0.0004 | - |
| 6.3694 | 1000 | 0.0024 | - |
| 6.6879 | 1050 | 0.0007 | - |
| 7.0064 | 1100 | 0.0004 | - |
| 7.3248 | 1150 | 0.0002 | - |
| 7.6433 | 1200 | 0.0002 | - |
| 7.9618 | 1250 | 0.0003 | - |
| 8.2803 | 1300 | 0.0002 | - |
| 8.5987 | 1350 | 0.0001 | - |
| 8.9172 | 1400 | 0.0001 | - |
| 9.2357 | 1450 | 0.0001 | - |
| 9.5541 | 1500 | 0.0001 | - |
| 9.8726 | 1550 | 0.0001 | - |
| 10.1911 | 1600 | 0.0001 | - |
| 10.5096 | 1650 | 0.0001 | - |
| 10.8280 | 1700 | 0.0001 | - |
| 11.1465 | 1750 | 0.0001 | - |
| 11.4650 | 1800 | 0.0001 | - |
| 11.7834 | 1850 | 0.0001 | - |
| 12.1019 | 1900 | 0.0001 | - |
| 12.4204 | 1950 | 0.0001 | - |
| 12.7389 | 2000 | 0.0001 | - |
| 13.0573 | 2050 | 0.0001 | - |
| 13.3758 | 2100 | 0.0001 | - |
| 13.6943 | 2150 | 0.0001 | - |
| 14.0127 | 2200 | 0.0001 | - |
| 14.3312 | 2250 | 0.0001 | - |
| 14.6497 | 2300 | 0.0001 | - |
| 14.9682 | 2350 | 0.0001 | - |
| 15.2866 | 2400 | 0.0001 | - |
| 15.6051 | 2450 | 0.0001 | - |
| 15.9236 | 2500 | 0.0001 | - |
| 16.2420 | 2550 | 0.0001 | - |
| 16.5605 | 2600 | 0.0001 | - |
| 16.8790 | 2650 | 0.0001 | - |
| 17.1975 | 2700 | 0.0001 | - |
| 17.5159 | 2750 | 0.0001 | - |
| 17.8344 | 2800 | 0.0001 | - |
| 18.1529 | 2850 | 0.0001 | - |
| 18.4713 | 2900 | 0.0001 | - |
| 18.7898 | 2950 | 0.0001 | - |
| 19.1083 | 3000 | 0.0001 | - |
| 19.4268 | 3050 | 0.0001 | - |
| 19.7452 | 3100 | 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}
}