--- library_name: transformers base_model: dmis-lab/biobert-v1.1 tags: - transformers - pytorch - biomedical - text-classification - psynamic license: apache-2.0 language: - en pipeline_tag: text-classification --- # biobert-setting-20261106 Fine-tuned model from the PsyNamic project ([code](https://github.com/Ineichen-Group/PsyNamic), [webapp](https://psynamic.dcr.unibe.ch)): Setting. This is the model deployed in the PsyNamic webapp after the revision (Nov 2026). It supersedes [STRIDE-lab/pubmedbert-setting-20250221](https://huggingface.co/STRIDE-lab/pubmedbert-setting-20250221) (tag `submission-v1`, initial submission). All current models: [PsyNamic collection](https://huggingface.co/collections/STRIDE-lab/psynamic). ## Base Model `dmis-lab/biobert-v1.1` ## Task **Setting** (multi-label: several labels per abstract possible) Identifies the context in which the substance was applied (e.g., clinical, naturalistic, party). ## Labels (id2label) | ID | Label | Definition | |---|---|---| | 0 | Clinical | The substance is applied in a clinical setting, e.g., a room of a clinic (this will be the large majority). | | 1 | Naturalistic | The substance is applied in a naturalistic setting, e.g., within a traditional ayahuasca ceremony in nature. | | 2 | Party setting | – | | 3 | Other setting | – | | 4 | Unknown | Select only if it is unclear from the context. E.g., select this for studies which look at memory functions from MDMA users in which the setting is not described. | | 5 | Not applicable | E.g., for most systematic reviews, except e.g., systematic reviews which look at naturalistic settings of psychedelic substances. | | 6 | Palliative Setting | I.e. end of life. | ## Prediction rule Multi-label: a sigmoid is applied per label, and every label with probability **≥ 0.12** is predicted. This is the threshold used in the PsyNamic webapp. It was tuned on the validation set with a pre-specified rule: start at the threshold with maximal weighted F1, then lower it as long as weighted precision stays within 0.05 of its value there. ## 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 (98 abstracts), tuned threshold as in the webapp, 95% bootstrap CIs (1,000 BCa resamples). | Metric (test) | Value [95% CI] | |---|---| | **Weighted F1** | **0.850 [0.762–0.906]** | | Weighted precision | 0.820 [0.720–0.882] | | Weighted recall | 0.891 [0.814–0.942] | ## Usage ```python import torch from transformers import AutoTokenizer, AutoModelForSequenceClassification repo = "STRIDE-lab/biobert-setting-20261106" tokenizer = AutoTokenizer.from_pretrained(repo) model = AutoModelForSequenceClassification.from_pretrained(repo) inputs = tokenizer("