WeKnora/docreader/parser
wizardchen 7b1bb1054f feat(docreader): speed up scanned-PDF parsing, stream image results, isolate heavy async queues
Large scanned PDFs (hundreds of pages) were slow and fragile end-to-end.
This change addresses the parse, transport, and task-scheduling layers:

docreader (parse + transport):
- Parallelize per-page scanned rendering across processes (forkserver/fork),
  with serial fallback. ~4-7x faster on large scanned PDFs; pdfium is not
  thread-safe so we fan out across processes. Configurable via
  DOCREADER_PDF_RENDER_PARALLELISM.
- Add server-streaming ReadStream RPC: emit one meta frame then one frame per
  image, so documents with many page images are no longer capped by the unary
  gRPC message-size limit (a 874-page PDF produced ~193MiB of images, far over
  the 50MB cap) and memory is bounded on both ends. Unary Read is kept for
  backward compatibility; the Go production reader switches to ReadStream.

VLM:
- Make the VLM HTTP timeout configurable (VLM_HTTP_TIMEOUT_SECONDS) and raise
  the default 90s -> 180s so dense scanned-page OCR does not time out with
  "context deadline exceeded".

Async task queues:
- Isolate high-volume, model-heavy fan-out tasks into dedicated asynq queues so
  a single large document cannot saturate the shared worker pool and block
  user-facing document parsing:
    image:multimodal  -> "multimodal"
    chunk:extract     -> "graph"
    question:generation -> "question"
- Register the new queues in the server weight map and the cancel inspector's
  scanned-queue set (so cancelling a knowledge still purges its pending tasks).
2026-06-03 12:29:13 +08:00
..
__init__.py feat: introduce WeKnora Lite edition with lightweight configuration and deployment 2026-03-02 21:21:49 +08:00
base_parser.py feat: introduce WeKnora Lite edition with lightweight configuration and deployment 2026-03-02 21:21:49 +08:00
chain_parser.py feat(metadata): enhance document processing to include metadata extraction and handling 2026-04-01 15:49:47 +08:00
concurrency.py fix(docreader): throttle heavy parser concurrency 2026-05-07 17:36:09 +08:00
doc_parser.py fix(doc_parser): enhance DOC to DOCX conversion reliability 2026-06-01 20:50:02 +08:00
docx2_parser.py feat: 新增文档模型类,调整配置与解析逻辑,优化日志及导入 2025-11-18 22:37:01 +08:00
docx_parser.py fix(docreader): remove default 100-page limit for DOCX parsing 2026-04-28 21:50:15 +08:00
excel_parser.py style: add necessary comments to improve code quality 2025-12-01 17:43:26 +08:00
image_parser.py feat: introduce WeKnora Lite edition with lightweight configuration and deployment 2026-03-02 21:21:49 +08:00
liteparse_parser.py feat(docreader): speed up scanned-PDF parsing, stream image results, isolate heavy async queues 2026-06-03 12:29:13 +08:00
markdown_parser.py feat(docparser): enhance image resolution capabilities in markdown and HTML 2026-03-25 22:08:29 +08:00
markitdown_parser.py fix(docreader): throttle heavy parser concurrency 2026-05-07 17:36:09 +08:00
parser.py feat: introduce WeKnora Lite edition with lightweight configuration and deployment 2026-03-02 21:21:49 +08:00
pdf_parser.py feat(docreader): speed up scanned-PDF parsing, stream image results, isolate heavy async queues 2026-06-03 12:29:13 +08:00
registry.py feat(docreader): speed up scanned-PDF parsing, stream image results, isolate heavy async queues 2026-06-03 12:29:13 +08:00
web_parser.py feat(parser): enhance web parser with improved image extension handling and XPath prioritization 2026-05-25 19:15:17 +08:00