Skip to main content

Overview

Every uploaded document goes through the same pipeline. Understanding the steps helps you interpret results and troubleshoot low-quality outputs.

Step 1 — Text extraction

FlexOrch reads raw text from the document:
  • PDF (text-based): Direct text extraction
  • PDF (scanned / image-heavy): OCR is applied automatically when the text layer is insufficient
  • DOCX / PPTX / TXT / HTML: Direct parse — table content is included for DOCX and PPTX, not just paragraph text
  • XLSX: Cell values extracted row by row
  • EML / MSG: Body + headers, with HTML stripped
  • XML e-invoices: Structured fields parsed natively (FatturaPA, UBL/Peppol, GİB, XRechnung, ZUGFeRD)
  • Images (JPG, PNG, TIFF): OCR always applied
The ocr_confidence score (0–1) is recorded when OCR runs. Values below 0.7 cap the quality grade at C. Before OCR runs, scanned pages are automatically deskewed: a coarse 90°/180°/270° orientation check corrects sideways or upside-down scans, then a fine-angle check straightens small tilts (a few degrees) from the scanner or camera. This runs on every scanned page — you don’t need to pre-process anything. FlexOrch also verifies file content against the declared extension before extraction starts, so a mislabeled file (wrong or renamed extension) is routed to the correct parser automatically instead of failing or being misread.

Step 2 — Document classification

FlexOrch identifies the document type using keyword-based classification: The classification_method field in results indicates whether classification was deterministic (rule-based) or required LLM assistance.

Step 3 — Field extraction

Structured fields are extracted based on the document type. FlexOrch uses deterministic pattern matching as the primary method, with LLM fallback for fields that can’t be captured by patterns. Example fields for an invoice: The extraction_method_per_field summary in results shows which fields were filled deterministically vs. by LLM.

Step 4 — PII detection

FlexOrch scans the full document text for personal and sensitive data. Detected items are:
  • Counted (pii_findings_count)
  • Categorized by type (pii_type_summary)
  • Optionally masked in the output (privacy_applied)
If PII is found, the masked_text version is used for dataset export by default. See PII Detection & Privacy for the full type catalog.

Step 5 — Quality scoring

A quality score (0–100) and grade (A–D) are computed based on:
  • Field fill rate (how many expected fields were extracted)
  • Noise ratio (proportion of meaningless content)
  • OCR confidence (for scanned documents)

Step 6 — Delivery

Results are written to the pipeline execution record, accessible via the job response:

Reprocessing

Documents can be reprocessed at any time (e.g., after a pipeline improvement):
This creates a new job and execution. Previous results are preserved.