Skip to content

Feature Request: Make "## Page" header optional in OCR output #3

Description

@yul1024

Description:
Currently, OCRProcessor.process_file automatically prepends ## Page to the output of each page. While this is helpful for human reading, it creates issues for downstream RAG (Retrieval-Augmented Generation) pipelines:

  1. Semantic Chunking Interference: Tools like MarkdownHeaderTextSplitter treat ## as a structural boundary, causing unnecessary fragmentation of continuous text.
  2. Noise in Embeddings: Frequent "Page X" strings add noise to the semantic vector representation.

Suggested Change:
Add a parameter to OCRProcessor or process_file to toggle this header:

# Current
process_file(file_path) -> always adds "## Page"

# Suggested
process_file(file_path, insert_page_headers=False)

Or allow users to customize the page separator template.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions