Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use wikd/nlp_aug with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("wikd/nlp_aug")How to use wikd/nlp_aug with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("wikd/nlp_aug")
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 |
|---|---|
| Tech Support |
|
| HR |
|
| Product |
|
| Returns |
|
| Logistics |
|
| Label | Accuracy |
|---|---|
| all | 0.8491 |
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("Can you tell me about any on9uin9 promotions uk discounts on organic pk0doce?")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 10 | 16.125 | 28 |
| Label | Training Sample Count |
|---|---|
| Returns | 8 |
| Tech Support | 8 |
| Logistics | 8 |
| HR | 8 |
| Product | 8 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.025 | 1 | 0.2231 | - |
| 1.25 | 50 | 0.065 | - |
| 2.5 | 100 | 0.0065 | - |
| 3.75 | 150 | 0.0019 | - |
| 5.0 | 200 | 0.0032 | - |
| 6.25 | 250 | 0.0026 | - |
| 7.5 | 300 | 0.0009 | - |
| 8.75 | 350 | 0.0018 | - |
| 10.0 | 400 | 0.0018 | - |
@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