JialeWei/Case2Flow

Repository for Case2Flow (EMNLP2026 Main)

1

stars

1

commits

Python

primary language

Aug 28, 2026

updated

arxiv.org/pdf/2608.26414

README

Case2Flow: Bridging Patient Cases and Guideline Flowcharts through Multimodal Retrieval

Case2Flow

Updates

  • FlowAtlas dataset will be released.
  • 08/2026, Case2Flow is released.
  • 08/2026, repository initialized.

Guideline Sources and Data Layout

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

Installation

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

Dataset Generation

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
StageInputOutputRuntime requirement
detect<platform>/*.pdfcandidate pages and detection JSONDocling
filterdetection JSON and PDFsverified detection JSONQwen3-VL-30B-A3B
convertverified pages and PDFstyped flowchart graphsGemini API
extractgraph JSONdecision paths
generatepaths*_generated_cases.jsonOpenAI API
rewritegenerated cases and paths*_rewritten_cases.jsonOpenAI API

Evaluation

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"}'
FamilyBaselines
Visualclip, colpali, colpali_crisp, colqwen3, colqwen3_crisp, qwen3vl_emb
Textocr_bm25, ocr_dense, ocr_hybrid, vlm_caption_bm25
Graph textgraph_dense, graph_hybrid
Two-stageocr_hybrid_bge_reranker, colqwen3_qwen3vl_reranker, ocr_hybrid_colqwen3_fusion

License

The code is released under the MIT License. External documents, generated datasets, model weights, and services retain their respective terms.

Citation

@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}
}

Contributors

JialeWei

1 commits

JialeWei/Case2Flow

Repository for Case2Flow (EMNLP2026 Main)

1

stars

1

commits

Python

primary language

Aug 28, 2026

updated

arxiv.org/pdf/2608.26414

README

Case2Flow: Bridging Patient Cases and Guideline Flowcharts through Multimodal Retrieval

Case2Flow

Updates

  • FlowAtlas dataset will be released.
  • 08/2026, Case2Flow is released.
  • 08/2026, repository initialized.

Guideline Sources and Data Layout

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

Installation

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

Dataset Generation

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
StageInputOutputRuntime requirement
detect<platform>/*.pdfcandidate pages and detection JSONDocling
filterdetection JSON and PDFsverified detection JSONQwen3-VL-30B-A3B
convertverified pages and PDFstyped flowchart graphsGemini API
extractgraph JSONdecision paths
generatepaths*_generated_cases.jsonOpenAI API
rewritegenerated cases and paths*_rewritten_cases.jsonOpenAI API

Evaluation

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"}'
FamilyBaselines
Visualclip, colpali, colpali_crisp, colqwen3, colqwen3_crisp, qwen3vl_emb
Textocr_bm25, ocr_dense, ocr_hybrid, vlm_caption_bm25
Graph textgraph_dense, graph_hybrid
Two-stageocr_hybrid_bge_reranker, colqwen3_qwen3vl_reranker, ocr_hybrid_colqwen3_fusion

License

The code is released under the MIT License. External documents, generated datasets, model weights, and services retain their respective terms.

Citation

@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}
}

Contributors

JialeWei

1 commits

Languages

Python

96.9%

Shell

3.1%