{"id":51537576,"url":"https://github.com/databricks-solutions/advance-document-processing","last_synced_at":"2026-07-09T10:01:43.978Z","repository":{"id":368986265,"uuid":"1244784471","full_name":"databricks-solutions/advance-document-processing","owner":"databricks-solutions","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-03T03:29:37.000Z","size":374,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-03T05:25:25.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/databricks-solutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.md","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-20T15:39:16.000Z","updated_at":"2026-07-03T03:29:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/databricks-solutions/advance-document-processing","commit_stats":null,"previous_names":["databricks-solutions/advance-document-processing"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/databricks-solutions/advance-document-processing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databricks-solutions%2Fadvance-document-processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databricks-solutions%2Fadvance-document-processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databricks-solutions%2Fadvance-document-processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databricks-solutions%2Fadvance-document-processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/databricks-solutions","download_url":"https://codeload.github.com/databricks-solutions/advance-document-processing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databricks-solutions%2Fadvance-document-processing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35295106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-09T10:01:42.855Z","updated_at":"2026-07-09T10:01:43.971Z","avatar_url":"https://github.com/databricks-solutions.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced Document Processing\n\nReference implementations for advanced document-processing pipelines on\nDatabricks — combining Unity Catalog, `ai_parse_document`, task-specific AI\nFunctions (`ai_classify`, `ai_extract`), vision LLMs, Auto Loader, and\nDatabricks Asset Bundles.\n\n## Projects\n\n| Project | Description |\n|---|---|\n| [`document-embedding-chart-analysis/`](./document-embedding-chart-analysis/) | End-to-end PDF **chart-analysis** pipeline. Parses PDFs with `ai_parse_document`, classifies and crops chart figures, runs a vision LLM on each chart, and splices the resulting insights back into a per-document gold table — ready for embedding/RAG. |\n| [`document-page-classify-extraction/`](./document-page-classify-extraction/) | **Page-level classify-then-extract** pipeline. Splits a multi-document PDF packet into pages, classifies each page by document type with `ai_classify`, routes each to a type-specific `ai_extract` schema, and flattens the results into per-entity gold tables. Worked example: a residential mortgage loan file. |\n| [`ai-extract-word-level-citation/`](./ai-extract-word-level-citation/) | **Word-level citation** pipeline. Parses PDFs with `ai_parse_document`, extracts fields with `ai_extract` 2.1 citations, then crops each cited element and uses **Tesseract OCR + string-matching** to localize every entity to word-level bounding boxes. Worked example: paystubs. |\n| [`evaluation-harness/`](./evaluation-harness/) | **Evaluation recipe notebooks** (standalone, not a workflow). Three notebooks that profile `ai_parse_document` / `ai_extract` confidence distributions and score `ai_extract` against ground truth with `mlflow.genai.evaluate`. |\n\nThe three pipelines each ship in two flavors — interactive **batch notebooks** and\na **Databricks Asset Bundle** (DAB). The chart-analysis and page-classify-extraction\nbundles are **streaming** (Auto Loader + `Trigger.AvailableNow`, scheduled); the\nword-level-citation bundle is **batch** (manual trigger). `evaluation-harness/` is\nnotebooks only. Each project's own `README.md` covers its architecture, defaults,\nand quickstart.\n\n## Repo layout\n\n```\nadvance-document-processing/\n├── document-embedding-chart-analysis/   # PDF chart-analysis pipeline (notebooks + streaming DAB)\n├── document-page-classify-extraction/   # Page classify + extract pipeline (notebooks + streaming DAB)\n├── ai-extract-word-level-citation/      # Word-level citation pipeline (notebooks + batch DAB)\n├── evaluation-harness/                  # AI-function evaluation recipe notebooks\n├── scripts/                             # Cross-project helper scripts\n│   ├── upload_pdfs.sh                   # Upload local PDFs to a UC Volume via the CLI\n│   ├── generate_sample_loan_files.py    # Generate synthetic mortgage loan-file PDFs\n│   └── generate_sample_paystubs.py      # Generate synthetic paystub PDFs + ground-truth CSV\n├── pyproject.toml                       # pytest config for the bundles' unit tests (uv run pytest)\n├── .github/CODEOWNERS\n├── LICENSE.md\n├── NOTICE.md\n└── SECURITY.md\n```\n\nThe two pipelines that extracted their bundle's pure helpers into importable\nmodules (`ai-extract-word-level-citation`, `document-page-classify-extraction`)\ncarry a `tests/` folder; run the whole suite from the repo root with\n`uv run pytest` (pure Python, no Databricks required).\n\n## Prerequisites\n\n- Databricks workspace with Unity Catalog and Serverless Jobs enabled\n- DBR **17.3+** (or serverless environment version **3+**) for `ai_parse_document`;\n  serverless env **5** is recommended (used by the streaming bundles)\n- DBR **18.2+** (serverless env **3+**) for `ai_extract` 2.1 with citations +\n  confidence scores (page classify-extract and word-level-citation pipelines)\n- Databricks CLI **v0.205+** (the unified CLI) for `bundle` and `fs` commands\n- A multimodal serving endpoint for chart analysis (default\n  `databricks-claude-sonnet-4-5`) — required only by the chart-analysis project\n- Tesseract OCR (pre-installed on DBR) for the word-level-citation pipeline\n- `uv` + `pytest` for the bundles' unit tests (`uv run pytest` from the repo root;\n  no Databricks needed). A judge serving endpoint (default\n  `databricks-claude-sonnet-4-6`) for `evaluation-harness` recipe 03.\n\n## How to get help\n\nDatabricks support doesn't cover this content. For questions or bugs, please\nopen a GitHub issue and the team will help on a best-effort basis.\n\n## License\n\n\u0026copy; 2026 Databricks, Inc. All rights reserved. The source in this notebook is\nprovided subject to the Databricks License\n[https://databricks.com/db-license-source]. All included or referenced third\nparty libraries are subject to the licenses set forth below.\n\n| library | description | license | source |\n|---|---|---|---|\n| pillow | Image cropping in the chart and word-level pipelines | HPND | https://pypi.org/project/pillow/ |\n| openai | OpenAI-compatible client for the Databricks serving endpoint | Apache 2.0 | https://pypi.org/project/openai/ |\n| markdown | Render VLM markdown output in notebooks | BSD | https://pypi.org/project/markdown/ |\n| pyyaml | Cross-notebook config exchange | MIT | https://pypi.org/project/pyyaml/ |\n| reportlab | Generate synthetic loan-file and paystub sample PDFs | BSD | https://pypi.org/project/reportlab/ |\n| pytesseract | Tesseract OCR wrapper (word-level pipeline) | Apache 2.0 | https://pypi.org/project/pytesseract/ |\n| rapidfuzz | OCR/value string-matching (word-level pipeline) | MIT | https://pypi.org/project/rapidfuzz/ |\n| mlflow | GenAI evaluation in the evaluation-harness | Apache 2.0 | https://pypi.org/project/mlflow/ |\n| matplotlib | Confidence-distribution plots (evaluation-harness) | matplotlib (BSD-style) | https://pypi.org/project/matplotlib/ |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabricks-solutions%2Fadvance-document-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatabricks-solutions%2Fadvance-document-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabricks-solutions%2Fadvance-document-processing/lists"}