Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use mini1013/master_cate_lh2 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("mini1013/master_cate_lh2")How to use mini1013/master_cate_lh2 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("mini1013/master_cate_lh2")
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 |
|---|---|
| 1.0 |
|
| 18.0 |
|
| 5.0 |
|
| 4.0 |
|
| 14.0 |
|
| 8.0 |
|
| 0.0 |
|
| 6.0 |
|
| 12.0 |
|
| 11.0 |
|
| 2.0 |
|
| 15.0 |
|
| 16.0 |
|
| 3.0 |
|
| 7.0 |
|
| 17.0 |
|
| 9.0 |
|
| 10.0 |
|
| 13.0 |
|
| Label | Metric |
|---|---|
| all | 0.6114 |
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_lh2")
# Run inference
preds = model("토네이도 다이아몬드 융착코어비트 폴리싱 대리석 천공 TQ5 57_TTC 17 주식회사 투엑스")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 10.7474 | 27 |
| 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 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0067 | 1 | 0.3954 | - |
| 0.3356 | 50 | 0.3839 | - |
| 0.6711 | 100 | 0.2913 | - |
| 1.0067 | 150 | 0.2101 | - |
| 1.3423 | 200 | 0.1066 | - |
| 1.6779 | 250 | 0.0475 | - |
| 2.0134 | 300 | 0.0342 | - |
| 2.3490 | 350 | 0.0274 | - |
| 2.6846 | 400 | 0.028 | - |
| 3.0201 | 450 | 0.029 | - |
| 3.3557 | 500 | 0.0291 | - |
| 3.6913 | 550 | 0.0258 | - |
| 4.0268 | 600 | 0.0202 | - |
| 4.3624 | 650 | 0.0085 | - |
| 4.6980 | 700 | 0.0124 | - |
| 5.0336 | 750 | 0.0039 | - |
| 5.3691 | 800 | 0.0089 | - |
| 5.7047 | 850 | 0.0063 | - |
| 6.0403 | 900 | 0.0034 | - |
| 6.3758 | 950 | 0.0046 | - |
| 6.7114 | 1000 | 0.008 | - |
| 7.0470 | 1050 | 0.0048 | - |
| 7.3826 | 1100 | 0.0028 | - |
| 7.7181 | 1150 | 0.0042 | - |
| 8.0537 | 1200 | 0.0019 | - |
| 8.3893 | 1250 | 0.0008 | - |
| 8.7248 | 1300 | 0.0004 | - |
| 9.0604 | 1350 | 0.0003 | - |
| 9.3960 | 1400 | 0.0003 | - |
| 9.7315 | 1450 | 0.0002 | - |
| 10.0671 | 1500 | 0.0003 | - |
| 10.4027 | 1550 | 0.0002 | - |
| 10.7383 | 1600 | 0.0001 | - |
| 11.0738 | 1650 | 0.0002 | - |
| 11.4094 | 1700 | 0.0001 | - |
| 11.7450 | 1750 | 0.0001 | - |
| 12.0805 | 1800 | 0.0001 | - |
| 12.4161 | 1850 | 0.0001 | - |
| 12.7517 | 1900 | 0.0001 | - |
| 13.0872 | 1950 | 0.0001 | - |
| 13.4228 | 2000 | 0.0001 | - |
| 13.7584 | 2050 | 0.0001 | - |
| 14.0940 | 2100 | 0.0001 | - |
| 14.4295 | 2150 | 0.0001 | - |
| 14.7651 | 2200 | 0.0001 | - |
| 15.1007 | 2250 | 0.0001 | - |
| 15.4362 | 2300 | 0.0001 | - |
| 15.7718 | 2350 | 0.0001 | - |
| 16.1074 | 2400 | 0.0001 | - |
| 16.4430 | 2450 | 0.0001 | - |
| 16.7785 | 2500 | 0.0001 | - |
| 17.1141 | 2550 | 0.0001 | - |
| 17.4497 | 2600 | 0.0001 | - |
| 17.7852 | 2650 | 0.0001 | - |
| 18.1208 | 2700 | 0.0001 | - |
| 18.4564 | 2750 | 0.0001 | - |
| 18.7919 | 2800 | 0.0001 | - |
| 19.1275 | 2850 | 0.0001 | - |
| 19.4631 | 2900 | 0.0001 | - |
| 19.7987 | 2950 | 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}
}