Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_el11 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_el11")How to use mini1013/master_cate_el11 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_el11")
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 |
|
| 4 |
|
| 16 |
|
| 14 |
|
| 11 |
|
| 3 |
|
| 13 |
|
| 15 |
|
| 6 |
|
| 2 |
|
| 9 |
|
| 5 |
|
| 12 |
|
| 7 |
|
| 0 |
|
| 17 |
|
| 8 |
|
| 10 |
|
| Label | Metric |
|---|---|
| all | 0.7946 |
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_el11")
# Run inference
preds = model("ALLNEW29000 파워메이드_그레이(GRAY) 나성민")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 9.3700 | 32 |
| Label | Training Sample Count |
|---|---|
| 0 | 50 |
| 1 | 50 |
| 2 | 50 |
| 3 | 50 |
| 4 | 50 |
| 5 | 50 |
| 6 | 50 |
| 7 | 50 |
| 8 | 5 |
| 9 | 50 |
| 10 | 3 |
| 11 | 50 |
| 12 | 50 |
| 13 | 50 |
| 14 | 50 |
| 15 | 50 |
| 16 | 50 |
| 17 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0079 | 1 | 0.4968 | - |
| 0.3937 | 50 | 0.3206 | - |
| 0.7874 | 100 | 0.1406 | - |
| 1.1811 | 150 | 0.0735 | - |
| 1.5748 | 200 | 0.0518 | - |
| 1.9685 | 250 | 0.0242 | - |
| 2.3622 | 300 | 0.006 | - |
| 2.7559 | 350 | 0.0102 | - |
| 3.1496 | 400 | 0.0088 | - |
| 3.5433 | 450 | 0.0082 | - |
| 3.9370 | 500 | 0.0062 | - |
| 4.3307 | 550 | 0.012 | - |
| 4.7244 | 600 | 0.0021 | - |
| 5.1181 | 650 | 0.002 | - |
| 5.5118 | 700 | 0.0049 | - |
| 5.9055 | 750 | 0.0043 | - |
| 6.2992 | 800 | 0.006 | - |
| 6.6929 | 850 | 0.0002 | - |
| 7.0866 | 900 | 0.0004 | - |
| 7.4803 | 950 | 0.0002 | - |
| 7.8740 | 1000 | 0.0002 | - |
| 8.2677 | 1050 | 0.0002 | - |
| 8.6614 | 1100 | 0.0001 | - |
| 9.0551 | 1150 | 0.0001 | - |
| 9.4488 | 1200 | 0.0002 | - |
| 9.8425 | 1250 | 0.0002 | - |
| 10.2362 | 1300 | 0.0001 | - |
| 10.6299 | 1350 | 0.0001 | - |
| 11.0236 | 1400 | 0.0001 | - |
| 11.4173 | 1450 | 0.0001 | - |
| 11.8110 | 1500 | 0.0001 | - |
| 12.2047 | 1550 | 0.0001 | - |
| 12.5984 | 1600 | 0.0001 | - |
| 12.9921 | 1650 | 0.0001 | - |
| 13.3858 | 1700 | 0.0001 | - |
| 13.7795 | 1750 | 0.0001 | - |
| 14.1732 | 1800 | 0.0001 | - |
| 14.5669 | 1850 | 0.0001 | - |
| 14.9606 | 1900 | 0.0001 | - |
| 15.3543 | 1950 | 0.0001 | - |
| 15.7480 | 2000 | 0.0001 | - |
| 16.1417 | 2050 | 0.0001 | - |
| 16.5354 | 2100 | 0.0001 | - |
| 16.9291 | 2150 | 0.0001 | - |
| 17.3228 | 2200 | 0.0001 | - |
| 17.7165 | 2250 | 0.0001 | - |
| 18.1102 | 2300 | 0.0001 | - |
| 18.5039 | 2350 | 0.0001 | - |
| 18.8976 | 2400 | 0.0001 | - |
| 19.2913 | 2450 | 0.0001 | - |
| 19.6850 | 2500 | 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}
}