From cbb849e6d14b2248aedbd5b8b7a5c023dd8167ed Mon Sep 17 00:00:00 2001 From: AD2000X Date: Wed, 3 Jun 2026 13:15:31 +0100 Subject: [PATCH 1/2] chore: Phase 3 post-merge - pin notebook to main, mark phase merged - notebooks/05_phase3_funsd_relations.ipynb: BRANCH pin -> 'main' (Phase 3 merged) - PLAN.md: section 7 - Phases 0-3 complete and merged; Phase 4 is next --- PLAN.md | 36 ++++++++++------------- notebooks/05_phase3_funsd_relations.ipynb | 4 +-- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/PLAN.md b/PLAN.md index d417878..16c3bfa 100644 --- a/PLAN.md +++ b/PLAN.md @@ -542,26 +542,22 @@ Implementation details: ## 7. Next steps -**Phases 0 through 2 are complete and merged** (v1 = table-only RAG; Phase 2 = DocLayNet -layout-crop integration, merged to `main` 2026-06-03). The active branch is -**Phase 3 (FUNSD relation branch)**, `feature/phase3-funsd-relations` off `main`. - -Phase 3 V1 is implemented and scored (entirely local, CPU-only, no Colab): - -1. Annotation-only deterministic relation baseline: `src/funsd_extraction.py` (parse + dedupe - + per-answer-argmax predictor), `src/eval_funsd.py` (set-based P/R/F1), - `scripts/evaluate_funsd.py` (+ `scripts/fetch_funsd.py`), `tests/test_funsd_relations.py` - (17 synthetic tests). Full suite 236 passed. -2. Headline (held-out `test_50.qa_links`): P 0.946 / R 0.590 / **F1 0.727**; secondaries in - `DEVLOG.md` (2026-06-03) and `outputs/evaluation/phase3_funsd_relations.json`. - -Remaining: - -1. Open the Phase 3 PR. -2. Optional (train-only): tune `HeuristicParams` on `train_149` if higher recall is wanted; - never on `test_50`. FUNSD token classification (V2 / seqeval) and threshold-based multi-link - matching are future work, not V1. -3. Phase 4 (full demo + evaluation + report) is the next phase. +**Phases 0 through 3 are complete and merged** (v1 = table-only RAG; Phase 2 = DocLayNet +layout-crop integration; Phase 3 = FUNSD relation baseline, both merged to `main` +2026-06-03). **Phase 4 (full demo + evaluation + report) is the next phase.** + +Phase 3 V1 delivered (annotation-only deterministic relation baseline; see +`docs/phase3_brief.md`): `src/funsd_extraction.py` (parse + dedupe + per-answer-argmax +predictor), `src/eval_funsd.py` (set-based P/R/F1), `scripts/evaluate_funsd.py` +(+ `scripts/fetch_funsd.py`), `tests/test_funsd_relations.py` (17 synthetic tests), +`notebooks/05_phase3_funsd_relations.ipynb` (runner). Headline (held-out `test_50.qa_links`): +P 0.946 / R 0.590 / **F1 0.727**; full matrix in `DEVLOG.md` (2026-06-03) and +`outputs/evaluation/phase3_funsd_relations.json`. + +Phase 3 follow-ups (optional, deferred to future work): +- Train-only: tune `HeuristicParams` on `train_149` if higher recall is wanted; never on + `test_50`. +- FUNSD token classification (V2 / seqeval) and threshold-based multi-link matching. --- diff --git a/notebooks/05_phase3_funsd_relations.ipynb b/notebooks/05_phase3_funsd_relations.ipynb index f8a4602..1d538d3 100644 --- a/notebooks/05_phase3_funsd_relations.ipynb +++ b/notebooks/05_phase3_funsd_relations.ipynb @@ -10,7 +10,7 @@ "\n", "Phase 3 is annotation-only and CPU-only. The FUNSD JSON carries entity text, bbox, label, and GT linking pairs, so this notebook does not load image pixels and does not need a GPU. Logic lives in `src/` and `scripts/`, not in this notebook.\n", "\n", - "Before running in Colab, make sure `feature/phase3-funsd-relations` has been pushed to GitHub. After Phase 3 merges, set `BRANCH = 'main'` in the boot cell." + "Phase 3 is merged to `main`, so the boot cell pins `BRANCH = 'main'`. Repin it to a dev branch only if you resume Phase 3 work." ] }, { @@ -41,7 +41,7 @@ "import os\n", "\n", "REPO = '/content/FinDocStructRAG'\n", - "BRANCH = 'feature/phase3-funsd-relations' # change to 'main' after Phase 3 merges\n", + "BRANCH = 'main' # Phase 3 merged; tracks main\n", "\n", "if not os.path.isdir(f'{REPO}/.git'):\n", " !git clone --quiet https://github.com/AD2000X/FinDocStructRAG.git {REPO}\n", From c1ebaa0ebdeadb2be9f99bae528a58d20276810c Mon Sep 17 00:00:00 2001 From: AD2000X Date: Wed, 3 Jun 2026 13:18:04 +0100 Subject: [PATCH 2/2] docs: note Step 4 overlay is notebook-local debug, not the gate Clarify in 05_phase3_funsd_relations.ipynb that the Step 4 error/overlay helpers are notebook-local display utilities only; Phase 3 scoring stays in src/ and scripts/, and Step 4 is optional qualitative inspection (not the acceptance gate). --- notebooks/05_phase3_funsd_relations.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/05_phase3_funsd_relations.ipynb b/notebooks/05_phase3_funsd_relations.ipynb index 1d538d3..fb527ad 100644 --- a/notebooks/05_phase3_funsd_relations.ipynb +++ b/notebooks/05_phase3_funsd_relations.ipynb @@ -192,7 +192,7 @@ "source": [ "## Step 4a - Error table\n", "\n", - "Notebook-only qualitative error analysis. This reads FUNSD JSON annotations and relation predictions; it does not write artifacts and does not affect the Phase 3 acceptance gate." + "Notebook-only qualitative error analysis. This reads FUNSD JSON annotations and relation predictions; it does not write artifacts and does not affect the Phase 3 acceptance gate. Step 4 helper functions are notebook-local display utilities only; Phase 3 scoring remains in `src/` and `scripts/`." ] }, {