Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_el5 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_el5")How to use mini1013/master_cate_el5 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_el5")
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 |
|
| 5 |
|
| 4 |
|
| 2 |
|
| 12 |
|
| 3 |
|
| 8 |
|
| 10 |
|
| 7 |
|
| 14 |
|
| 1 |
|
| 13 |
|
| 6 |
|
| 9 |
|
| 11 |
|
| 0 |
|
| Label | Metric |
|---|---|
| all | 0.9336 |
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_el5")
# Run inference
preds = model("7102KVM-4K (주)이지넷유비쿼터스")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 8.8470 | 24 |
| Label | Training Sample Count |
|---|---|
| 0 | 4 |
| 1 | 50 |
| 2 | 26 |
| 3 | 50 |
| 4 | 50 |
| 5 | 50 |
| 6 | 50 |
| 7 | 32 |
| 8 | 50 |
| 9 | 50 |
| 10 | 6 |
| 11 | 3 |
| 12 | 50 |
| 13 | 50 |
| 14 | 50 |
| 15 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0102 | 1 | 0.4967 | - |
| 0.5102 | 50 | 0.3039 | - |
| 1.0204 | 100 | 0.1904 | - |
| 1.5306 | 150 | 0.0492 | - |
| 2.0408 | 200 | 0.0328 | - |
| 2.5510 | 250 | 0.0146 | - |
| 3.0612 | 300 | 0.0101 | - |
| 3.5714 | 350 | 0.0137 | - |
| 4.0816 | 400 | 0.0023 | - |
| 4.5918 | 450 | 0.0002 | - |
| 5.1020 | 500 | 0.0001 | - |
| 5.6122 | 550 | 0.0001 | - |
| 6.1224 | 600 | 0.0037 | - |
| 6.6327 | 650 | 0.0001 | - |
| 7.1429 | 700 | 0.0001 | - |
| 7.6531 | 750 | 0.0001 | - |
| 8.1633 | 800 | 0.0039 | - |
| 8.6735 | 850 | 0.0039 | - |
| 9.1837 | 900 | 0.002 | - |
| 9.6939 | 950 | 0.0007 | - |
| 10.2041 | 1000 | 0.0001 | - |
| 10.7143 | 1050 | 0.0001 | - |
| 11.2245 | 1100 | 0.0001 | - |
| 11.7347 | 1150 | 0.0 | - |
| 12.2449 | 1200 | 0.0 | - |
| 12.7551 | 1250 | 0.0002 | - |
| 13.2653 | 1300 | 0.0001 | - |
| 13.7755 | 1350 | 0.0001 | - |
| 14.2857 | 1400 | 0.0 | - |
| 14.7959 | 1450 | 0.0 | - |
| 15.3061 | 1500 | 0.0002 | - |
| 15.8163 | 1550 | 0.0 | - |
| 16.3265 | 1600 | 0.0001 | - |
| 16.8367 | 1650 | 0.0023 | - |
| 17.3469 | 1700 | 0.0 | - |
| 17.8571 | 1750 | 0.0001 | - |
| 18.3673 | 1800 | 0.0001 | - |
| 18.8776 | 1850 | 0.0 | - |
| 19.3878 | 1900 | 0.0 | - |
| 19.8980 | 1950 | 0.0 | - |
@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}
}