Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use ryeyoo/sentimentizer-router with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("ryeyoo/sentimentizer-router")How to use ryeyoo/sentimentizer-router with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("ryeyoo/sentimentizer-router")
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. A NoneType instance is used for classification.
The model has been trained using an efficient few-shot learning technique that involves:
| Label | Examples |
|---|---|
| general |
|
| service |
|
| dietary |
|
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("setfit_model_id")
# Run inference
preds = model("Way too loud to chat comfortably.")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 4 | 12.6582 | 28 |
| Label | Training Sample Count |
|---|---|
| dietary | 367 |
| service | 416 |
| general | 399 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0003 | 1 | 0.2153 | - |
| 0.0169 | 50 | 0.1885 | - |
| 0.0338 | 100 | 0.0788 | - |
| 0.0508 | 150 | 0.0191 | - |
| 0.0677 | 200 | 0.0100 | - |
| 0.0846 | 250 | 0.0057 | - |
| 0.1015 | 300 | 0.0033 | - |
| 0.1184 | 350 | 0.0024 | - |
| 0.1354 | 400 | 0.0020 | - |
| 0.1523 | 450 | 0.0018 | - |
| 0.1692 | 500 | 0.0016 | - |
| 0.1861 | 550 | 0.0016 | - |
| 0.2030 | 600 | 0.0015 | - |
| 0.2200 | 650 | 0.0014 | - |
| 0.2369 | 700 | 0.0014 | - |
| 0.2538 | 750 | 0.0013 | - |
| 0.2707 | 800 | 0.0012 | - |
| 0.2876 | 850 | 0.0012 | - |
| 0.3046 | 900 | 0.0011 | - |
| 0.3215 | 950 | 0.0011 | - |
| 0.3384 | 1000 | 0.0011 | - |
| 0.3553 | 1050 | 0.0011 | - |
| 0.3723 | 1100 | 0.0010 | - |
| 0.3892 | 1150 | 0.0010 | - |
| 0.4061 | 1200 | 0.0010 | - |
| 0.4230 | 1250 | 0.0009 | - |
| 0.4399 | 1300 | 0.0009 | - |
| 0.4569 | 1350 | 0.0009 | - |
| 0.4738 | 1400 | 0.0008 | - |
| 0.4907 | 1450 | 0.0009 | - |
| 0.5076 | 1500 | 0.0008 | - |
| 0.5245 | 1550 | 0.0009 | - |
| 0.5415 | 1600 | 0.0008 | - |
| 0.5584 | 1650 | 0.0008 | - |
| 0.5753 | 1700 | 0.0008 | - |
| 0.5922 | 1750 | 0.0008 | - |
| 0.6091 | 1800 | 0.0008 | - |
| 0.6261 | 1850 | 0.0008 | - |
| 0.6430 | 1900 | 0.0008 | - |
| 0.6599 | 1950 | 0.0007 | - |
| 0.6768 | 2000 | 0.0008 | - |
| 0.6937 | 2050 | 0.0008 | - |
| 0.7107 | 2100 | 0.0008 | - |
| 0.7276 | 2150 | 0.0007 | - |
| 0.7445 | 2200 | 0.0007 | - |
| 0.7614 | 2250 | 0.0007 | - |
| 0.7783 | 2300 | 0.0007 | - |
| 0.7953 | 2350 | 0.0007 | - |
| 0.8122 | 2400 | 0.0007 | - |
| 0.8291 | 2450 | 0.0007 | - |
| 0.8460 | 2500 | 0.0007 | - |
| 0.8629 | 2550 | 0.0007 | - |
| 0.8799 | 2600 | 0.0007 | - |
| 0.8968 | 2650 | 0.0007 | - |
| 0.9137 | 2700 | 0.0007 | - |
| 0.9306 | 2750 | 0.0007 | - |
| 0.9475 | 2800 | 0.0006 | - |
| 0.9645 | 2850 | 0.0007 | - |
| 0.9814 | 2900 | 0.0007 | - |
| 0.9983 | 2950 | 0.0007 | - |
@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}
}