Fine-tuned model from the PsyNamic project (code, webapp): Substances.
This is the model deployed in the PsyNamic webapp after the revision (Nov 2026). It supersedes STRIDE-lab/biolinkbert-substances-20250228 (tag submission-v1, initial submission). All current models: PsyNamic collection.
microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract
Substances (multi-label: several labels per abstract possible)
Lists the psychedelic substance(s) studied.
| ID | Label | Definition |
|---|---|---|
| 0 | Ketamine | Including racemic ketamine (except if S- or R-ketamine is specified). |
| 1 | S-Ketamine | – |
| 2 | R-Ketamine | – |
| 3 | MDMA | Also referred to as Ecstasy. |
| 4 | LSD | – |
| 5 | Psilocybin | Or psilocin. |
| 6 | Psychedelic mushrooms | as organic compound, including psychedelic truffles. |
| 7 | Ayahuasca | DMT plus MAO-inhibitor, also 5-MeO-DMT plus MAO-inhibitor. |
| 8 | DMT | DMT / N,N-DMT, sometimes referred to as tryptamines. |
| 9 | 5-MeO-DMT | Sometimes referred to as tryptamines. |
| 10 | Mescaline | – |
| 11 | Ibogaine | Ibogaine / iboga, includes noribogaine. |
| 12 | Salvinorin A | Also referred to as Salvia or Salvia Divinorum. |
| 13 | Combination Therapy | One or more of these substances combined with any other non-psychedelic substance or any other type of therapy (e.g., electroconvulsive therapy or psychotherapy) and in a therapeutic context (i.e., do not annotate combination therapy if an MDMA polydrug abuser is also smoking cannabis). When 'In addition to standard treatment' is mentioned, we assume 'Combination Therapy'. |
| 14 | Analogue | It is not the exact substance listed above but closely related as claimed by the study authors, e.g. MDE is an analogue of MDMA (classify MDMA and analogue). |
| 15 | Unknown | E.g., when just mentioning psychedelics without further specification. |
Multi-label: a sigmoid is applied per label, and every label with probability ≥ 0.10 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.
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.
Held-out test set (96 abstracts), tuned threshold as in the webapp, 95% bootstrap CIs (1,000 BCa resamples).
| Metric (test) | Value [95% CI] |
|---|---|
| Weighted F1 | 0.887 [0.824–0.917] |
| Weighted precision | 0.836 [0.754–0.873] |
| Weighted recall | 0.962 [0.915–0.985] |
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
repo = "STRIDE-lab/biomedbert-abstract-substances-20261106"
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
probs = torch.sigmoid(logits)[0]
pred = [model.config.id2label[i] for i, p in enumerate(probs) if p >= 0.10]
{
"data": "<private_dataset>",
"task": "Substances",
"model": "biomedbert-abstract",
"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": true
}
threshold (0.5) is only the cut-off used to compute the validation metrics during training. It does not affect the model weights or the checkpoint choice (lowest validation loss). Predictions in the webapp and the test performance above use the tuned threshold 0.10 (see Prediction rule).
microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract