SetFit with TurkuNLP/bert-base-finnish-cased-v1
This is a SetFit model that can be used for Text Classification. This SetFit model uses TurkuNLP/bert-base-finnish-cased-v1 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:
- Fine-tuning a Sentence Transformer with contrastive learning.
- Training a classification head with features from the fine-tuned Sentence Transformer.
Model Details
Model Description
- Model Type: SetFit
- Sentence Transformer body: TurkuNLP/bert-base-finnish-cased-v1
- Classification head: a LogisticRegression instance
- Maximum Sequence Length: 512 tokens
- Number of Classes: 2 classes
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
Model Labels
| Label | Examples |
|---|---|
| 0 |
|
| 1 |
|
Evaluation
Metrics
| Label | Metric |
|---|---|
| all | 0.9150 |
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("Finnish-actions/SetFit-FinBERT1-Avg-request")
# Run inference
preds = model("Etunimi Sukunimi 🙋♀️")
Training Details
Training Set Metrics
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 1 | 20.3800 | 213 |
| Label | Training Sample Count |
|---|---|
| 0 | 758 |
| 1 | 84 |
Training Hyperparameters
- batch_size: (16, 16)
- num_epochs: (4, 4)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 6
- 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
- l2_weight: 0.01
- seed: 42
- evaluation_strategy: epoch
- eval_max_steps: -1
- load_best_model_at_end: False
Framework Versions
- Python: 3.11.9
- SetFit: 1.1.3
- Sentence Transformers: 3.2.0
- Transformers: 4.44.0
- PyTorch: 2.4.0+cu124
- Datasets: 2.21.0
- Tokenizers: 0.19.1
Citation
BibTeX
@article{paakki-implicit-indirect,
doi = {https://doi.org/10.3384/nejlt.2000-1533.2025.5980},
url = {https://nejlt.ep.liu.se/article/view/5980},
author = {Paakki, Henna and Toivanen, Pihla and Kajava, Kaisla},
title = {Implicit and Indirect: Detecting Face-threatening and Paired Actions in Asynchronous Online Conversations},
publisher = {Northern European Journal of Language Technology (NEJLT)},
volume= {11},
number= {1},
year = {2025}
}
- Downloads last month
- 26
Model tree for Finnish-actions/SetFit-FinBERT1-Avg-request
Base model
TurkuNLP/bert-base-finnish-cased-v1Evaluation results
- Metric on Unknowntest set self-reported0.915