Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_el15 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_el15")How to use mini1013/master_cate_el15 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_el15")
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 |
|---|---|
| 10 |
|
| 13 |
|
| 11 |
|
| 8 |
|
| 3 |
|
| 5 |
|
| 12 |
|
| 16 |
|
| 4 |
|
| 17 |
|
| 6 |
|
| 15 |
|
| 0 |
|
| 14 |
|
| 2 |
|
| 1 |
|
| 7 |
|
| 9 |
|
| Label | Metric |
|---|---|
| all | 0.7129 |
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_el15")
# Run inference
preds = model("조아스 전기 이발기 JC-4773 홍운SnC")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 4 | 8.8868 | 24 |
| Label | Training Sample Count |
|---|---|
| 0 | 50 |
| 1 | 3 |
| 2 | 50 |
| 3 | 50 |
| 4 | 50 |
| 5 | 50 |
| 6 | 50 |
| 7 | 3 |
| 8 | 50 |
| 9 | 50 |
| 10 | 50 |
| 11 | 50 |
| 12 | 50 |
| 13 | 50 |
| 14 | 50 |
| 15 | 50 |
| 16 | 39 |
| 17 | 50 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.008 | 1 | 0.4972 | - |
| 0.4 | 50 | 0.3579 | - |
| 0.8 | 100 | 0.2105 | - |
| 1.2 | 150 | 0.0948 | - |
| 1.6 | 200 | 0.0803 | - |
| 2.0 | 250 | 0.0848 | - |
| 2.4 | 300 | 0.0253 | - |
| 2.8 | 350 | 0.0278 | - |
| 3.2 | 400 | 0.023 | - |
| 3.6 | 450 | 0.0113 | - |
| 4.0 | 500 | 0.0098 | - |
| 4.4 | 550 | 0.006 | - |
| 4.8 | 600 | 0.01 | - |
| 5.2 | 650 | 0.0044 | - |
| 5.6 | 700 | 0.0069 | - |
| 6.0 | 750 | 0.0117 | - |
| 6.4 | 800 | 0.004 | - |
| 6.8 | 850 | 0.0004 | - |
| 7.2 | 900 | 0.0023 | - |
| 7.6 | 950 | 0.0023 | - |
| 8.0 | 1000 | 0.0004 | - |
| 8.4 | 1050 | 0.0024 | - |
| 8.8 | 1100 | 0.0003 | - |
| 9.2 | 1150 | 0.001 | - |
| 9.6 | 1200 | 0.0003 | - |
| 10.0 | 1250 | 0.0004 | - |
| 10.4 | 1300 | 0.0002 | - |
| 10.8 | 1350 | 0.0003 | - |
| 11.2 | 1400 | 0.0028 | - |
| 11.6 | 1450 | 0.0002 | - |
| 12.0 | 1500 | 0.0002 | - |
| 12.4 | 1550 | 0.0002 | - |
| 12.8 | 1600 | 0.0002 | - |
| 13.2 | 1650 | 0.0002 | - |
| 13.6 | 1700 | 0.0002 | - |
| 14.0 | 1750 | 0.0001 | - |
| 14.4 | 1800 | 0.0002 | - |
| 14.8 | 1850 | 0.0002 | - |
| 15.2 | 1900 | 0.0012 | - |
| 15.6 | 1950 | 0.0001 | - |
| 16.0 | 2000 | 0.0003 | - |
| 16.4 | 2050 | 0.0001 | - |
| 16.8 | 2100 | 0.0001 | - |
| 17.2 | 2150 | 0.0001 | - |
| 17.6 | 2200 | 0.0005 | - |
| 18.0 | 2250 | 0.0001 | - |
| 18.4 | 2300 | 0.0005 | - |
| 18.8 | 2350 | 0.0001 | - |
| 19.2 | 2400 | 0.0008 | - |
| 19.6 | 2450 | 0.0001 | - |
| 20.0 | 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}
}