CoolFace
Modelpublic

JohanHeinsen/Labour_ads_demand

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes9downloads
Model Card

SetFit with JohanHeinsen/OldNewsSegmentationSBERTV0.1

This is a SetFit model that can be used for Text Classification. This SetFit model uses JohanHeinsen/Old_News_Segmentation_SBERT_V0.1 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 Sources

Model Labels

LabelExamples
0<ul><li>'En skikkelig Karl fra Jylland søger Condition til St. Hansdag og er at finde paa Christianshavn paa Hiørnet af Dronningensgade og Torvegagen i Kielderen i Nr. 359.'</li><li>'En Amme søger Plads, eller i Mangel som Goldamme, er at finde i Nyehavn, anden Port fra Charlottenborg.'</li><li>'En skikkelig Pige, som kan forevise de bedste Skudsmaale, ønsker sig en Tieneste som Frøkenpige eller Stuepige til 1ste Novbr. enten paa en Herregaard eller hos en honet Familie i Kiøbstæden. Hun anvises fra Adressecomtoiret.'</li></ul>
1<ul><li>'En skikkelig Jomfru, som forstaaer godt Madlavning, Vadsk, Reengjøren og deslige, kan faae Condition paa Vesterbro Nr. 63, men uden gode Recommendationer om Troskab og god Opførsel nytter det ikke at mælde sig.'</li><li>'En Pige, som kan paatage sig et Kjøkken, kan strax faae Condition, naar hun mælder sig i Toldbodgaden Nr. 44, i Stuen.'</li><li>'En Goldamme kan strax faae Condition i Kronprindsensgaden Nr. 39, 3die Sal.'</li></ul>

Evaluation

Metrics

LabelAccuracyF1PrecisionRecall
all0.94340.92390.89220.9579

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("En Pige søger Tieneste hos eenlige Folk, eller hvor der er et Par Børn at passe, anvises i lille Færgestrædet Nr. 231.")

<!--

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 count832.1640176
LabelTraining Sample Count
0389
1227

Training Hyperparameters

  • —batch_size: (16, 16)
  • —num_epochs: (2, 2)
  • —max_steps: -1
  • —sampling_strategy: oversampling
  • —num_iterations: 12
  • —bodylearningrate: (2e-05, 2e-05)
  • —headlearningrate: 2e-05
  • —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.001110.0621-
0.0541500.2937-
0.10821000.1367-
0.16231500.037-
0.21652000.0215-
0.27062500.0165-
0.32473000.0103-
0.37883500.0134-
0.43294000.0146-
0.48704500.003-
0.54115000.0028-
0.59525500.0027-
0.64946000.0039-
0.70356500.0003-
0.75767000.0001-
0.81177500.0001-
0.86588000.0001-
0.91998500.0001-
0.97409000.0-
1.02819500.0-
1.082310000.0-
1.136410500.0-
1.190511000.0-
1.244611500.0-
1.298712000.0-
1.352812500.0-
1.406913000.0-
1.461013500.0-
1.515214000.0-
1.569314500.0-
1.623415000.0-
1.677515500.0-
1.731616000.0-
1.785716500.0-
1.839817000.0-
1.893917500.0-
1.948118000.0-

Framework Versions

  • —Python: 3.11.12
  • —SetFit: 1.1.3
  • —Sentence Transformers: 4.1.0
  • —Transformers: 4.51.3
  • —PyTorch: 2.7.0
  • —Datasets: 2.19.2
  • —Tokenizers: 0.21.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. -->