SetFit with intfloat/e5-base

This is a SetFit model that can be used for Text Classification. This SetFit model uses intfloat/e5-base 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 Type: SetFit
  • Sentence Transformer body: intfloat/e5-base
  • Classification head: a LogisticRegression instance
  • Maximum Sequence Length: 512 tokens
  • Number of Classes: 2 classes

Model Sources

Model Labels

Label Examples
1
  • "query: Twitter BLASTS Whole Foods For Yet Another Expensive, Unnecessary Product (TWEETS) Whole Foods is a store that many people love. They love the organic food, the appearance of cleanliness and health, and the impeccable customer service. However, lately, this popular chain has found itself under fire for creating and marketing products that are excessively expensive and completely unnecessary often at the expense of the environment due to the packaging, and at the expense of its customers budgets.Everyone remembers the absolute shitstorm caused by the asparagus water last year that the chain sold $6 a bottle for water with a couple of stalks of asparagus in it. Apparently, that did not teach the folks at Whole Foods a lesson, because they have now just had a similar reaction to another ridiculously expensive product oranges that are already peeled, which are going for a whopping $6 a pound.Needless to say, the public has not taken kindly to this move, and many people have taken to Twitter to blast the chain. Here are just a few choice critical tweets:Firstly, it was pointed out how environmentally irresponsible this is:If only nature would find a way to cover these oranges so we didn't need to waste so much plastic on them. pic.twitter.com/00YECaHB4D Nathalie Gordon (@awlilnatty) March 3, 2016 @awlilnatty Fucking hell. That makes me unbelievably angry actually. Talk about necessarily contributing to plastic taking over the planet. Swiftie Be (@StephanieBe) March 3, 2016Others pointed out how ironic the chain s antics are, given its name:@ajdomanico @awlilnatty the irony of this being Whole Foods too Mollie Goodfellow (@hansmollman) March 3, 2016Others made fun of the obviously lazy nature of the people who would purchase this:@ConorS @awlilnatty @MisterVivian next logical step: half eaten. (@Jemppu) March 4, 2016It was pointed out that it could be ableist to assume that everyone can peel an orange; however, that point was quickly followed by the obvious fact that such people are not who Whole Foods is targeting. In fact, due to the fact that most disabled people are not exactly well-to-do, they likely could never even afford to shop at Whole Foods, making that particular point moot:@otherbecky @awlilnatty You know, as well as i do, that that is NOT who that is marketed towards. Also, the packaging is still superfluous. Swiftie Be (@StephanieBe) March 4, 2016All of this and more is true here. This is simply outrageous. Shame on you, Whole Foods. You market to organic food-eating, hippieish, health conscious liberals, and you expect us to put up with this, to not notice? Well, for the second time in their price-gouging attempt, Whole Foods was forced to backtrack, calling the marketing and selling of these pre-peeled oranges a mistake. @awlilnatty Definitely our mistake. These have been pulled. We hear you, and we will leave them in their natural packaging: the peel. Whole Foods Market (@WholeFoods) March 3, 2016You re damn right it was a mistake. Hopefully you people have learned your lesson this time.Featured image via Flickr"
  • 'query: WATCH: DIAMOND AND SILK Rip On John Kerry Over Israel Comments (VIDEO) .@DiamondandSilk have something to say about Kerry and Obama stance on Israel. pic.twitter.com/d3xsU7hMHl Diamond and Silk (@DiamondandSilk) December 29, 2016'
  • 'query: What Facebook Just Did About Guns Is Going To Drive The NRA Insane Facebook announced that it will be banning its users from arranging private gun sales over both the main Facebook site and its photo-sharing site Instagram.While these new rules do not apply to licensed gun dealers, who can still post with the stipulation that they do not conduct purchases on the site, it does apply to private one-on-one sales that do not require background checks in many states.What is very important is that the move covers gun parts and ammunition as well. The banning of ammunition sales is obviously effective since without massive amounts of bullets you can t have massive amounts of gun violence. The fact it applies to gun parts is significant as well. Federal law doesn t currently cover some gun parts, like an unfinished lower receiver. They are treated as not a gun if they are 80 percent or less complete. This allows them to be sold without serial numbers or background checks. If you provide the parts to someone who is experienced enough to complete them, you basically have what will make an untraceable gun. Afterward, they can be assembled with other parts into a fully functional firearm. Some websites even sell the machines to complete receivers and boast about the fact you can build unserialized firearms legally in your own home.Facebook s status as a non-governmental entity gives it more control over what it can allow on its network. It simply doesn t matter if a person s slightly unfinished gun parts are legal to sell to anyone without background checks. Facebook can restrict whatever they want, just like they do with marijuana, pharmaceuticals or other illegal material. This helps tremendously in curbing the ways federal law has failed us.Facebook s head of product policy, Monika Bickert, said Over the last two years, more and more people have been using Facebook to discover products and to buy and sell things to one another. We are continuing to develop, test and launch new products to make this experience even better for people and are updating our regulated goods policies to reflect this evolution. Do you think that any Republicans will be boycotting Facebook now? What will their alternative be?featured image via wikicommons'
0
  • 'query: House Speaker Ryan says contested Republican convention more likely House Speaker Paul Ryan said on Thursday it is increasingly likely that the Republican Party’s presidential nominating convention will be a contested one this summer. If no candidate can assemble 1,237 Republican delegates by July, the party’s presidential nominee for the November election will be chosen by convention delegates in Cleveland, Ohio, in what could be four days of political drama, carried live on national television. Republican front-runner Donald Trump warned on Wednesday of “riots” if he is denied the party’s presidential nomination, after he scored big wins in primaries in Florida, Illinois and North Carolina on Tuesday. It is uncertain whether Trump can get the 1,237 convention delegates he needs before July. Ryan denounced Trump’s “riots” comment, saying it was unacceptable to even hint at violence. He said he had to study up on the convention process, since he would be chairing the event and wanted to be sure the rule of law prevails. “Nothing has changed other than the perception that this is more likely to become an open convention than we thought before. So, we’re getting our minds around the idea that this could very well become a reality,” Ryan said. As chairman, Ryan will be charged with opening and closing the event, and overseeing the presidential nomination roll call - possibly more than one, if the first is not decisive. He would also be expected to deal with any floor fights on controversial motions that arise. “I will have to obviously bone up on all the rules and all of those things,” Ryan told reporters. “My goal is ... to be neutral and dispassionate, and to make sure that the rule of law prevails, and to make sure that the delegates make their decision however the rules require them to do that,” he said. The last time delegates arrived at a Republican convention without a clear nominee, in Kansas City in 1976, then-President Gerald Ford edged out challenger Ronald Reagan on the first ballot. The last time it took multiple ballots to get a Republican nominee was in 1948, when Thomas Dewey was nominated. Ryan has been touted as a possible dark-horse candidate for president this year, but the speaker repeated Thursday that he is not running. He said he told former House Speaker John Boehner, who had suggested Ryan be a candidate in case of a deadlocked convention, to “knock it off.” '
  • 'query: China will stick to supply side structural reform, overcapacity reduction efforts Chinese President Xi Jinping said China will stick to supply side structural reform and maintain overcapacity reduction and deleveraging efforts. Xi made the comments in a speech at the beginning of a Communist Party congress. '
  • 'query: Colombia urgently crafting law to allow crime gangs to surrender Colombia s government is urgently working with Congress on a law that would lay out terms of surrender for crime gangs such as the Gulf Clan, President Juan Manuel Santos said on Thursday, after the gang declared a unilateral ceasefire. The Gulf Clan, also known as the Usuga Clan and the Autodefensas Gaitanistas, has been accused of operating drug trafficking routes in partnership with Mexican cartels and taking part in illegal gold mining. It announced a ceasefire on Wednesday and has said its members were willing to turn themselves in. Santos, speaking at a event about the eradication of coca crops in Antioquia province, hailed the ceasefire and said a surrender of the group would be welcome, but added that security forces will not halt actions against the group. If this organization wants to surrender to justice it s very welcome and we re working with the justice minister to put together some decrees and there s a law in Congress to facilitate the collective surrender of the Gulf Clan that we are classing as urgent, Santos said. The president has said the government will not negotiate with the group because members are criminals and not politically motivated rebels like the now-demobilized Revolutionary Armed Forces of Colombia (FARC) or National Liberation Army (ELN). Defense Minister Luis Carlos Villegas, speaking at the same event, said operations against the Clan will continue. The fact that they won t shoot is good news but if they continue to commit crimes they will be targeted, he said. We are not going to suspend operations or lower our guard. '

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("query: Senator Jeff Sessions to endorse Trump White House bid: Drudge Report Republican Jeff Sessions will become the first sitting U.S. senator to endorse party front-runner Donald Trump on Sunday evening, Drudge Report said, marking another in a string of high-profile endorsements for the billionaire businessman. Sessions’ support will top the list of politicians who have thrown their backing to Trump in the last week, including Republican U.S. Representatives Chris Collins of New York and Duncan Hunter of California, as well as former rival for the nomination New Jersey Governor Chris Christie, who endorsed on Friday.  (Reporting by Alana Wise; Editing by Cynthia Osterman) This article was funded in part by SAP. It was independently created by the Reuters editorial staff. SAP had no editorial involvement in its creation or production.")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 13 422.6963 2249
Label Training Sample Count
0 395
1 405

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (1, 1)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 7
  • 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.0014 1 0.1801 -
0.0714 50 0.2696 -
0.1429 100 0.0767 -
0.2143 150 0.0091 -
0.2857 200 0.0057 -
0.3571 250 0.0015 -
0.4286 300 0.0014 -
0.5 350 0.0001 -
0.5714 400 0.0001 -
0.6429 450 0.0001 -
0.7143 500 0.0001 -
0.7857 550 0.0001 -
0.8571 600 0.0001 -
0.9286 650 0.0001 -
1.0 700 0.0001 -

Framework Versions

  • Python: 3.12.12
  • SetFit: 1.1.3
  • Sentence Transformers: 5.2.0
  • Transformers: 4.57.3
  • PyTorch: 2.9.0+cu126
  • Datasets: 4.0.0
  • Tokenizers: 0.22.1

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
38
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Anthony246346/fake-news-setfit-e5

Base model

intfloat/e5-base
Finetuned
(12)
this model

Paper for Anthony246346/fake-news-setfit-e5