vera-bernhard commited on
Commit
c7b50db
·
verified ·
1 Parent(s): 5cbca68

Add model card

Browse files
Files changed (1) hide show
  1. README.md +102 -0
README.md ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ base_model: allenai/scibert_scivocab_uncased
4
+ tags:
5
+ - transformers
6
+ - pytorch
7
+ - biomedical
8
+ - text-classification
9
+ - psynamic
10
+ license: apache-2.0
11
+ language:
12
+ - en
13
+ pipeline_tag: text-classification
14
+ ---
15
+
16
+ # scibert-condition-20261106
17
+
18
+ Fine-tuned model from the PsyNamic project ([code](https://github.com/Ineichen-Group/PsyNamic), [webapp](https://psynamic.dcr.unibe.ch)): Condition.
19
+ This is the model deployed in the PsyNamic webapp after the revision (Nov 2026). It supersedes [STRIDE-lab/pubmedbert-condition-20250221](https://huggingface.co/STRIDE-lab/pubmedbert-condition-20250221) (tag `submission-v1`, initial submission).
20
+
21
+ ## Base Model
22
+
23
+ `allenai/scibert_scivocab_uncased`
24
+
25
+ ## Task
26
+
27
+ Condition
28
+
29
+ ## Labels (id2label)
30
+
31
+ | ID | Label |
32
+ |---|---|
33
+ | 0 | Psychiatric condition |
34
+ | 1 | Depression |
35
+ | 10 | (Chronic) Pain |
36
+ | 11 | Palliative Setting |
37
+ | 12 | Recreational Drug Use |
38
+ | 13 | Healthy Participants |
39
+ | 2 | Anxiety |
40
+ | 3 | Post-traumatic stress disorder (PTSD) |
41
+ | 4 | Alcoholism |
42
+ | 5 | Other addictions (e.g. smoking) |
43
+ | 6 | Anorexia |
44
+ | 7 | Alzheimer’s disease |
45
+ | 8 | Non-Alzheimer dementia |
46
+ | 9 | Substance abuse |
47
+
48
+ ## Prediction rule
49
+
50
+ 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.
51
+
52
+ ## Model selection
53
+
54
+ 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.
55
+
56
+ ## Test Performance
57
+
58
+ Held-out test set (96 abstracts), tuned threshold as in the webapp, 95% bootstrap CIs (1,000 BCa resamples).
59
+
60
+ | Metric (test) | Value [95% CI] |
61
+ |---|---|
62
+ | **Weighted F1** | **0.902 [0.834–0.937]** |
63
+ | Weighted precision | 0.865 [0.778–0.909] |
64
+ | Weighted recall | 0.959 [0.897–0.988] |
65
+
66
+ ## Usage
67
+
68
+ ```python
69
+ import torch
70
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
71
+
72
+ repo = "STRIDE-lab/scibert-condition-20261106"
73
+ tokenizer = AutoTokenizer.from_pretrained(repo)
74
+ model = AutoModelForSequenceClassification.from_pretrained(repo)
75
+ inputs = tokenizer("<title>. <abstract>", truncation=True, max_length=512, return_tensors="pt")
76
+ logits = model(**inputs).logits
77
+ probs = torch.sigmoid(logits)[0]
78
+ pred = [model.config.id2label[i] for i, p in enumerate(probs) if p >= 0.12]
79
+ ```
80
+
81
+ ## Training Parameters
82
+
83
+ ```json
84
+ {
85
+ "data": "<private_dataset>",
86
+ "task": "Condition",
87
+ "model": "scibert",
88
+ "cross_val": false,
89
+ "batch_size": 8,
90
+ "learning_rate": 5e-05,
91
+ "weight_decay": 0.01,
92
+ "lr_scheduler": "linear",
93
+ "warmup_ratio": 0.1,
94
+ "epochs": 30,
95
+ "dropout": 0.1,
96
+ "early_stopping_patience": 5,
97
+ "gradient_clipping": 1.0,
98
+ "max_length": 512,
99
+ "threshold": 0.5,
100
+ "is_multilabel": true
101
+ }
102
+ ```