Edit model card

SetFit with sentence-transformers/all-mpnet-base-v2

This is a SetFit model 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:

  1. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

Model Labels

Label Examples
yes
  • "NYT.1/1/2023. As Lula Becomes Brazil's President, Bolsonaro Flees to Florida.Kudos to the NYT journalism for a first-rate article about the chaotic and surrealistic end of the ex-military president Bolsonaro's administration. Among his many policy mistakes, some described as of criminal nature, the death of his political career was to escape the country before passing the presidential sash to President Lula. Bolsonaro is lucky to be a politician and no longer a military man. For an army officer to flee from a combat theater leaving behind his comrades, is a court martial offense. One thing is for sure. He destroyed any hope of the Brazilian military to one day return to power. Moreover, President Lula's success or failure depends on how his administration deals with the economy rather than on political opposition from Bolsonaro that from Orlando or Rio de Janeiro will fade away.\n"
  • 'A few days ago I listened to an interview with the left-of-center new President of Brazil, Luiz Inácio Lula da Silva. He said education, health care and food for poor people aren’t cost, but investments.How I wish American legislatures would think like him.\n'
  • 'After the dictatorship there was a blanket pardon. No military men was ever prosecuted for the assassinations, torture, rapes committed in the name of the government. Lula said he will be the president for all Brazilians, including the ones who did not vote for him. He said it was time to reach out in the families and end divisions. But he said he will prosecute crimes of the previous administration. He is correct. Brazil lost (proportionally) more people than any other country to COVID. A country thst has been a leader and an example in mass vaccinations. The hundreds of thousands who died did not need to die. And they should not be hidden under the carpet as if nothing happened.\n'
no
  • 'rivvir No, they didn't just want to "die in a war," they also didn't want to kill other people they have no reason to kill in some utterly immoral war...that's a far cry from the "same danger" as being "poor and desperate."Also, while the journey north has it perils for sure, have a look at the Rio Grande in a southern climate, then look at the Bearing Sea in fall weather!\n'
  • '"Spectacle produced fame, which produced power, which produced influence and possibly control." Yes, indeed. And since the Republicans have nothing to sell BUT spectacle -- because "more tax breaks for the wealthy" somehow doesn't get sufficient votes from the hoi polloi -- they kept offering it and the hoi polloi (or about a third of us) kept buying it, and now they're caught in their own trap. They created the monster that's taken control from them.\n'
  • "While undoubtedly all this is true, the recent layoffs are different than most. Because what we have is companies, some of the richest in the world, laying off many thousands of employees even though they continue to be profitable. So the ask of managers is difficult. It's not just look the person in the eye. It is: look the person in the eye and tell them that the company to which they'll loyally devoted many years of service has decided to make them unemployed, not out of necessity, not because the company is at risk, but so that some greedy shareholders can earn a few more pennies. They would be asking the manager to defend the indefensible. And if the manager doesn't agree with the lay-offs, it puts them in a very awkward position. Should they resign in disgust (and so one more person without a way to feed their family or pay their mortgage)? Or should they at least tell the employee they don't agree (but what consequences could this have for them if word gets back to their superiors)? Or should they pretend to agree that this appalling, cynical lay-off is somehow appropriate and just a measured, proportionate response to the fact that some activist shareholder only earned $3.2 billion this year? Somehow, while it is totally wrong, it also feels appropriate that these most cynical and inhumane of lay-offs be executed in the most cynical inhumane way.\n"

Evaluation

Metrics

Label Accuracy
all 1.0

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("davidadamczyk/setfit-model-7")
# Run inference
preds = model("John Ondespot Help me out. So Yellen has to tell the President that they cannot afford to pay bondholders in the favour of US civil servants and military and homeless to keep society rolling and let the big banks hold out for money down the line? To float the entire USA financial system from collapse but also from societal rioting on Capitol Hill? I am getting this? Cause the more I read this is quite a debt watched by the major credit leaders of the US commercial and credit banking system?
")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 23 107.2 272
Label Training Sample Count
no 18
yes 22

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (1, 1)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 120
  • body_learning_rate: (2e-05, 2e-05)
  • head_learning_rate: 2e-05
  • loss: CosineSimilarityLoss
  • distance_metric: cosine_distance
  • margin: 0.25
  • end_to_end: False
  • use_amp: False
  • warmup_proportion: 0.1
  • l2_weight: 0.01
  • seed: 42
  • eval_max_steps: -1
  • load_best_model_at_end: False

Training Results

Epoch Step Training Loss Validation Loss
0.0017 1 0.3073 -
0.0833 50 0.1154 -
0.1667 100 0.0012 -
0.25 150 0.0002 -
0.3333 200 0.0002 -
0.4167 250 0.0001 -
0.5 300 0.0001 -
0.5833 350 0.0001 -
0.6667 400 0.0001 -
0.75 450 0.0001 -
0.8333 500 0.0001 -
0.9167 550 0.0001 -
1.0 600 0.0001 -

Framework Versions

  • Python: 3.10.13
  • SetFit: 1.1.0
  • Sentence Transformers: 3.0.1
  • Transformers: 4.45.2
  • PyTorch: 2.4.0+cu124
  • Datasets: 2.21.0
  • Tokenizers: 0.20.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
10
Safetensors
Model size
109M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for davidadamczyk/setfit-model-7

Finetuned
(143)
this model

Evaluation results