Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use selina09/yt_setfit2 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("selina09/yt_setfit2")How to use selina09/yt_setfit2 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("selina09/yt_setfit2")
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 BAAI/bge-small-en-v1.5 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 |
|---|---|
| 0 |
|
| 1 |
|
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("selina09/yt_setfit2")
# Run inference
preds = model("dont trust it")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 1 | 93.9133 | 364 |
| Label | Training Sample Count |
|---|---|
| 0 | 75 |
| 1 | 75 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0028 | 1 | 0.2613 | - |
| 0.1401 | 50 | 0.239 | - |
| 0.2801 | 100 | 0.2175 | - |
| 0.4202 | 150 | 0.2015 | - |
| 0.5602 | 200 | 0.0628 | - |
| 0.7003 | 250 | 0.0534 | - |
| 0.8403 | 300 | 0.0163 | - |
| 0.9804 | 350 | 0.0105 | - |
| 1.1204 | 400 | 0.0259 | - |
| 1.2605 | 450 | 0.0024 | - |
| 1.4006 | 500 | 0.0013 | - |
| 1.5406 | 550 | 0.0196 | - |
| 1.6807 | 600 | 0.0157 | - |
| 1.8207 | 650 | 0.0184 | - |
| 1.9608 | 700 | 0.0159 | - |
| 2.1008 | 750 | 0.0062 | - |
| 2.2409 | 800 | 0.0179 | - |
| 2.3810 | 850 | 0.0165 | - |
| 2.5210 | 900 | 0.0092 | - |
| 2.6611 | 950 | 0.0299 | - |
| 2.8011 | 1000 | 0.0071 | - |
| 2.9412 | 1050 | 0.0115 | - |
| 3.0812 | 1100 | 0.0007 | - |
| 3.2213 | 1150 | 0.0248 | - |
| 3.3613 | 1200 | 0.0007 | - |
| 3.5014 | 1250 | 0.0096 | - |
| 3.6415 | 1300 | 0.0091 | - |
| 3.7815 | 1350 | 0.0007 | - |
| 3.9216 | 1400 | 0.0255 | - |
| 4.0616 | 1450 | 0.0065 | - |
| 4.2017 | 1500 | 0.0178 | - |
| 4.3417 | 1550 | 0.0168 | - |
| 4.4818 | 1600 | 0.0161 | - |
| 4.6218 | 1650 | 0.0093 | - |
| 4.7619 | 1700 | 0.0337 | - |
| 4.9020 | 1750 | 0.0148 | - |
| 5.0420 | 1800 | 0.0082 | - |
| 5.1821 | 1850 | 0.023 | - |
| 5.3221 | 1900 | 0.0185 | - |
| 5.4622 | 1950 | 0.0155 | - |
| 5.6022 | 2000 | 0.0176 | - |
| 5.7423 | 2050 | 0.0004 | - |
| 5.8824 | 2100 | 0.0221 | - |
| 6.0224 | 2150 | 0.0004 | - |
| 6.1625 | 2200 | 0.0045 | - |
| 6.3025 | 2250 | 0.0004 | - |
| 6.4426 | 2300 | 0.0081 | - |
| 6.5826 | 2350 | 0.0089 | - |
| 6.7227 | 2400 | 0.0091 | - |
| 6.8627 | 2450 | 0.0004 | - |
| 7.0028 | 2500 | 0.0238 | - |
| 7.1429 | 2550 | 0.0056 | - |
| 7.2829 | 2600 | 0.0175 | - |
| 7.4230 | 2650 | 0.0088 | - |
| 7.5630 | 2700 | 0.0383 | - |
| 7.7031 | 2750 | 0.0356 | - |
| 7.8431 | 2800 | 0.0004 | - |
| 7.9832 | 2850 | 0.0231 | - |
| 8.1232 | 2900 | 0.0292 | - |
| 8.2633 | 2950 | 0.0384 | - |
| 8.4034 | 3000 | 0.0004 | - |
| 8.5434 | 3050 | 0.0091 | - |
| 8.6835 | 3100 | 0.0079 | - |
| 8.8235 | 3150 | 0.0298 | - |
| 8.9636 | 3200 | 0.0083 | - |
| 9.1036 | 3250 | 0.0004 | - |
| 9.2437 | 3300 | 0.0003 | - |
| 9.3838 | 3350 | 0.0312 | - |
| 9.5238 | 3400 | 0.0157 | - |
| 9.6639 | 3450 | 0.0003 | - |
| 9.8039 | 3500 | 0.0306 | - |
| 9.9440 | 3550 | 0.0084 | - |
@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}
}
Base model
BAAI/bge-small-en-v1.5