# taroandmulan/questionextractorai architecture

> Architecture diagram of the GitHub repository taroandmulan/questionextractorai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/taroandmulan/questionextractorai
- Repository: https://github.com/taroandmulan/questionextractorai

## Overview

QuestionExtractorAI is a command-line tool for locating exam-question regions in image or PDF files using computer vision, not OCR/NLP. The user supplies a file and optional layout, dilation-kernel, and crop settings; the CLI parses these, dispatches to image or PDF analysis, and writes diagnostic and annotated images to an output directory. Analysis supports multiple page layouts, including a split-column SAT mode, and uses bounding-box merging to group question content and choices. The README also describes dataset annotation and known layout challenges, but does not establish a trained model or result pipeline. Some internal PDF and output call details are in omitted source excerpts, so those links are left unverified.

Main entry points: [`extract.py`](https://github.com/taroandmulan/questionextractorai/blob/main/extract.py) (CLI Dispatcher), [`tools/helper/analyze.py`](https://github.com/taroandmulan/questionextractorai/blob/main/tools/helper/analyze.py) (Image and PDF Analysis), [`tools/helper/parser.py`](https://github.com/taroandmulan/questionextractorai/blob/main/tools/helper/parser.py) (Argument Parser), [`tools/helper/boundingBox.py`](https://github.com/taroandmulan/questionextractorai/blob/main/tools/helper/boundingBox.py) (Bounding-box Merger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI Entry"]
  node_extract["CLI Dispatcher<br/>[extract.py]"]
  node_parser["Argument Parser<br/>[parser.py]"]
end

subgraph group_vision["Image Analysis"]
  node_analysis["Image and PDF Analysis<br/>[analyze.py]"]
end

subgraph group_geometry["Box Grouping"]
  node_bbox["Bounding-box Merger<br/>[boundingBox.py]"]
end

subgraph group_artifacts["Input and Output"]
  node_exam["Exam Image or PDF"]
  node_results["Analysis Images"]
end

node_user(("Exam Processor User"))

node_user -->|"runs"| node_extract
node_exam -->|"provides file"| node_extract
node_extract -->|"parses options"| node_parser
node_extract -->|"dispatches analysis"| node_analysis
node_analysis -->|"merges boxes"| node_bbox
node_analysis -.->|"writes images"| node_results
node_exam -.->|"converts PDF pages"| node_analysis

click node_extract "https://github.com/taroandmulan/questionextractorai/blob/main/extract.py"
click node_parser "https://github.com/taroandmulan/questionextractorai/blob/main/tools/helper/parser.py"
click node_analysis "https://github.com/taroandmulan/questionextractorai/blob/main/tools/helper/analyze.py"
click node_bbox "https://github.com/taroandmulan/questionextractorai/blob/main/tools/helper/boundingBox.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extract,node_parser,node_user toneBlue
class node_analysis toneAmber
class node_bbox toneMint
class node_exam,node_results toneRose
```

## Components

### CLI Entry

- [CLI Dispatcher](https://github.com/taroandmulan/questionextractorai/blob/main/extract.py): `extract.py`
- [Argument Parser](https://github.com/taroandmulan/questionextractorai/blob/main/tools/helper/parser.py): `tools/helper/parser.py`

### Image Analysis

- [Image and PDF Analysis](https://github.com/taroandmulan/questionextractorai/blob/main/tools/helper/analyze.py): `tools/helper/analyze.py`

### Box Grouping

- [Bounding-box Merger](https://github.com/taroandmulan/questionextractorai/blob/main/tools/helper/boundingBox.py): `tools/helper/boundingBox.py`

### Input and Output

- **Exam Image or PDF**
- **Analysis Images**

### Other components

- **Exam Processor User**

## Connections

- Exam Processor User → CLI Dispatcher: runs (evidence: `README.md`)
- Exam Image or PDF → CLI Dispatcher: provides file (evidence: `README.md`)
- CLI Dispatcher → Argument Parser: parses options (evidence: `extract.py`)
- CLI Dispatcher → Image and PDF Analysis: dispatches analysis (evidence: `extract.py`)
- Image and PDF Analysis → Bounding-box Merger: merges boxes (evidence: `tools/helper/analyze.py`)
- Image and PDF Analysis → Analysis Images: writes images
- Exam Image or PDF → Image and PDF Analysis: converts PDF pages
