hojzas/proj4-all-labs
Viewer • Updated • 97 • 6
How to use hojzas/proj4-all-labs with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("hojzas/proj4-all-labs")How to use hojzas/proj4-all-labs with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("hojzas/proj4-all-labs")
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 trained on the hojzas/proj4-all-labs dataset that can be used for Text Classification. This SetFit model uses sentence-transformers/all-mpnet-base-v2 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 |
|
| 3 |
|
| 2 |
|
| 4 |
|
| 5 |
|
| 6 |
|
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("hojzas/proj4-all-labs")
# Run inference
preds = model("return list(dict.fromkeys(sorted(it)))")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 2 | 25.0515 | 140 |
| Label | Training Sample Count |
|---|---|
| 0 | 35 |
| 1 | 14 |
| 2 | 8 |
| 3 | 10 |
| 4 | 9 |
| 5 | 13 |
| 6 | 8 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0041 | 1 | 0.1745 | - |
| 0.2058 | 50 | 0.0355 | - |
| 0.4115 | 100 | 0.0168 | - |
| 0.6173 | 150 | 0.0042 | - |
| 0.8230 | 200 | 0.0075 | - |
Carbon emissions were measured using CodeCarbon.
@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
sentence-transformers/all-mpnet-base-v2