Team Ai
Modelpublic

oyvindbs/setfit-nb-sbert-v2-large-norec-sentiment-binary

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes4downloads
Model Card

SetFit with NbAiLab/nb-sbert-v2-large

This is a SetFit model that can be used for Text Classification. This SetFit model uses NbAiLab/nb-sbert-v2-large 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. 1.Fine-tuning a Sentence Transformer with contrastive learning.
  2. 2.Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

  • —Model Type: SetFit
  • —Sentence Transformer body: NbAiLab/nb-sbert-v2-large
  • —Classification head: a LogisticRegression instance
  • —Maximum Sequence Length: 512 tokens
  • —Number of Classes: 2 classes <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Model Labels

LabelExamples
1<ul><li>'Den kan skryte av firehjulsdrift , automatgir og stor motor .'</li><li>'« Command & Conquer » har blitt selve symbolet på tradisjonelle strategispill , serien fnyser av moderne vrier og såkalte « nyvinninger » .'</li><li>'Skriveren benytter sublimeringsteknikk , i likhet med Dell Photoprinter 540 .'</li></ul>
0<ul><li>'Ingen av merkets to bestselgende biler har dermed nådd topp 30-listen hittil i år .'</li><li>'« Kameo » tar forholdsvis lang tid å gjennomføre , men mye av årsaken til det er bergene av frustrasjon man møter her og der .'</li><li>'Dommerne etterlyste råskap , mens VGs musikkjournalist Morten Ståle Nilsen mente opptredenen ikke var helt heldig .'</li></ul>

Evaluation

Metrics

LabelAccuracy
all0.8919

Uses

Direct Use for Inference

First install the SetFit library:

bash
pip install setfit

Then you can load this model and run inference.

python
from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("setfit_model_id")
# Run inference
preds = model("Filmen er til tider nesten hypnotisk vakker .")

<!--

Downstream Use

List how someone could finetune this model on their own dataset. -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Set Metrics

Training setMinMedianMax
Word count119.03568
LabelTraining Sample Count
072
1128

Training Hyperparameters

  • —batch_size: (30, 30)
  • —num_epochs: (5, 5)
  • —max_steps: -1
  • —sampling_strategy: oversampling
  • —bodylearningrate: (2e-05, 1e-05)
  • —headlearningrate: 0.01
  • —loss: CosineSimilarityLoss
  • —distancemetric: cosinedistance
  • —margin: 0.25
  • —endtoend: False
  • —use_amp: False
  • —warmup_proportion: 0.1
  • —l2_weight: 0.01
  • —seed: 42
  • —evalmaxsteps: -1
  • —loadbestmodelatend: False

Training Results

EpochStepTraining LossValidation Loss
0.001410.2952-
0.0689500.2914-
0.13771000.1583-
0.20661500.0103-
0.27552000.0012-
0.34442500.0005-
0.41323000.0003-
0.48213500.0003-
0.55104000.0002-
0.61984500.0001-
0.68875000.0001-
0.75765500.0001-
0.82646000.0001-
0.89536500.0001-
0.96427000.0001-
1.03317500.0001-
1.10198000.0001-
1.17088500.0001-
1.23979000.0001-
1.30859500.0001-
1.377410000.0001-
1.446310500.0001-
1.515211000.0001-
1.584011500.0001-
1.652912000.0001-
1.721812500.0001-
1.790613000.0001-
1.859513500.0001-
1.928414000.0-
1.997214500.0-
2.066115000.0-
2.135015500.0-
2.203916000.0-
2.272716500.0-
2.341617000.0-
2.410517500.0-
2.479318000.0-
2.548218500.0-
2.617119000.0-
2.686019500.0-
2.754820000.0-
2.823720500.0-
2.892621000.0-
2.961421500.0-
3.030322000.0-
3.099222500.0-
3.168023000.0-
3.236923500.0-
3.305824000.0-
3.374724500.0-
3.443525000.0-
3.512425500.0-
3.581326000.0-
3.650126500.0-
3.719027000.0-
3.787927500.0-
3.856728000.0-
3.925628500.0-
3.994529000.0-
4.063429500.0-
4.132230000.0-
4.201130500.0-
4.270031000.0-
4.338831500.0-
4.407732000.0-
4.476632500.0004-
4.545533000.0003-
4.614333500.0-
4.683234000.0-
4.752134500.0-
4.820935000.0006-
4.889835500.0-
4.958736000.0-

Framework Versions

  • —Python: 3.11.15
  • —SetFit: 1.1.3
  • —Sentence Transformers: 3.3.1
  • —Transformers: 4.44.2
  • —PyTorch: 2.11.0
  • —Datasets: 4.8.5
  • —Tokenizers: 0.19.1

Citation

BibTeX

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}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->