Datasets:
Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
Tags:
acupuncture
traditional-chinese-medicine
multi-label-classification
conformal-prediction
knowledge-graph
health
License:
File size: 5,631 Bytes
2803982 | 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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | # AcuBench → Hugging Face: upload runbook
This runbook is for **you** (the author) to run with **your own** HF token.
The packaging step did **not** log in, create accounts, enter tokens, or upload
anything. Everything below is copy-pasteable; replace `<username>` with your HF
username (and adjust repo names if you like).
Two staging trees are ready:
- `acubench/hf/` → the HF **dataset** repo (build-script pattern; no
AcuKG-derived labels shipped).
- `acubench/hf_space/` → the HF **Space** (Gradio leaderboard).
---
## 0. One-time setup
```bash
pip install -U "huggingface_hub[cli]"
huggingface-cli login # paste your token (needs write scope)
huggingface-cli whoami # confirm you are logged in
```
---
## 1. Create + upload the dataset repo
```bash
# Create the dataset repo (idempotent: --exist-ok won't fail if it exists).
huggingface-cli repo create acubench --repo-type dataset --exist-ok
# Upload the ENTIRE staging folder as the repo root.
huggingface-cli upload <username>/acubench \
/Users/yutaewan/test/fromhope1/merdian/acubench/hf \
. \
--repo-type dataset \
--commit-message "Add AcuBench (build-script pattern: skeleton + build/eval scripts, no AcuKG labels)"
```
**Guardrail double-check before/after upload** — the dataset repo must contain
ONLY these files. It must NOT contain `acubench.jsonl` or any raw AcuKG data:
```bash
ls /Users/yutaewan/test/fromhope1/merdian/acubench/hf
# expected: README.md NOTICE LICENSE UPLOAD.md
# build_acubench.py eval.py
# who_acupoints.csv meridian_adjacency.csv sample_labels.jsonl
```
Then view it at `https://huggingface.co/datasets/<username>/acubench`.
---
## 2. Create + upload the Space (Gradio leaderboard)
```bash
# Create a Gradio Space.
huggingface-cli repo create acubench-leaderboard --repo-type space --space_sdk gradio --exist-ok
# Upload the Space staging folder.
huggingface-cli upload <username>/acubench-leaderboard \
/Users/yutaewan/test/fromhope1/merdian/acubench/hf_space \
. \
--repo-type space \
--commit-message "Add AcuBench leaderboard (operator-held gold)"
```
The Space builds automatically and serves the leaderboard (seeded with the
paper's reference baselines). View it at
`https://huggingface.co/spaces/<username>/acubench-leaderboard`.
---
## 3. Private gold handling (operator-held gold)
The private **test** gold is **never** uploaded to the public Space or dataset
repo. You build it locally and keep it on your machine:
```bash
# You need your own AcuKG clone (its labels are not redistributed):
git clone https://github.com/<acukg-owner>/AcuKG.git /path/to/acukg
# Build the labels + splits locally (byte-reproduces the canonical dataset):
cd /Users/yutaewan/test/fromhope1/merdian/acubench/hf
python3 build_acubench.py --acukg /path/to/acukg --out ~/acubench_gold
# -> ~/acubench_gold/acubench.jsonl (keep this PRIVATE; it holds the test labels)
```
If you ever want automated scoring *inside* the Space (optional, not required by
the operator-held-gold flow), add the gold as a **private Space secret/file**
rather than committing it:
- **As a file** (private): `huggingface-cli upload <username>/acubench-leaderboard
~/acubench_gold/acubench.jsonl gold/acubench.jsonl --repo-type space` — but
only if the Space is **private**; do NOT do this on a public Space.
- **As a secret**: Space → Settings → *Variables and secrets* → add a secret
(e.g. `ACUBENCH_GOLD_PATH` or the gold contents) and read it via
`os.environ` in `app.py`. Recommended only if you make the Space private.
The default, safe design keeps the Space public and the gold entirely on your
machine (see next section).
---
## 4. Operator scoring + appending leaderboard rows
When a participant sends you a predictions JSONL (they do **not** have the
gold), score it locally and commit the resulting row:
```bash
cd /Users/yutaewan/test/fromhope1/merdian/acubench/hf_space
# Score against your private, locally-built test gold:
python3 score_submission.py \
--pred /path/to/participant_preds.jsonl \
--gold ~/acubench_gold/acubench.jsonl \
--who ../hf/who_acupoints.csv \
--eval ../hf/eval.py \
--split test \
--model "Participant Model v1" \
--submitter "Participant Name" \
--out submissions/010_participant_model.json
# Push just the new row to the Space:
huggingface-cli upload <username>/acubench-leaderboard \
submissions/010_participant_model.json \
submissions/010_participant_model.json \
--repo-type space \
--commit-message "Leaderboard: add Participant Model v1"
```
The Space picks up the new `submissions/*.json` on reload. No gold labels ever
leave your machine.
---
## 5. TODO / decisions for you
- [ ] **Confirm the license.** The packaging step defaulted to **CC BY 4.0**
for the data/knowledge artifacts (WHO skeleton, adjacency, sample) and
**MIT** for the code (`build_acubench.py`, `eval.py`). See `LICENSE`.
If you prefer a single license, edit `LICENSE` and the `license:` field in
`README.md`'s YAML frontmatter accordingly.
- [ ] **Fill in the AcuKG URL** in `README.md`, `NOTICE`, and the build/upload
commands above (`<acukg-owner>`), and add the AcuKG citation.
- [ ] **Confirm the citation** block in `README.md` (author list, venue/year).
- [ ] Consider **contacting AcuKG's authors** for an explicit LICENSE or
redistribution permission (recommended, not blocking).
- [ ] Decide whether the Space stays **public** (default, operator-held gold) or
goes **private** to enable in-Space automated scoring (§3).
|