Instructions to use STRIDE-lab/scibert-condition-20261106 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use STRIDE-lab/scibert-condition-20261106 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="STRIDE-lab/scibert-condition-20261106")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("STRIDE-lab/scibert-condition-20261106") model = AutoModelForSequenceClassification.from_pretrained("STRIDE-lab/scibert-condition-20261106", device_map="auto") - Notebooks
- Google Colab
- Kaggle
scibert-condition-20261106
Fine-tuned model from the PsyNamic project (code, webapp): Condition.
This is the model deployed in the PsyNamic webapp after the revision (Nov 2026). It supersedes STRIDE-lab/pubmedbert-condition-20250221 (tag submission-v1, initial submission). All current models: PsyNamic collection.
Base Model
allenai/scibert_scivocab_uncased
Task
Condition (multi-label: several labels per abstract possible)
Indicates the medical or psychological condition of participants under study.
Labels (id2label)
| ID | Label | Definition |
|---|---|---|
| 0 | Psychiatric condition | E.g., PTSD, depression, anxiety, addiction. If a specific disorder is mentioned, annotate both this and the specific disorder. |
| 1 | Depression | β |
| 2 | Anxiety | β |
| 3 | Post-traumatic stress disorder (PTSD) | β |
| 4 | Alcoholism | β |
| 5 | Other addictions (e.g. smoking) | Includes addictions like smoking and others. |
| 6 | Anorexia | β |
| 7 | Alzheimerβs disease | β |
| 8 | Non-Alzheimer dementia | β |
| 9 | Substance abuse | E.g., when the study participants are polydrug users/abusers of certain substances and the effect of one or more psychedelics is studied on an outcome different to treating the addiction to drugs. |
| 10 | (Chronic) Pain | E.g., cluster headache. |
| 11 | Palliative Setting | E.g., end of life. |
| 12 | Recreational Drug Use | β |
| 13 | Healthy Participants | E.g., includes population studies (e.g., recreational drug use) where most lack major medical conditions. |
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 (96 abstracts), tuned threshold as in the webapp, 95% bootstrap CIs (1,000 BCa resamples).
| Metric (test) | Value [95% CI] |
|---|---|
| Weighted F1 | 0.902 [0.834β0.937] |
| Weighted precision | 0.865 [0.778β0.909] |
| Weighted recall | 0.959 [0.897β0.988] |
Usage
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
repo = "STRIDE-lab/scibert-condition-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.12]
Training Parameters
{
"data": "<private_dataset>",
"task": "Condition",
"model": "scibert",
"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.12 (see Prediction rule).
- Downloads last month
- 63
Model tree for STRIDE-lab/scibert-condition-20261106
Base model
allenai/scibert_scivocab_uncased