carlesoctav's picture
Add SetFit model
061f0a4 verified
metadata
language: en
license: apache-2.0
library_name: setfit
tags:
  - setfit
  - sentence-transformers
  - text-classification
  - generated_from_setfit_trainer
metrics:
  - accuracy
  - precision
  - recall
  - f1
widget:
  - text: >-
      not so jolly dolly so, last weekend my wife and i watched the oppen part
      of the "barbenheimer" 2023 box-office two-headed monster and this week it
      was barbie's turn. from the little i'd incidentally read in advance about
      the day-glo billion dollar blockbuster, i was expecting some kind of
      retro-cool, existentialist, post-modernist satire on the battle of the
      sexes, consumerism and childhood buffed up with a little diversity along
      the way, but somehow with all these ducks lined up in a row, i felt the
      film missed the mark.it starts brightly with eye-candy sets in fifty
      shades of pink as we're introduced to margot robbie's barbie in her
      barbie-world of alternative barbies, see through doll's houses and their
      various incomplete consumer goods, for example our girl has her daily
      dry-shower and drinks non-existent tea. everything appears to be perfect
      in her / their perfect world, unless you're the boyfriend ken, here also
      in a variety of forms, all doomed to exist only in barbie's slipstream and
      so experience recurring frustration at getting precisely nowhere, all the
      time, with the object of his / their, i hesitate to call it, desire.then
      things start to go wrong for robbie's "stereotypical" barbie. she thinks
      of death and starts to malfunction and after a visit to kate mckinnon's
      weird barbie, a concept i have to say i didn't get at all, she determines
      to go to the real world to connect with the disillusioned mattel employee,
      played by america ferrera, whose negativity, channelled through her
      disinterested daughter ariana greenblatt, is upsetting the living doll's
      equilibrium. ryan gosling's wheedling ken is also along for the ride and
      stows away in her penelope pitstop-mobile and together they head for l.
      a., where ferrera lives, the headquarters of the manufacturer mattel.for
      me, the film went downhill fast from there with ken's head getting
      messed-up with perceptions of patriarchy while barbie has a meltdown over
      her identity-crisis. there are unfunny, over-played scenes where barbie
      experiences humiliation at the hands of greenblatt and her school chums,
      traipses down to mattel hq to confront the all-male board of directors
      headed by a mis-cast will ferrell as the company ceo, before returning to
      barbie-world with ferrera and greenblatt in tow to take down ken's
      new-model kendom where outdated male-superiority is literally back in the
      saddle.i have to admit, i got very bored, very soon with this empty,
      supposedly satirical high-concept, fantasy-comedy. a world box-office of
      1.5 billion dollars and eight oscar nominations actually makes me wonder
      if i've not switched places too with barbie-world as i'm afraid nothing
      about the movie, including the soundtrack and unsuccessful attempts at
      either comedy or pathos (especially when they wheel in rhea perlman as the
      doll's now-enlightened creator) all missing me by miles.when at one point,
      all her namesakes shout "go barbie!', i must admit i was with them 100%
      but for completely different reasons.
  - text: >-
      way better than expected i was amongst the people who thought they saw a
      majority of this film based on all of the filming stills posted on the
      bird app in 2022. i still wanted to see it. something about their perfect
      neon rollerblading outfits. i saw one preview and wasn't sure what the
      plot was going to be, i didn't care, i still wanted to see it. i wasn't
      expecting it to be amazing, but amazing it was. well done!! margot really
      knocked it out of the dollhouse. ryan i'll never look at the same way way
      again. this 1980s barbie superman is very pleased. it won't be long until
      the opening dance scene is all over the clock app. i haven't felt so
      compelled to learn choreography since michael jackson's thriller. also,
      girls rule. sorry, ken. 12 out of 24 found this helpful. was this review
      helpful? sign in to vote. permalink
  - text: >-
      anyone remember the film "life size"? from a far, i can see why people
      would absolutely hate this movie. just the concept of "barbie: the movie"
      is enough to make people feel like the art of cinema has been compromised
      by corporate america. but, as a whole, this movie was very well received.
      it made over a billion dollars at the box-office and was nominated for 8
      oscars including "best picture", so clearly it some people really liked
      it.there is a lot to enjoy in this film. the movie does a good job with
      poking fun at the barbie brand without it feeling too much like a spoof.
      this is a comedy, so the fact that the film is really funny is kind of an
      important element. understandably comedy is a subjective thing, so all i
      can say is for me, i laughed out loud several times through the movie. the
      movie is clever in how it treats its "worldbuilding" and nicely avoids any
      firm answers about how this world works. because, yeah, if you think about
      that sort of stuff in the film there is a lot that doesn't add up.it is
      nice that they don't spend too much time in "the real world" and focus on
      the creative fun of "barbie world". the movie is more visually unique and
      can do more gags when that is the case.when the movie is focusing on being
      a bizarre comedy, that is when some of the best and most memorable things
      happen. when it tries to have a more serious message, that is where it
      loses some momentum. don't misunderstand me, the movie needs some serious
      stuff in order to make the comedy work. and the stuff with ugly betty and
      her daughter is good emotional stuff. but towards the end, they realize
      that barbie needs to have a character arc and feel like they tack one on
      last second. there are some very funny jokes towards the end, but it does
      become a little repetitive and the message feels heavy handed by the 5th
      time it's brought up. side note: i wanted a cameo from the voice actress
      of barbie, kelly sheridan, but she wasn't there.i will emphasize this
      because hollywood will learn all the wrong lessons from this movie's
      success. we do not want a "polly pocket" movie or an "uno" movie. what
      made this film a success, beyond its brand or its marketing campaign, is
      that it was uniquely greta gerwig's vision. the movie wasn't concerned
      with mass audience appeal, it would tell jokes that they thought were
      funny and hoped others would enjoy as well. if you want to duplicate
      barbie's success, give creative people control to make some out there
      stuff.wrapped in plastic, it's fantastic.
  - text: >-
      great expectations this film exceeded all of my expectations a n d i was
      looking forward to seeing it. i wonder about any parents who might bring
      their children to see it expecting something quite different from what
      this film is. one hour fifty four minutes of fun from beginning to end.
      satire, sarcasm , humor at every turn. production values and acting off
      the charts good. i can't believe mattel let them make the movie with
      complete artistic freedom. think of nicole kidman in the amc promo before
      a movie starts and says, " somehow heartbreak feels good in a place like
      this ". well somehow watching a silly spoof like this movie feels great
      all the way through and even afterwards. i loved it and i am not surprised
      at the huge box office , this movie rocks. 4 out of 11 found this helpful.
      was this review helpful? sign in to vote. permalink
  - text: >-
      decent i like what they did with this movie and the characters with its
      combining the barbie world and the real world. barbie starts getting
      "vibes" and has to go into the real world to find the girl who played with
      her to set things right and winds up in the mattel headquarters. something
      resembling chaos ensues. ken joins her and winds up causing further
      damage. i like what they do in various stages of the story and with the
      characters. it was overall a very pleasant surprise snd a good movie with
      a good cast. margot robbie, ryan gosling, america ferrera, and will
      ferrell were all good in their roles. if you are a movie and/or a barbie
      fan, you will love this movie.*** out of **** 2 out of 7 found this
      helpful. was this review helpful? sign in to vote. permalink
pipeline_tag: text-classification
inference: true
model-index:
  - name: SetFit
    results:
      - task:
          type: text-classification
          name: Text Classification
        dataset:
          name: data/raw/barbie.jsonl
          type: unknown
          split: test
        metrics:
          - type: accuracy
            value: 0.8811688311688312
            name: Accuracy
          - type: precision
            value: 0.9952114924181963
            name: Precision
          - type: recall
            value: 0.8757022471910112
            name: Recall
          - type: f1
            value: 0.9316398954053045
            name: F1

SetFit

This is a SetFit model that can be used for Text Classification. 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
  • Classification head: a LogisticRegression instance
  • Maximum Sequence Length: 512 tokens
  • Number of Classes: 2 classes
  • Language: en
  • License: apache-2.0

Model Sources

Model Labels

Label Examples
negative
  • "definitely not for kids i've just taken 2 nieces, 9 and 14, to see barbie. they both hated it... really, really hated it!! and, me: i'm just stunned. i've no idea what i've just seen.if barbie is meant to be a dark satire, it's alright. if it's meant to be a kids movie, it's unconscionably bad. and, i'm totally confused which type of movie it's supposed to be. what the literal heck is going on!!if you're looking for a twenty first century dark cultural satire, you're at least in your twenties, you've an open mind, this is your movie... maybe. if you're looking for a movie to take your kids to, before getting ice cream, this is absolutely not the movie you're looking for. my advice: give barbie a miss and go straight for the ice cream. you will be so much happier. i wish i had. 15 out of 30 found this helpful. was this review helpful? sign in to vote. permalink"
  • "the most political movie i've ever seen. i loved the effort with the sets and the fun outfits. i also really enjoyed the ads threw out movie.i was really enjoying this movie but then it started getting really political, i was kind of fine with it but then they started making politics the whole story line and so it was really no longer a fun movie. after the movie finished i just ended up leaving miserable and like i waisted money... how is a family meant to enjoy this?? i can't see any 13 year old understanding anything they talk about.also they want to talk about how being a human is hard and that were not perfect but then they hire someone to play a teen girl who has perfect hair and skin. a bit of a confusing message? 180 out of 276 found this helpful. was this review helpful? sign in to vote. permalink"
  • "mediocre at best i had high expectations as a result of the media press, however these we're crushed from the start.first of all, i did expect it to feel a little generic and cheesy although all i could feel throughout the movie is that it was rushed and cheap. the storyline was dry and over-political.i'd have liked to see more lgbtq+ representation and breaking stereotypes, as it felt like just a generic film. even the barbies were considered stereotypes!comedy throughout was limited and wasn't engaging at all - sometimes trying too hard to emphasise feminism and going too far in the opposite direction to the world is heading in (i'm not encouraging patriarchy).however, i did find the music quite good (especially the billie eilish song) and did redeem the movie a little bit.in summary, the movie was mediocre at best and there's not much to discuss. it felt like a cheap version of movies like spirited and the greatest showman with no real emotion."
positive
  • "fabulously done so, i didn't have that much of a high expectation going in to see this because i really wasn't sure what is was going to be. i grew up playing barbie's and have watched the animated films many times with my kids.the movie from start to finish is so thoughtfully executed. it's for everyone, but mainly young girls need to see this. it's a great reminder of how special we are as women and how special all of us are individually as a person and the life we get to experience.another fantastic element is adding a very 90s feel to the film. you will laugh like you used to laugh when fun comedies would come out in theatre's years ago. i haven't seen just a good comedy with heart in years.i brought my 7yr old and we dressed up for it too. i wanted her to see me comfortable in my own skin and her as well and the film touches on that. it's suited for any age, regardless of the rating.i don't give high ratings like this to films usually, as i find small things usually that i wish had been addressed more... but not in barbie. what a fun movie and a great time you'll have watching this in theatre (or at home) knowing it's your childhood come to life."
  • "sure, life in plastic is fantastic but only in barbieland the barbie movie was unexpected. it was a colorful and clever ride in the cinema. i was not expecting all the deep emotions that the film gave. life is not all about perfection, which a lot of people wants to constantly achieve these days, imperfections is what identifies us and that's okay.i'm a visual kind of cinema goer and i have the say that dance sequence (dance the night) and the scene where barbie and ken where traveling to the real world were amazing. kudos to the creative team behind it, i absolutely adore the set.greta gerwig and her team delivered a visual spectacle with a heart. 10 out of 28 found this helpful. was this review helpful? sign in to vote. permalink"
  • "funny with social commentary barbie (margot robbie) lives in barbieland. ken (ryan gosling) is always desperate for her attention. all the ken and barbie dolls live in a happy matriarchy unaware of the real world. out of the blue, barbie starts pondering death and her existence. weird barbie (kate mckinnon) tells her that she has opened a portal to the real world and must fix whatever is her real world problem before she can return to her perfect self. she and stowaway ken find the real world completely different than their expectations. mattel ceo (will ferrell) insists on putting her back in the box. mattel secretary gloria (america ferrera) had caused the problem by drawing new forms of barbie.first, i love the premise and i love the 2001 opening. the start is a lot funnier than i expected. margot robbie is great and ryan gosling is hilarious. it's a great start in barbieland. the first moments in la is a little too much. quite frankly, barbie and ken would not stand out at venice beach. the male leering is good enough. they don't need to do the stereotype abusive guys. the real world should be realistic. barbie and ken would be better fishes out of the water in a recognizable regular world. the more average the real world is, the better it is for the characters to showcase their outrageousness.mattel is fun and i like the ridiculous silliness. will ferrell is a good way to show their outrageous quality. the movie has a lot of social commentary and that aspect does threaten to overwhelm it. the last act has some wonky moments as the movie tries to wrap its arms around the heavier social discussions. i would like to keep that more contained and concentrate on the mother daughter relationships. it's gloria and sasha, but it's also ruth and barbara. that's a perfect way to end the movie. i do like the montage idea, but i didn't realize what it was doing initially. it would have been fine to do that for the closing credits. all in all, this is a funny engaging movie and it's able to deal with some of the tougher social material."

Evaluation

Metrics

Label Accuracy Precision Recall F1
all 0.8812 0.9952 0.8757 0.9316

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("carlesoctav/SentimentClassifierBarbieDune-8shot")
# Run inference
preds = model("decent i like what they did with this movie and the characters with its combining the barbie world and the real world. barbie starts getting \"vibes\" and has to go into the real world to find the girl who played with her to set things right and winds up in the mattel headquarters. something resembling chaos ensues. ken joins her and winds up causing further damage. i like what they do in various stages of the story and with the characters. it was overall a very pleasant surprise snd a good movie with a good cast. margot robbie, ryan gosling, america ferrera, and will ferrell were all good in their roles. if you are a movie and/or a barbie fan, you will love this movie.*** out of **** 2 out of 7 found this helpful. was this review helpful? sign in to vote. permalink")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 112 234.1953 1424
Label Training Sample Count
negative 64
positive 64

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (1, 1)
  • 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.0019 1 0.3627 -
0.0962 50 0.0007 -
0.1923 100 0.1003 -
0.2885 150 0.0001 -
0.3846 200 0.0001 -
0.4808 250 0.0001 -
0.5769 300 0.0001 -
0.6731 350 0.0 -
0.7692 400 0.0001 -
0.8654 450 0.0 -
0.9615 500 0.0 -
1.0 520 - 0.2312
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.10.11
  • SetFit: 1.0.3
  • Sentence Transformers: 2.5.1
  • Transformers: 4.38.2
  • PyTorch: 2.0.1
  • Datasets: 2.18.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}
}