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
  • 'There is an epic, romantic story between Daniel Barenboim and Jacqueline du Pré (one of the greatest cellists of all time) that goes back to the late 1960’s. She was a disciple of the great Russian cellist Mstislav Rostropovich, who was so impressed with her immense talent that he viewed the much younger Ms. du Pré as his equal and successor.On Christmas Eve of 1966 Jacqueline du Pré met Daniel Barenboim in London, promptly converted to Judaism and married him in Israel in 1967. They went on to record exquisite music together and thus became “the golden couple” of classical music at that time.For all the romantics out there, they left a trail of recordings which includes what I consider the best-ever performance of Robert Schumann’s Cello Concerto. The combination of the young Barenboim and du Pré, both not yet 30 years old, and Schumann, the great romantic, was stunning. The cello (a 1712 Stradivarius) seemed to come alive, speaking directly to the heart, Baremboim was equally impeccable, and we all cried from beauty so sublime. I am now 84, and still get misty when I play it.Tragically, du Pré died at the young age of 42, making this chapter of Mr. Baremboim’s life incredibly poignant. The recording lives on and is still available.\n'
  • 'Santos was once married to a woman, despite being gay. Did he do that to obtain American citizenship?He received campaign money from a businessman, Andrew Intrater, who cultivated close links with a onetime Trump confidant and who is the cousin of a sanctioned Russian oligarch, Russian billionaire Viktor Vekselberg, who has been sanctioned by the U.S. government for his role in the Russian energy industry. according to video footage and court documents.Harbor City, the company Santos worked for and is under investigation for a money scheme, was able to land a $625,000 deposit from a company registered in Mississippi that identifies Intrater as its lone officer, according to an exhibit included in the SEC’s complaint against Harbor City.After Harbor City’s assets were frozen, and with assistance from a fellow former Harbor City employee, Santos in 2021 formed a company, the Devolder Organization, that paid him at least $3.5 million over the next two years, according to Florida business records and financial disclosure forms he filed as a candidate. Santos loaned his campaign more than $700,000 but did not report any income from Harbor City despite having been paid by the company as recently as April 2021.Did that money come from Harbor City’s ponzu scheme or did it come from Russia through Intrater and is Santos in the pocket of Russia?Lots we don’t know, lots to investigate.\n'
  • "Yes, indeed, making close friends at work is a wonderful idea. I met a woman at work 48 years ago and we became great friends. She and her husband invited me to dinner one evening to meet an engineer who worked with her husband. They both thought we might like each other. They were certainly right about that. We were engaged 3 months later and married three months after that. We'll be celebrating our 47th wedding anniversary the end of this month. Yup, close friends at work can be wonderful!\n"
no
  • 'Not surprisingly, this is one of the most astute columns I've read recently about the ubiquity of guns in America and lack of common sense gun control laws. I've experienced a situation where I saw a guy with a holstered gun on his hip walking toward the entry of a grocery where I was intending to go. (There was no indication at all that he was a member of law enforcement.) His whole posture was one of intimidation and when I perceived that I turned right around and left for a different store. Was my reaction fear? Instinctively it certainly was, so I took precaution. And as Bouie points out, I was deprived of my freedom: my choice and ability to shop at that store without fear, and so a forced resignation and imposed requirement that I change my shopping plans. (I think it's noteworthy too that the only people I've seen open carry have all been white men. I've never seen a black man open carry or a hispanic man, nor a woman. I think we probably know why: racism. If a black man walked into a store with a gun on his hip, in this country, he would immediately cause panic.)There is no reason why anyone needs to open carry in a public space unless they are law enforcement.Jokes have been made about the hubris of "duck & cover" drills from the 1950s-60s because of threat of nuclear war. Gun proliferation in America causes more death & greater threat to society than the possibility of nuclear war. The 2nd amendment needs to be amended to reflect common sense gun laws.\n'
  • '"At the same time, 45 percent said the pornography provided helpful information about sex. L.G.B.T.Q. teenagers, in particular, said it helped them discover more about their sexuality.“'We have to be careful about saying all porn is good or bad,' said Emily Rothman, a professor of community health sciences at Boston University. 'There is nuance here.'”Gross. Somehow, since the beginning of time, young people, especially LGBTQ teens, have managed to discover more about their sexuality without themselves or all of us being inundated with pornography--and what we see today is not just porn but ubiquitous violence. Attitudes like Rothman's are why parents are fighting against school libraries offering sexuality explicit books about LGBTQ teens. You won't find sexually explicit books about straight sex in those libraries. There's no library market for those books. In the name of helping LGBTQ kids "discover" their sexuality, librarians and teachers justify exposing all teens to porn. Too much porn is too much porn. Because of all the porn, girls think it's normal for their boyfriends to choke them. Boys masterbate so often that they damage their brains' abilities to regulate pleasure and wind up impotent. The normalization of porn has negatively impacted how younger people see relationships and marriage. Too much porn has also damaged how girls see themselves as embodied females.Enough. Justifying porn for teens as a tool for discovering sexuality hurts all teens.\n'
  • 'CT1001 I hope that's not a rhetorical question, expecting "you don't" for an answer. Because people are doing it. Existing written records can reveal more than they ever intended about the lives of the oppressed... oral material can be looked at seriously... and "archeology" can merge smoothly into history if it involves, for instance, paying as much attention to the remnants of slave quarters, as to the slave-owners quarters... it's very appropriate to accuse the people who disappeared the slave quarters, while prettying up the owners residence as an attractive venue for weddings etc, during the hundred years of historical erasure that went on in this country.\n'

Evaluation

Metrics

Label Accuracy
all 0.9

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-9")
# Run inference
preds = model("DLI believe she also married Aristotle Onassis, who owned the world's largest private shipping fleet -- that may have helped finance her other life choices...
")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 37 170.9 276
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.5127 -
0.0833 50 0.2133 -
0.1667 100 0.0057 -
0.25 150 0.0002 -
0.3333 200 0.0001 -
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.0 -
1.0 600 0.0 -

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
8
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-9

Finetuned
(143)
this model

Evaluation results