File size: 3,376 Bytes
16971e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Thesis data, release v4.2 (canonical)

The only data version for the thesis "Agentic Patient Similarity Retrieval". Hosted at https://huggingface.co/datasets/thanminh01/thesis-data and kept as `data/` at the repo root (gitignored). Read-only: fixes ship as a new release, never as an edit. What changed from v4.1: `CHANGES-v4.2.md`. Rules: `CONTRACT.md`.

## Contents

| Dataset | Bank (confirmed cases) | Queries | Label space |
|---|---|---|---|
| `tcga-nsclc` | 842 (LUAD 427, LUSC 415) | 201 | LUAD vs LUSC |
| `bracs` | 460 (train+val) | 87 (test) | fine: 7 classes; coarse: 3 classes |
| `ebr-coarse30` | 2,019 | 300 | 30 classes |

Vectors: TCGA 1,043, BRACS 547, EBR 2,319 slides. 675 queries in total (588 distinct slides). Exploratory results only: BRACS prompt work sees the test queries.

```
data/
  <dataset>/                 tcga-nsclc | bracs | ebr-coarse30
    runtime/catalog.sqlite   the ONLY thing the agent may open: label-blind queries, bank labels and bank documents
    runtime/manifest.json    catalog hash and size, release
    bank.sqlite              bank slides with labels and text (owner/builder use)
    scorer/                  query.sqlite, query_labels.csv: SCORER ONLY, never inside the agent
    latents/<slide>.pt       PRISM2 latents, 256x2560 bf16 (used by the morphology tool)
    manifest.json
  bracs/slides.csv           all 547 slides with split (train 395 / val 65 / test 87) and labels
  knowledge/                 knowledge base, sources, gold questions (the runtime copy lives in APS-WSI/knowledge/)
  docs/                      rubric, scorer and build reports
  CONTRACT.md  CHANGES-v4.2.md  SHA256.json
```

## Get it

```
hf auth login                      # needs read access if the repo is private
hf download thanminh01/thesis-data --repo-type dataset --local-dir <repo>/data
```

About 5 GB, mostly `latents/`. Check integrity: every file's sha256 is in `SHA256.json` (paths relative to `data/`).

## Use it

```
export APS_DATASETS_ROOT=<repo>/data      # or pass --root ../data
cd APS-WSI
python -c "from pathlib import Path; from agent import preflight; from agent.config import Config; \
  print(preflight.run(Config(datasets_root=Path('../data'), dataset='bracs', view='fine', provider='nim', model='m')))"   # [] means clean
python -m agent.run_cli --root ../data --dataset bracs --view fine --model nvidia/nemotron-3-super-120b-a12b --finish-guard --no-llava-texts
python -m agent.scorer_cli baselines --root ../data --dataset bracs --view fine     # scorer only
```

Rules that keep the benchmark honest:
- The agent reads `<dataset>/runtime/` only. `scorer/`, `latents/`, `docs/`, `bank.sqlite` and the top-level manifest are denied by `agent/runtime_paths.py`. Open catalogs read-only (`?immutable=1`) or on a copy.
- Queries carry no label and no stored text. Patient id is not used anywhere.
- WSI-LLaVA bank texts stay off (`--no-llava-texts`).
- Source-data documents (EBR `clinical_meta`, BRACS `roi_distribution`) can be re-checked against the raw sheets with `Documents/plans/2026-10-02-final-run-autofix/verify-source-documents.py ANNOTATION_CSV BRACS_XLSX`.
- Knowledge text is checked against second sources, not clinically validated.

## Archived (not here)
Older releases (v4.1, the v4 layout) are in the local `archive/old-data-versions/` and on the Thesis drive (`Thesis-datasets/releases/`).