Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_el25 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_el25")How to use mini1013/master_cate_el25 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_el25")
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 |
|---|---|
| 15 |
|
| 9 |
|
| 8 |
|
| 11 |
|
| 14 |
|
| 3 |
|
| 7 |
|
| 4 |
|
| 13 |
|
| 2 |
|
| 0 |
|
| 1 |
|
| 6 |
|
| 10 |
|
| 5 |
|
| 12 |
|
| Label | Metric |
|---|---|
| all | 0.9269 |
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_el25")
# Run inference
preds = model("갤럭시워치5 44mm 9H 액정보호 강화유리필름 2매 MinSellAmount 하이애드")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 4 | 11.0114 | 27 |
| Label | Training Sample Count |
|---|---|
| 0 | 50 |
| 1 | 50 |
| 2 | 50 |
| 3 | 50 |
| 4 | 50 |
| 5 | 7 |
| 6 | 50 |
| 7 | 29 |
| 8 | 50 |
| 9 | 50 |
| 10 | 13 |
| 11 | 50 |
| 12 | 50 |
| 13 | 50 |
| 14 | 50 |
| 15 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0091 | 1 | 0.4972 | - |
| 0.4545 | 50 | 0.2762 | - |
| 0.9091 | 100 | 0.1381 | - |
| 1.3636 | 150 | 0.0883 | - |
| 1.8182 | 200 | 0.0328 | - |
| 2.2727 | 250 | 0.0061 | - |
| 2.7273 | 300 | 0.0009 | - |
| 3.1818 | 350 | 0.0005 | - |
| 3.6364 | 400 | 0.0004 | - |
| 4.0909 | 450 | 0.0003 | - |
| 4.5455 | 500 | 0.0022 | - |
| 5.0 | 550 | 0.0002 | - |
| 5.4545 | 600 | 0.0002 | - |
| 5.9091 | 650 | 0.0002 | - |
| 6.3636 | 700 | 0.0002 | - |
| 6.8182 | 750 | 0.0002 | - |
| 7.2727 | 800 | 0.0001 | - |
| 7.7273 | 850 | 0.0021 | - |
| 8.1818 | 900 | 0.0001 | - |
| 8.6364 | 950 | 0.0001 | - |
| 9.0909 | 1000 | 0.0001 | - |
| 9.5455 | 1050 | 0.0001 | - |
| 10.0 | 1100 | 0.0001 | - |
| 10.4545 | 1150 | 0.0001 | - |
| 10.9091 | 1200 | 0.0001 | - |
| 11.3636 | 1250 | 0.0001 | - |
| 11.8182 | 1300 | 0.0001 | - |
| 12.2727 | 1350 | 0.002 | - |
| 12.7273 | 1400 | 0.0001 | - |
| 13.1818 | 1450 | 0.0001 | - |
| 13.6364 | 1500 | 0.0001 | - |
| 14.0909 | 1550 | 0.0001 | - |
| 14.5455 | 1600 | 0.0001 | - |
| 15.0 | 1650 | 0.0001 | - |
| 15.4545 | 1700 | 0.0001 | - |
| 15.9091 | 1750 | 0.0001 | - |
| 16.3636 | 1800 | 0.002 | - |
| 16.8182 | 1850 | 0.002 | - |
| 17.2727 | 1900 | 0.0001 | - |
| 17.7273 | 1950 | 0.0001 | - |
| 18.1818 | 2000 | 0.0001 | - |
| 18.6364 | 2050 | 0.0001 | - |
| 19.0909 | 2100 | 0.0001 | - |
| 19.5455 | 2150 | 0.0001 | - |
| 20.0 | 2200 | 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}
}