Repository for Case2Flow (EMNLP2026 Main)
1
stars
1
commits
Python
primary language
Aug 28, 2026
updated

Guideline source websites:
Before dataset generation, place the guideline PDFs in the following layout:
data/
└── guidelines/
├── cdc/*.pdf
├── esmo/*.pdf
├── onkopedia/*.pdf
└── who/*.pdf
After running all dataset-generation stages, data/ has the following structure. Here, <platform> is one of cdc, esmo, onkopedia, or who.
data/
├── guidelines/ # input PDFs
│ ├── cdc/*.pdf
│ ├── esmo/*.pdf
│ ├── onkopedia/*.pdf
│ └── who/*.pdf
├── flowcharts/ # detection and verification outputs
│ ├── <platform>/
│ │ ├── flowchart_images/
│ │ ├── <platform>_flowcharts.json
│ │ ├── <platform>_flowcharts_filtered.json
│ │ └── <platform>_stats.json
│ └── session_detection_stats.json
├── converted_flowcharts/ # digitised flowchart graphs
│ ├── <platform>/
│ │ ├── <platform>_converted_flowcharts.json
│ │ └── <platform>_conversion_stats.json
│ └── conversion_stats.json
├── extracted_paths/ # decision paths from graphs
│ └── <platform>/
│ ├── <platform>_extracted_paths.json
│ └── <platform>_extracted_paths_stats.json
└── generated_cases/ # synthetic case--flowchart pairs
├── <platform>_generated_cases.json
├── <platform>_generation_stats.json
├── <platform>_rewritten_cases.json
└── <platform>_rewrite_stats.json
conda create -n case2flow python=3.12 -y
conda activate case2flow
pip install torch==2.7.0 torchvision==0.22.0 \
--index-url https://download.pytorch.org/whl/cu126
pip install -r requirements.txt
Run every construction stage after placing authorised PDFs in the layout above:
bash scripts/build_dataset.sh
Or run a contiguous subset once its prerequisites exist:
bash scripts/build_dataset.sh detect filter
bash scripts/build_dataset.sh convert extract generate rewrite
| Stage | Input | Output | Runtime requirement |
|---|---|---|---|
detect | <platform>/*.pdf | candidate pages and detection JSON | Docling |
filter | detection JSON and PDFs | verified detection JSON | Qwen3-VL-30B-A3B |
convert | verified pages and PDFs | typed flowchart graphs | Gemini API |
extract | graph JSON | decision paths | — |
generate | paths | *_generated_cases.json | OpenAI API |
rewrite | generated cases and paths | *_rewritten_cases.json | OpenAI API |
Evaluation expects flowchart images in data/flowcharts/<platform>/flowchart_images/ and cases in data/generated_cases/. Original-query evaluation reads *_generated_cases.json; rewritten-query evaluation reads *_rewritten_cases.json.
bash scripts/run_evaluation.sh --baseline colqwen3_crisp --platforms mixed
bash scripts/run_evaluation.sh --baseline graph_hybrid --platforms mixed \
--baseline-args '{"graphs_dir":"data/converted_flowcharts"}'
| Family | Baselines |
|---|---|
| Visual | clip, colpali, colpali_crisp, colqwen3, colqwen3_crisp, qwen3vl_emb |
| Text | ocr_bm25, ocr_dense, ocr_hybrid, vlm_caption_bm25 |
| Graph text | graph_dense, graph_hybrid |
| Two-stage | ocr_hybrid_bge_reranker, colqwen3_qwen3vl_reranker, ocr_hybrid_colqwen3_fusion |
The code is released under the MIT License. External documents, generated datasets, model weights, and services retain their respective terms.
@misc{wei2026case2flowbridgingpatientcases,
title = {Case2Flow: Bridging Patient Cases and Guideline Flowcharts through Multimodal Retrieval},
author = {Jiale Wei and Yufan Chen and Alexander Jaus and Zdravko Marinov and Julian Friedrich and Simon Reiß and Jens Kleesiek and Rainer Stiefelhagen},
year = {2026},
eprint = {2608.26414},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2608.26414}
}
1 commits
Python
96.9%
Shell
3.1%
Repository for Case2Flow (EMNLP2026 Main)
1
stars
1
commits
Python
primary language
Aug 28, 2026
updated

Guideline source websites:
Before dataset generation, place the guideline PDFs in the following layout:
data/
└── guidelines/
├── cdc/*.pdf
├── esmo/*.pdf
├── onkopedia/*.pdf
└── who/*.pdf
After running all dataset-generation stages, data/ has the following structure. Here, <platform> is one of cdc, esmo, onkopedia, or who.
data/
├── guidelines/ # input PDFs
│ ├── cdc/*.pdf
│ ├── esmo/*.pdf
│ ├── onkopedia/*.pdf
│ └── who/*.pdf
├── flowcharts/ # detection and verification outputs
│ ├── <platform>/
│ │ ├── flowchart_images/
│ │ ├── <platform>_flowcharts.json
│ │ ├── <platform>_flowcharts_filtered.json
│ │ └── <platform>_stats.json
│ └── session_detection_stats.json
├── converted_flowcharts/ # digitised flowchart graphs
│ ├── <platform>/
│ │ ├── <platform>_converted_flowcharts.json
│ │ └── <platform>_conversion_stats.json
│ └── conversion_stats.json
├── extracted_paths/ # decision paths from graphs
│ └── <platform>/
│ ├── <platform>_extracted_paths.json
│ └── <platform>_extracted_paths_stats.json
└── generated_cases/ # synthetic case--flowchart pairs
├── <platform>_generated_cases.json
├── <platform>_generation_stats.json
├── <platform>_rewritten_cases.json
└── <platform>_rewrite_stats.json
conda create -n case2flow python=3.12 -y
conda activate case2flow
pip install torch==2.7.0 torchvision==0.22.0 \
--index-url https://download.pytorch.org/whl/cu126
pip install -r requirements.txt
Run every construction stage after placing authorised PDFs in the layout above:
bash scripts/build_dataset.sh
Or run a contiguous subset once its prerequisites exist:
bash scripts/build_dataset.sh detect filter
bash scripts/build_dataset.sh convert extract generate rewrite
| Stage | Input | Output | Runtime requirement |
|---|---|---|---|
detect | <platform>/*.pdf | candidate pages and detection JSON | Docling |
filter | detection JSON and PDFs | verified detection JSON | Qwen3-VL-30B-A3B |
convert | verified pages and PDFs | typed flowchart graphs | Gemini API |
extract | graph JSON | decision paths | — |
generate | paths | *_generated_cases.json | OpenAI API |
rewrite | generated cases and paths | *_rewritten_cases.json | OpenAI API |
Evaluation expects flowchart images in data/flowcharts/<platform>/flowchart_images/ and cases in data/generated_cases/. Original-query evaluation reads *_generated_cases.json; rewritten-query evaluation reads *_rewritten_cases.json.
bash scripts/run_evaluation.sh --baseline colqwen3_crisp --platforms mixed
bash scripts/run_evaluation.sh --baseline graph_hybrid --platforms mixed \
--baseline-args '{"graphs_dir":"data/converted_flowcharts"}'
| Family | Baselines |
|---|---|
| Visual | clip, colpali, colpali_crisp, colqwen3, colqwen3_crisp, qwen3vl_emb |
| Text | ocr_bm25, ocr_dense, ocr_hybrid, vlm_caption_bm25 |
| Graph text | graph_dense, graph_hybrid |
| Two-stage | ocr_hybrid_bge_reranker, colqwen3_qwen3vl_reranker, ocr_hybrid_colqwen3_fusion |
The code is released under the MIT License. External documents, generated datasets, model weights, and services retain their respective terms.
@misc{wei2026case2flowbridgingpatientcases,
title = {Case2Flow: Bridging Patient Cases and Guideline Flowcharts through Multimodal Retrieval},
author = {Jiale Wei and Yufan Chen and Alexander Jaus and Zdravko Marinov and Julian Friedrich and Simon Reiß and Jens Kleesiek and Rainer Stiefelhagen},
year = {2026},
eprint = {2608.26414},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2608.26414}
}
1 commits
Python
96.9%
Shell
3.1%