Run this model with HF Jobs
Run Shankhdhar/jewellery_query_setfit_classifier on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Shankhdhar/jewellery_query_setfit_classifier. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Shankhdhar/jewellery_query_setfit_classifier on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Shankhdhar/jewellery_query_setfit_classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- setfit
How to use Shankhdhar/jewellery_query_setfit_classifier with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("Shankhdhar/jewellery_query_setfit_classifier") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - sentence-transformers
How to use Shankhdhar/jewellery_query_setfit_classifier with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Shankhdhar/jewellery_query_setfit_classifier") 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] - Notebooks
- Google Colab
- Kaggle
SetFit with sentence-transformers/paraphrase-mpnet-base-v2
This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/paraphrase-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:
- Fine-tuning a Sentence Transformer with contrastive learning.
- Training a classification head with features from the fine-tuned Sentence Transformer.
Model Details
Model Description
- Model Type: SetFit
- Sentence Transformer body: sentence-transformers/paraphrase-mpnet-base-v2
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 512 tokens
- Number of Classes: 4 classes
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
Model Labels
| Label | Examples |
|---|---|
| product faq |
|
| product discoveribility |
|
| order tracking |
|
| product policy |
|
Evaluation
Metrics
| Label | Accuracy |
|---|---|
| all | 0.8025 |
Uses
Direct Use for Inference
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("I recently purchased the Three Crystal Proposal Ring, but I'm disappointed to find that one of the crystals is loose. Can you assist me with this issue?")
Training Details
Training Set Metrics
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 6 | 16.4474 | 30 |
| Label | Training Sample Count |
|---|---|
| negative | 0 |
| positive | 0 |
Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (4, 4)
- max_steps: -1
- sampling_strategy: oversampling
- body_learning_rate: (2e-05, 1e-05)
- head_learning_rate: 0.01
- loss: CosineSimilarityLoss
- distance_metric: cosine_distance
- margin: 0.25
- end_to_end: False
- use_amp: False
- warmup_proportion: 0.1
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: True
Training Results
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0016 | 1 | 0.1464 | - |
| 0.0822 | 50 | 0.0907 | - |
| 0.1645 | 100 | 0.0059 | - |
| 0.2467 | 150 | 0.0013 | - |
| 0.3289 | 200 | 0.0009 | - |
| 0.4112 | 250 | 0.0007 | - |
| 0.4934 | 300 | 0.0004 | - |
| 0.5757 | 350 | 0.0003 | - |
| 0.6579 | 400 | 0.0001 | - |
| 0.7401 | 450 | 0.0002 | - |
| 0.8224 | 500 | 0.0002 | - |
| 0.9046 | 550 | 0.0002 | - |
| 0.9868 | 600 | 0.0001 | - |
| 1.0 | 608 | - | 0.2272 |
| 1.0691 | 650 | 0.0001 | - |
| 1.1513 | 700 | 0.0001 | - |
| 1.2336 | 750 | 0.0001 | - |
| 1.3158 | 800 | 0.0001 | - |
| 1.3980 | 850 | 0.0001 | - |
| 1.4803 | 900 | 0.0001 | - |
| 1.5625 | 950 | 0.0001 | - |
| 1.6447 | 1000 | 0.0001 | - |
| 1.7270 | 1050 | 0.0001 | - |
| 1.8092 | 1100 | 0.0 | - |
| 1.8914 | 1150 | 0.0001 | - |
| 1.9737 | 1200 | 0.0001 | - |
| 2.0 | 1216 | - | 0.2807 |
| 2.0559 | 1250 | 0.0001 | - |
| 2.1382 | 1300 | 0.0001 | - |
| 2.2204 | 1350 | 0.0001 | - |
| 2.3026 | 1400 | 0.0 | - |
| 2.3849 | 1450 | 0.0001 | - |
| 2.4671 | 1500 | 0.0001 | - |
| 2.5493 | 1550 | 0.0 | - |
| 2.6316 | 1600 | 0.0001 | - |
| 2.7138 | 1650 | 0.0 | - |
| 2.7961 | 1700 | 0.0001 | - |
| 2.8783 | 1750 | 0.0 | - |
| 2.9605 | 1800 | 0.0 | - |
| 3.0 | 1824 | - | 0.3011 |
| 3.0428 | 1850 | 0.0 | - |
| 3.125 | 1900 | 0.0001 | - |
| 3.2072 | 1950 | 0.0001 | - |
| 3.2895 | 2000 | 0.0 | - |
| 3.3717 | 2050 | 0.0001 | - |
| 3.4539 | 2100 | 0.0001 | - |
| 3.5362 | 2150 | 0.0 | - |
| 3.6184 | 2200 | 0.0001 | - |
| 3.7007 | 2250 | 0.0001 | - |
| 3.7829 | 2300 | 0.0 | - |
| 3.8651 | 2350 | 0.0 | - |
| 3.9474 | 2400 | 0.0001 | - |
| 4.0 | 2432 | - | 0.311 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.9.16
- SetFit: 1.0.3
- Sentence Transformers: 2.2.2
- Transformers: 4.35.2
- PyTorch: 2.1.1
- Datasets: 2.15.0
- Tokenizers: 0.15.0
Citation
BibTeX
@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}
}
- Downloads last month
- 71
Model tree for Shankhdhar/jewellery_query_setfit_classifier
Paper for Shankhdhar/jewellery_query_setfit_classifier
Evaluation results
- Accuracy on Unknowntest set self-reported0.802