CoolFace
Modelpublic

JohanHeinsen/Labour_ads_gender

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

SetFit with JohanHeinsen/OldNewsSegmentationSBERTV0.1

This is a SetFit model used to classify gender in labour advertisements from the eigtheenth and nineteenth centuries. It was trained by Sofus Landor Dam and Johan Heinsen.

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
1<ul><li>'En skikkelig Pige søger Condition strar eller til St. Hansdag som Opvartningspige, i Mangel deraf som Stue= eller Enevighvor Konen gaaer i Huusholdningen, anvises paa Hiørnet af Larsbjørnstræde og Volden 236 i Stuen.'</li><li>'En Pige fra Landet søger strax Condition for Amme eller Goldamme, er at finde paa Vesterbro Nr. 9.'</li><li>'En Kone, der godt kan vaske, stryge og tillige godt lave Mad, ønsker sig Condition hos en honet Familie som Kokke eller Enepige, eller og at gaae i ugeviis, hun kan tillige i malke, om forlanges, anvises i Bredgaden Nr. 202 paa 5 første Sal.'</li></ul>
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 svensk Karl, nyelig kommen her til Staden, ønsker sig Condition som Kudsk eller Tienercher i Byen, eller paa Landet, har sine behørige Skudsmaal, er at finde i store Kongensgade No. 51.'</li><li>'En Student, der er øvet i at informere, tilbyder sig at give Underviisning i det tydske Sprog, Regning, Skrivning, Religion, samt andre til Akademiet hørende Videnskaber Anviisningen gives i Adelgaden Nr. 206, første Sal, det første Huus paa høire Haand fra Gottersgaden.'</li></ul>

Evaluation

Metrics

LabelAccuracyF1PrecisionRecall
all0.99240.99440.99440.9944

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("JohanHeinsen/Labour_ads_gender")
# Run inference
preds = model("En Stuepige, som forstaaer hvad hun bør, søger til Paaske; er at finde i Dronningens Tvergade Nr. 363 i Stuen.")

<!--

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.4388176
LabelTraining Sample Count
0194
1419

Training Hyperparameters

  • —batch_size: (16, 16)
  • —num_epochs: (3, 3)
  • —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.2907-
0.0543500.2618-
0.10871000.0493-
0.16301500.0181-
0.21742000.0038-
0.27172500.001-
0.32613000.0005-
0.38043500.0003-
0.43484000.0002-
0.48914500.0001-
0.54355000.0001-
0.59785500.0001-
0.65226000.0001-
0.70656500.0001-
0.76097000.0001-
0.81527500.0001-
0.86968000.0001-
0.92398500.0-
0.97839000.0-
1.03269500.0-
1.087010000.0-
1.141310500.0-
1.195711000.0-
1.2511500.0-
1.304312000.0-
1.358712500.0-
1.413013000.0-
1.467413500.0-
1.521714000.0-
1.576114500.0-
1.630415000.0-
1.684815500.0-
1.739116000.0-
1.793516500.0-
1.847817000.0-
1.902217500.0-
1.956518000.0-
2.010918500.0-
2.065219000.0-
2.119619500.0-
2.173920000.0-
2.228320500.0-
2.282621000.0-
2.337021500.0-
2.391322000.0-
2.445722500.0-
2.523000.0-
2.554323500.0-
2.608724000.0-
2.663024500.0-
2.717425000.0-
2.771725500.0-
2.826126000.0-
2.880426500.0-
2.934827000.0-
2.989127500.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. -->