Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_ap3 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_ap3")How to use mini1013/master_cate_ap3 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_ap3")
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.0 |
|
| 5.0 |
|
| 7.0 |
|
| 10.0 |
|
| 3.0 |
|
| 0.0 |
|
| 16.0 |
|
| 4.0 |
|
| 20.0 |
|
| 11.0 |
|
| 17.0 |
|
| 18.0 |
|
| 2.0 |
|
| 19.0 |
|
| 14.0 |
|
| 12.0 |
|
| 13.0 |
|
| 6.0 |
|
| 9.0 |
|
| 1.0 |
|
| 8.0 |
|
| Label | Metric |
|---|---|
| all | 0.7890 |
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_ap3")
# Run inference
preds = model("(SOUP)(신세계마산점)숲 라이더형 무스탕 (SZBMU90) 블랙_66 신세계백화점")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 9.6448 | 23 |
| 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 |
| 20.0 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0061 | 1 | 0.3795 | - |
| 0.3030 | 50 | 0.296 | - |
| 0.6061 | 100 | 0.2248 | - |
| 0.9091 | 150 | 0.1494 | - |
| 1.2121 | 200 | 0.0913 | - |
| 1.5152 | 250 | 0.061 | - |
| 1.8182 | 300 | 0.0322 | - |
| 2.1212 | 350 | 0.0243 | - |
| 2.4242 | 400 | 0.0152 | - |
| 2.7273 | 450 | 0.0134 | - |
| 3.0303 | 500 | 0.0056 | - |
| 3.3333 | 550 | 0.0026 | - |
| 3.6364 | 600 | 0.0016 | - |
| 3.9394 | 650 | 0.0066 | - |
| 4.2424 | 700 | 0.0044 | - |
| 4.5455 | 750 | 0.0025 | - |
| 4.8485 | 800 | 0.0023 | - |
| 5.1515 | 850 | 0.0023 | - |
| 5.4545 | 900 | 0.0008 | - |
| 5.7576 | 950 | 0.0023 | - |
| 6.0606 | 1000 | 0.0005 | - |
| 6.3636 | 1050 | 0.0015 | - |
| 6.6667 | 1100 | 0.0006 | - |
| 6.9697 | 1150 | 0.0003 | - |
| 7.2727 | 1200 | 0.0003 | - |
| 7.5758 | 1250 | 0.0003 | - |
| 7.8788 | 1300 | 0.0002 | - |
| 8.1818 | 1350 | 0.0004 | - |
| 8.4848 | 1400 | 0.0002 | - |
| 8.7879 | 1450 | 0.0002 | - |
| 9.0909 | 1500 | 0.0002 | - |
| 9.3939 | 1550 | 0.0002 | - |
| 9.6970 | 1600 | 0.0001 | - |
| 10.0 | 1650 | 0.0001 | - |
| 10.3030 | 1700 | 0.0002 | - |
| 10.6061 | 1750 | 0.0001 | - |
| 10.9091 | 1800 | 0.0001 | - |
| 11.2121 | 1850 | 0.0002 | - |
| 11.5152 | 1900 | 0.0002 | - |
| 11.8182 | 1950 | 0.0002 | - |
| 12.1212 | 2000 | 0.0001 | - |
| 12.4242 | 2050 | 0.0001 | - |
| 12.7273 | 2100 | 0.0001 | - |
| 13.0303 | 2150 | 0.0001 | - |
| 13.3333 | 2200 | 0.0001 | - |
| 13.6364 | 2250 | 0.0001 | - |
| 13.9394 | 2300 | 0.0001 | - |
| 14.2424 | 2350 | 0.0001 | - |
| 14.5455 | 2400 | 0.0001 | - |
| 14.8485 | 2450 | 0.0001 | - |
| 15.1515 | 2500 | 0.0001 | - |
| 15.4545 | 2550 | 0.0001 | - |
| 15.7576 | 2600 | 0.0001 | - |
| 16.0606 | 2650 | 0.0001 | - |
| 16.3636 | 2700 | 0.0001 | - |
| 16.6667 | 2750 | 0.0001 | - |
| 16.9697 | 2800 | 0.0001 | - |
| 17.2727 | 2850 | 0.0001 | - |
| 17.5758 | 2900 | 0.0001 | - |
| 17.8788 | 2950 | 0.0001 | - |
| 18.1818 | 3000 | 0.0001 | - |
| 18.4848 | 3050 | 0.0001 | - |
| 18.7879 | 3100 | 0.0001 | - |
| 19.0909 | 3150 | 0.0001 | - |
| 19.3939 | 3200 | 0.0001 | - |
| 19.6970 | 3250 | 0.0001 | - |
| 20.0 | 3300 | 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}
}