metadata
base_model: dunzhang/stella_en_400M_v5
library_name: setfit
metrics:
- accuracy
pipeline_tag: text-classification
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: >-
Record-Breaking Heatwave Grips Europe PARIS - Europe is sweltering under
an unprecedented heatwave, with temperatures soaring above 40degC
(104degF) in multiple countries. French authorities have issued red alerts
for several regions, while wildfires rage in Spain and Greece. Experts
link the extreme weather to climate change.
- text: >-
Global Coffee Prices Surge Amid Brazilian Drought Coffee futures hit a
five-year high today as severe drought continues to ravage Brazil's
coffee-growing regions. Experts warn consumers may see significant price
increases in coming months.
- text: >-
Pharmaceutical Giant Accused of Bribing Doctors to Overprescribe NEW YORK
- In a shocking turn of events, pharmaceutical behemoth PharmaCore is
facing allegations of orchestrating a widespread bribery scheme to
encourage doctors to overprescribe its blockbuster painkiller, OxyContin
Plus. An investigation by the DEA uncovered evidence of lavish "consulting
fees," all-expenses-paid vacations, and other kickbacks provided to
physicians who met certain prescription quotas. The scheme allegedly
resulted in thousands of unnecessary prescriptions, potentially fueling
the ongoing opioid crisis. PharmaCore's stock plummeted 30% following the
news. CEO Miranda Feltz issued a statement denying any wrongdoing and
pledging full cooperation with authorities.
- text: >-
Mental Health Clinic Director Embezzled Millions, Patients Left Without
Care PORTLAND, OR - The director of New Horizons Mental Health Clinic, Dr.
Sarah Jennings, has been indicted on charges of embezzling over $3 million
intended for patient care and facility improvements. The funds were
allegedly used to finance a lavish lifestyle, including luxury cars and a
vacation home in the Bahamas
- text: >-
When doctors, nurses or health professionals siphon funds or medicines
meant for patient care, lives are at stake. It's not just about missing
money--it's about missing medications, outdated equipment, and overworked
staff. As a physician, I've witnessed firsthand the consequences of
corruption in our healthcare system. We must demand transparency and
accountability at every level, from hospital boards to government
agencies. Our health depends on it.
inference: true
model-index:
- name: SetFit with dunzhang/stella_en_400M_v5
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: Unknown
type: unknown
split: test
metrics:
- type: accuracy
value: 0.7777777777777778
name: Accuracy
SetFit with dunzhang/stella_en_400M_v5
This is a SetFit model that can be used for Text Classification. This SetFit model uses dunzhang/stella_en_400M_v5 as the Sentence Transformer embedding model. A SetFitHead 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: dunzhang/stella_en_400M_v5
- Classification head: a SetFitHead instance
- Maximum Sequence Length: 512 tokens
- Number of Classes: 2 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 |
---|---|
1 |
|
0 |
|
Evaluation
Metrics
Label | Accuracy |
---|---|
all | 0.7778 |
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("twright8/news_cats_2")
# Run inference
preds = model("Global Coffee Prices Surge Amid Brazilian Drought Coffee futures hit a five-year high today as severe drought continues to ravage Brazil's coffee-growing regions. Experts warn consumers may see significant price increases in coming months.")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 55 | 153.8462 | 290 |
Label | Training Sample Count |
---|---|
0 | 13 |
1 | 13 |
Training Hyperparameters
- batch_size: (1, 1)
- num_epochs: (3, 17)
- max_steps: -1
- sampling_strategy: oversampling
- body_learning_rate: (9.629116538858926e-05, 2.651259436793277e-05)
- head_learning_rate: 0.02145586669240117
- loss: CoSENTLoss
- distance_metric: cosine_distance
- margin: 0.25
- end_to_end: True
- use_amp: True
- warmup_proportion: 0.1
- max_length: 512
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: True
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0027 | 1 | 0.0 | - |
0.0549 | 20 | 0.0 | 0.0 |
0.1099 | 40 | 0.0 | 0.0 |
0.1648 | 60 | 0.0 | 0.0 |
0.2198 | 80 | 0.0 | 0.0 |
0.2747 | 100 | 0.0 | 0.0 |
0.3297 | 120 | 0.0 | 0.0 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.10.13
- SetFit: 1.0.3
- Sentence Transformers: 3.0.1
- Transformers: 4.39.0
- PyTorch: 2.3.0+cu121
- Datasets: 2.20.0
- Tokenizers: 0.15.2
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}
}