Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use brendaac/setfit-prom-bac with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("brendaac/setfit-prom-bac")How to use brendaac/setfit-prom-bac with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("brendaac/setfit-prom-bac")
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 LogisticRegression instance is used for classification.
The model has been trained using an efficient few-shot learning technique that involves:
| Label | Examples |
|---|---|
| Appetite |
|
| Future |
|
| Concentration |
|
| Financial Worries |
|
| Outcome |
|
| Alcohol |
|
| Present |
|
| Physical Function |
|
| Spiritual Concerns |
|
| Drugs |
|
| Loss of Usual Health |
|
| Smoking |
|
| Treatment UX |
|
| Support |
|
| Feeling Out of Control |
|
| Sleep |
|
| Label | Accuracy |
|---|---|
| all | 0.8715 |
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("brendaac/setfit-prom-bac")
# Run inference
preds = model("My sleep was deep")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 9.625 | 20 |
| Label | Training Sample Count |
|---|---|
| Alcohol | 8 |
| Appetite | 8 |
| Concentration | 8 |
| Drugs | 8 |
| Feeling Out of Control | 8 |
| Financial Worries | 8 |
| Future | 8 |
| Loss of Usual Health | 8 |
| Outcome | 8 |
| Physical Function | 8 |
| Present | 8 |
| Sleep | 8 |
| Smoking | 8 |
| Spiritual Concerns | 8 |
| Support | 8 |
| Treatment UX | 8 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0021 | 1 | 0.1955 | - |
| 0.1042 | 50 | 0.1787 | - |
| 0.2083 | 100 | 0.1152 | - |
| 0.3125 | 150 | 0.0475 | - |
| 0.4167 | 200 | 0.0276 | - |
| 0.5208 | 250 | 0.0161 | - |
| 0.625 | 300 | 0.0114 | - |
| 0.7292 | 350 | 0.0094 | - |
| 0.8333 | 400 | 0.007 | - |
| 0.9375 | 450 | 0.0063 | - |
| 1.0 | 480 | - | 0.0585 |
| 1.0417 | 500 | 0.0055 | - |
| 1.1458 | 550 | 0.0051 | - |
| 1.25 | 600 | 0.0047 | - |
| 1.3542 | 650 | 0.0043 | - |
| 1.4583 | 700 | 0.0042 | - |
| 1.5625 | 750 | 0.004 | - |
| 1.6667 | 800 | 0.0039 | - |
| 1.7708 | 850 | 0.0037 | - |
| 1.875 | 900 | 0.0037 | - |
| 1.9792 | 950 | 0.0038 | - |
| 2.0 | 960 | - | 0.0577 |
@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}
}