Text Classification
Transformers
Safetensors
English
chest2vec_labeler
feature-extraction
radiology
chest-ct
report-labeling
multi-label
ct-rate
chexbert-style-f1
custom_code
Instructions to use chest2vec/chest2vec_labeler with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chest2vec/chest2vec_labeler with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="chest2vec/chest2vec_labeler", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("chest2vec/chest2vec_labeler", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Evaluation: replace threshold-based F1 tables with AUROC / 3-class F1 / binary F1 (uncertain→neg) on CT-RATE + SNUH, with 95% CIs; add ≥1-positive subset
Browse files
README.md
CHANGED
|
@@ -132,47 +132,33 @@ Per-label threshold tuning lifts macro-F1 by ~4–6 points over the fixed-0.5 th
|
|
| 132 |
|
| 133 |
## Evaluation
|
| 134 |
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
`eval_sample1000_private.json` (private). Metric = **macro-F1** of the **positive class** (softmax
|
| 138 |
-
probability of class 2) at **threshold 0.33**. Because the all-labels macro is dragged down by
|
| 139 |
-
sparse-tail labels, the **headline restricts to leaf labels with ≥30 positive examples** in that
|
| 140 |
-
eval set — **53 of the evaluated leaves on the public set, 29 on the private set**. Upper/anatomy
|
| 141 |
-
rows are the hierarchy roll-up.
|
| 142 |
|
| 143 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
| upper (≥30 positives) | 27 | 0.938 | 0.994 |
|
| 150 |
-
| anatomy | 10 | 0.956 | 0.993 |
|
| 151 |
-
|
| 152 |
-
**Private evaluation set (1,000 reports)** — a held-out internal set, not released:
|
| 153 |
|
| 154 |
-
|
|
| 155 |
|---|--:|--:|--:|
|
| 156 |
-
|
|
| 157 |
-
|
|
| 158 |
-
|
|
| 159 |
-
|
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
| Private | **0.820** | 0.761 | 0.795 |
|
| 168 |
-
|
| 169 |
-
F1-optimal thresholds vary widely by label (~0.04–0.75), so per-label tuning recovers ~4–6 macro-F1
|
| 170 |
-
points over a single global threshold.
|
| 171 |
-
|
| 172 |
-
Leaf macro-AUC barely moves public→private (**0.989 → 0.972**), i.e. label ranking transfers to
|
| 173 |
-
the unseen set; the F1 gap is mostly threshold / labeling-convention, not a domain failure.
|
| 174 |
-
Separately, a radiologist spot-checked **966** reports of the public test labels (857 fully
|
| 175 |
-
accepted / 60 imperfect-but-acceptable / 49 failed; see the [dataset card](https://huggingface.co/datasets/chest2vec/chest2vec_labels)).
|
| 176 |
|
| 177 |
## Caveats
|
| 178 |
|
|
|
|
| 132 |
|
| 133 |
## Evaluation
|
| 134 |
|
| 135 |
+
Reported as macro-averages over per-label leaf metrics, with 95% bootstrap percentile confidence
|
| 136 |
+
intervals. Compare only within a row.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
|
| 138 |
+
- **AUROC** — macro one-versus-rest AUROC on the positive-class probability. **Threshold-free.**
|
| 139 |
+
- **Three-class F1** — macro F1 from the ternary head (`negative` / `uncertain` / `positive`).
|
| 140 |
+
Uses `argmax`; no threshold involved.
|
| 141 |
+
- **Binary F1** — macro F1 with `uncertain` mapped to `negative`. Per-label decision thresholds
|
| 142 |
+
are selected on the CT-RATE tuning partition (not on the reported eval set).
|
| 143 |
|
| 144 |
+
Two label subsets are reported per eval set:
|
| 145 |
+
- **≥30 positives** — leaves with at least 30 positive test instances (headline).
|
| 146 |
+
- **≥1 positive** — all evaluated leaves (of the 137, 129 had ≥1 positive in CT-RATE and 120 in
|
| 147 |
+
SNUH).
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
+
| Label set | AUROC | Three-class F1 | Binary F1 |
|
| 150 |
|---|--:|--:|--:|
|
| 151 |
+
| **CT-RATE (in distribution)** | | | |
|
| 152 |
+
| 53 (≥30 pos) | **0.989** (0.988, 0.991) | 0.686 (0.667, 0.692) | **0.888** (0.879, 0.896) |
|
| 153 |
+
| 129 (≥1 pos) | 0.988 (0.985, 0.991) | 0.610 (0.592, 0.612) | 0.769 (0.731, 0.777) |
|
| 154 |
+
| **SNUH (external)** | | | |
|
| 155 |
+
| 29 (≥30 pos) | **0.971** (0.967, 0.975) | 0.590 (0.579, 0.598) | **0.766** (0.749, 0.780) |
|
| 156 |
+
| 120 (≥1 pos) | 0.972 (0.968, 0.975) | 0.541 (0.523, 0.543) | 0.652 (0.601, 0.660) |
|
| 157 |
+
|
| 158 |
+
Leaf macro-AUROC barely moves in distribution → external (**0.989 → 0.971**): label ranking
|
| 159 |
+
transfers to unseen data; the residual F1 gap reflects labeling-convention drift, not a domain
|
| 160 |
+
failure. A radiologist spot-checked 966 reports of the public test labels (857 fully accepted /
|
| 161 |
+
60 imperfect-but-acceptable / 49 failed; see the [dataset card](https://huggingface.co/datasets/chest2vec/chest2vec_labels)).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
## Caveats
|
| 164 |
|