Add M1: OCR hub import, WITSML, labels T1-T3, T4 questions, trial raters, draft protocol

- OCR: match the colleague's full-set Dataset Hub export to the DDRs by content
  (3,059/3,066 pages) and QC it against the HTML (CER 2.40%, exact 0.9181).
- WITSML parser and formation tops: 21 DDR wellbores with time logs, 1,384
  reports; WITSML 15/9-F-15 S is DDR 15/9-F-15.
- Deterministic labels T1-T3 (configs/labels.yaml), 1,662 T4 questions with SQL,
  pandas and raw-XML answers in full agreement.
- Trial label validation by three blind LLM raters (not an author or expert audit)
  and rater agreement script; draft protocol_v1 (not locked): split by well.
- Literature notes and BibTeX; docs, report and run_m1.sh synchronised.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 08:34:35 +00:00
parent a3c175638f
commit 17916650a5
37 changed files with 11098 additions and 415 deletions

25
scripts/run_m1.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Run the M1 pipeline on top of P0 (scripts/run_p0.sh must have built outputs/ddr/):
# OCR hub import -> OCR QC on the hub pages -> WITSML parse -> labels T1-T3 -> T4 questions -> T4 raw-XML check
# -> trial audit sample -> unit tests.
# The hub import needs the Dataset Hub export under data/ocr_hub/ (configs/ocr_hub.yaml; download it as in README);
# without it that step and the QC on the hub pages are skipped. WITSML parsing reads about 20 GB and takes the longest.
set -euo pipefail
cd "$(dirname "$0")/.."
PY="${PY:-.venv/bin/python}"
# Unconditional: the machine default is OMP/MKL/OPENBLAS_NUM_THREADS=40, and "${VAR:-4}" would keep that 40.
export OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4
[[ -n "${RUNLOG_DIR:-}" ]] || exec "$PY" -m volve_dia.runlog -n m1 -- bash "scripts/$(basename "$0")" "$@"
step() { "$PY" -m volve_dia.runlog -- "$@"; }
if compgen -G "data/ocr_hub/*" > /dev/null; then
step "$PY" scripts/04_ocr_hub.py
step "$PY" scripts/05_ocr_qc.py --source hub
else
echo "[m1] data/ocr_hub/ is empty: OCR hub import and its QC skipped"
fi
step "$PY" scripts/06_parse_witsml.py --workers 4
step "$PY" scripts/07_labels.py
step "$PY" scripts/08_t4_questions.py
step "$PY" scripts/08_t4_xml_check.py
step "$PY" scripts/09_audit.py sample
step "$PY" -m pytest -q