Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use fefofico/crisis_trained_f2llm_selection with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("fefofico/crisis_trained_f2llm_selection")How to use fefofico/crisis_trained_f2llm_selection with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("fefofico/crisis_trained_f2llm_selection")
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 codefuse-ai/F2LLM-v2-80M 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 |
|---|---|
| negative |
|
| positive |
|
| Label | F1_Macro | F1_Binary |
|---|---|---|
| all | 0.8303 | 0.8105 |
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("fefofico/crisis_trained_f2llm_selection")
# Run inference
preds = model("There is talk of five years of austerity.")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 1 | 22.4121 | 74 |
| Label | Training Sample Count |
|---|---|
| negative | 499 |
| positive | 360 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0074 | 1 | 0.4596 | - |
| 0.1481 | 20 | 0.4139 | - |
| 0.2963 | 40 | 0.3995 | - |
| 0.4444 | 60 | 0.369 | - |
| 0.5926 | 80 | 0.3209 | - |
| 0.7407 | 100 | 0.2825 | - |
| 0.8889 | 120 | 0.2615 | - |
| 1.0 | 135 | - | 0.2649 |
| 1.0370 | 140 | 0.2548 | - |
| 1.1852 | 160 | 0.2496 | - |
| 1.3333 | 180 | 0.245 | - |
| 1.4815 | 200 | 0.2373 | - |
| 1.6296 | 220 | 0.2326 | - |
| 1.7778 | 240 | 0.228 | - |
| 1.9259 | 260 | 0.2179 | - |
| 2.0 | 270 | - | 0.2277 |
| 2.0741 | 280 | 0.2057 | - |
| 2.2222 | 300 | 0.1982 | - |
| 2.3704 | 320 | 0.1884 | - |
| 2.5185 | 340 | 0.1752 | - |
| 2.6667 | 360 | 0.1639 | - |
| 2.8148 | 380 | 0.1526 | - |
| 2.9630 | 400 | 0.1425 | - |
| 3.0 | 405 | - | 0.1906 |
| 3.1111 | 420 | 0.1334 | - |
| 3.2593 | 440 | 0.1157 | - |
| 3.4074 | 460 | 0.1075 | - |
| 3.5556 | 480 | 0.0966 | - |
| 3.7037 | 500 | 0.0866 | - |
| 3.8519 | 520 | 0.0746 | - |
| 4.0 | 540 | 0.0704 | 0.1889 |
| 4.1481 | 560 | 0.0666 | - |
| 4.2963 | 580 | 0.0603 | - |
| 4.4444 | 600 | 0.0533 | - |
| 4.5926 | 620 | 0.0514 | - |
| 4.7407 | 640 | 0.0519 | - |
| 4.8889 | 660 | 0.0506 | - |
| 5.0 | 675 | - | 0.1930 |
@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
Qwen/Qwen3-0.6B-Base