Skip to content
Duoduo Mediaevidence to decision

Package 04 · Section 5.1

Document Ingestion Parsing and Normalization

Convert heterogeneous source files into reliable, authorized and versioned knowledge objects.

Track
B · Knowledge and retrieval engineering
Level
Practitioner
Version
v1.0
Status
In validation · catalog only
Explanation depthDepth

Learning objectives

  • Design an ingestion pipeline for PDF, HTML, office documents, tables and structured feeds.
  • Preserve document hierarchy, tables, units, dates and source identity.
  • Detect duplicates, parsing failure and unsafe content.

In brief

Retrieval can only find what ingestion preserved. Parsing errors, lost tables, missing effective dates and unremoved duplicates become retrieval failures later. This package treats ingestion as an engineering stage with its own tests.

Core concepts

04.1Parsing and layout

PDFs, slides and scans encode layout, not meaning. A parser must recover reading order, headings, lists and tables. Tables flattened to text lose the relationship between row and column headers.

Use layout-aware parsers for complex documents and record the parser and version in each chunk so failures can be traced.

04.2Normalization and metadata

Normalize encodings, whitespace, units and dates. Extract metadata that retrieval and access control depend on: document type, region, owner, effective date, superseded-by and classification.

Metadata is often more important than text. A superseded policy with perfect text is still the wrong answer.

04.3Deduplication and authorization

Exact and near-duplicate documents dominate retrieval results and inflate apparent support. Detect them with hashing and similarity, keep the authoritative copy and link the others.

Access labels must be attached at ingestion and carried through every downstream stage. Retrieval cannot enforce permissions it never received.

Worked example

Tracing a wrong leave-policy answer to ingestion

Situation: The assistant cites a 2022 leave policy instead of the 2025 revision.

  1. 1Inspect the retrieved chunk metadata: effective_date is null.
  2. 2Inspect the source: the date appears in a footer, which the parser discarded.
  3. 3Add footer extraction and a date pattern for the policy template.
  4. 4Re-ingest and populate superseded_by for the 2022 file.
  5. 5Add an ingestion test: every policy document must have an effective date.

Outcome: The 2022 file is filtered at retrieval time, and the regression test prevents the gap from reappearing.

Decision rules

  • Every chunk must carry source ID, version, parser version and access label.
  • Reject documents that fail required-metadata tests rather than indexing them silently.
  • Keep one authoritative copy per duplicate cluster.
  • Preserve table structure explicitly; never rely on flattened text for numeric lookups.

Common pitfalls

  • Measuring ingestion by document count rather than field completeness.
  • Dropping headers and footers, where versions and dates often live.
  • Applying access control only at the user interface.

Key vocabulary

Near-duplicate
A document whose content is highly similar but not byte-identical to another.
Effective date
The date from which a document governs behavior.
Superseded-by
A link from an outdated document to the one that replaces it.
Access label
Classification metadata used to filter content by user entitlements.

Tutorial outline

  1. 04.1Connectors and change capture; OCR; layout-aware parsing; normalization and schema mapping.
  2. 04.2Canonical identifiers, checksums, revisions, effective dates and deletion.
  3. 04.3Quality gates, malware scanning, content classification and dead-letter queues.

Required artifacts

Ingestion manifest, parsed objects, quality report and rejected-item queue.

Evaluation evidence

Parse coverage, structural accuracy, duplicate precision, freshness lag and authorization completeness.