Text Classification
Transformers
Safetensors
PyTorch
English
bert
biomedical
psynamic
text-embeddings-inference
Instructions to use STRIDE-lab/biolinkbert-data-type-20261107 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use STRIDE-lab/biolinkbert-data-type-20261107 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="STRIDE-lab/biolinkbert-data-type-20261107")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("STRIDE-lab/biolinkbert-data-type-20261107") model = AutoModelForSequenceClassification.from_pretrained("STRIDE-lab/biolinkbert-data-type-20261107", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from STRIDE-lab/biolinkbert-data-type-20261107: direct link, hf CLI and curl.
- Browser
- Download file 3.43 kB
-
https://huggingface.co/STRIDE-lab/biolinkbert-data-type-20261107/resolve/main/README.md
- Command line
-
hf download hf://STRIDE-lab/biolinkbert-data-type-20261107/README.md
-
curl -L -o README.md https://huggingface.co/STRIDE-lab/biolinkbert-data-type-20261107/resolve/main/README.md
3.43 kB
| library_name: transformers | |
| base_model: michiyasunaga/BioLinkBERT-base | |
| tags: | |
| - transformers | |
| - pytorch | |
| - biomedical | |
| - text-classification | |
| - psynamic | |
| license: apache-2.0 | |
| language: | |
| - en | |
| pipeline_tag: text-classification | |
| # biolinkbert-data-type-20261107 | |
| Fine-tuned model from the PsyNamic project ([code](https://github.com/Ineichen-Group/PsyNamic), [webapp](https://psynamic.dcr.unibe.ch)): Data Type. | |
| This is the model deployed in the PsyNamic webapp after the revision (Nov 2026). It supersedes [STRIDE-lab/biobert-data-type-20250221](https://huggingface.co/STRIDE-lab/biobert-data-type-20250221) (tag `submission-v1`, initial submission). All current models: [PsyNamic collection](https://huggingface.co/collections/STRIDE-lab/psynamic). | |
| ## Base Model | |
| `michiyasunaga/BioLinkBERT-base` | |
| ## Task | |
| **Data Type** | |
| Specifies whether data were collected longitudinally or cross-sectionally. | |
| ## Labels (id2label) | |
| | ID | Label | Definition | | |
| |---|---|---| | |
| | 0 | Cross-sectional | Outcomes are measured during one single time point (or more than one time point within ≤ 24 hours). | | |
| | 1 | Longitudinal long | Outcomes are measures during at least two different time points > 24 hours apart and the total follow-up time is ≥ 3 months. | | |
| | 2 | Longitudinal short | Outcomes are measures during at least two different time points > 24 hours apart but the total follow-up time is < 3 months. | | |
| | 3 | Not applicable | e.g., for systematic reviews or for studies pooling a variety of other studies together without providing information about data type. | | |
| | 4 | Unknown | Data type is unknown. | | |
| ## Prediction rule | |
| Single-label: softmax over the labels, the label with the highest probability (argmax) is predicted. | |
| ## Model selection | |
| Five base models (BiomedBERT-abstract, BioBERT, BioLinkBERT, ClinicalBERT, SciBERT) were fine-tuned with identical hyperparameters. The checkpoint is the one with the lowest validation loss (early stopping), and the base model was selected on the validation set (weighted F1). The test set was used once, after selection. | |
| ## Test Performance | |
| Held-out test set (96 abstracts), argmax as in the webapp, 95% bootstrap CIs (1,000 BCa resamples). | |
| | Metric (test) | Value [95% CI] | | |
| |---|---| | |
| | **Weighted F1** | **0.712 [0.608–0.804]** | | |
| | Weighted precision | 0.725 [0.600–0.806] | | |
| | Weighted recall | 0.729 [0.635–0.812] | | |
| ## Usage | |
| ```python | |
| import torch | |
| from transformers import AutoTokenizer, AutoModelForSequenceClassification | |
| repo = "STRIDE-lab/biolinkbert-data-type-20261107" | |
| tokenizer = AutoTokenizer.from_pretrained(repo) | |
| model = AutoModelForSequenceClassification.from_pretrained(repo) | |
| inputs = tokenizer("<title>. <abstract>", truncation=True, max_length=512, return_tensors="pt") | |
| logits = model(**inputs).logits | |
| pred = model.config.id2label[int(logits.argmax(-1))] | |
| ``` | |
| ## Training Parameters | |
| ```json | |
| { | |
| "data": "<private_dataset>", | |
| "task": "Data Type", | |
| "model": "biolinkbert", | |
| "cross_val": false, | |
| "batch_size": 8, | |
| "learning_rate": 5e-05, | |
| "weight_decay": 0.01, | |
| "lr_scheduler": "linear", | |
| "warmup_ratio": 0.1, | |
| "epochs": 30, | |
| "dropout": 0.1, | |
| "early_stopping_patience": 5, | |
| "gradient_clipping": 1.0, | |
| "max_length": 512, | |
| "threshold": 0.5, | |
| "is_multilabel": false | |
| } | |
| ``` | |
| `threshold` (0.5) is only used to compute the validation metrics of multi-label tasks during training. It has no effect for this single-label model, which predicts by argmax. | |