Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_lh15 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_lh15")How to use mini1013/master_cate_lh15 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_lh15")
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 |
|---|---|
| 5.0 |
|
| 4.0 |
|
| 10.0 |
|
| 3.0 |
|
| 12.0 |
|
| 2.0 |
|
| 1.0 |
|
| 8.0 |
|
| 7.0 |
|
| 11.0 |
|
| 0.0 |
|
| 13.0 |
|
| 6.0 |
|
| 9.0 |
|
| Label | Metric |
|---|---|
| all | 0.9032 |
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_lh15")
# Run inference
preds = model("3D 토이나이프 야광 당근칼 틱톡 나이프 피젯 장난감 칼 미니검 3연발 다트권총(핑크) 또와토이")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 10.9546 | 25 |
| Label | Training Sample Count |
|---|---|
| 0.0 | 50 |
| 1.0 | 50 |
| 2.0 | 50 |
| 3.0 | 50 |
| 4.0 | 48 |
| 5.0 | 50 |
| 6.0 | 38 |
| 7.0 | 50 |
| 8.0 | 50 |
| 9.0 | 25 |
| 10.0 | 50 |
| 11.0 | 50 |
| 12.0 | 50 |
| 13.0 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0096 | 1 | 0.4054 | - |
| 0.4808 | 50 | 0.3432 | - |
| 0.9615 | 100 | 0.2163 | - |
| 1.4423 | 150 | 0.0533 | - |
| 1.9231 | 200 | 0.0368 | - |
| 2.4038 | 250 | 0.0235 | - |
| 2.8846 | 300 | 0.0308 | - |
| 3.3654 | 350 | 0.0158 | - |
| 3.8462 | 400 | 0.0122 | - |
| 4.3269 | 450 | 0.0117 | - |
| 4.8077 | 500 | 0.0041 | - |
| 5.2885 | 550 | 0.004 | - |
| 5.7692 | 600 | 0.006 | - |
| 6.25 | 650 | 0.0096 | - |
| 6.7308 | 700 | 0.004 | - |
| 7.2115 | 750 | 0.0002 | - |
| 7.6923 | 800 | 0.0002 | - |
| 8.1731 | 850 | 0.0001 | - |
| 8.6538 | 900 | 0.0001 | - |
| 9.1346 | 950 | 0.0001 | - |
| 9.6154 | 1000 | 0.0001 | - |
| 10.0962 | 1050 | 0.0001 | - |
| 10.5769 | 1100 | 0.0001 | - |
| 11.0577 | 1150 | 0.0001 | - |
| 11.5385 | 1200 | 0.0 | - |
| 12.0192 | 1250 | 0.0001 | - |
| 12.5 | 1300 | 0.0001 | - |
| 12.9808 | 1350 | 0.0001 | - |
| 13.4615 | 1400 | 0.0001 | - |
| 13.9423 | 1450 | 0.0 | - |
| 14.4231 | 1500 | 0.0 | - |
| 14.9038 | 1550 | 0.0 | - |
| 15.3846 | 1600 | 0.0 | - |
| 15.8654 | 1650 | 0.0 | - |
| 16.3462 | 1700 | 0.0001 | - |
| 16.8269 | 1750 | 0.0 | - |
| 17.3077 | 1800 | 0.0 | - |
| 17.7885 | 1850 | 0.0 | - |
| 18.2692 | 1900 | 0.0 | - |
| 18.75 | 1950 | 0.0 | - |
| 19.2308 | 2000 | 0.0 | - |
| 19.7115 | 2050 | 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}
}