DaletGuard supports civilians affected by armed conflict through Families Beyond War. All sides, no political affiliation. About our humanitarian work

Document Classification Splitting for Mixed Packs

A long PDF rarely holds one document, since a loan file may carry a statement, a return and a lease. DaletParse handles this with document classification splitting as a step that finds each boundary and gives every part a type. The type then chooses the extractor, so document boundary detection decides which reader sees each single page of the pack. Document classification splitting runs in a fixed order, from the first page check to the final label for each part. Page references stay attached to every part, so a reviewer can jump straight from any value to its source page.

In addition, coded rules decide each boundary, merge annex pages and keep bundled files whole. Notably, it also shows which markings cause a rejection. Good document classification splitting saves time later in the pipeline, and document classification splitting is the first gate.

Illustration of calendar, clock, ticket for document classification splitting
Key takeaway

DaletParse cleans pages, finds document boundaries from printed pagination and text patterns, then types each part in two passes. A type outside the registry is labeled unclassified, and specimen, void and copy markings become rejections.

Why do mixed packs need a step to split them up?

First, an extractor reads one page at a time and has no idea which document that page belongs to. Also, it cannot tell that page 3 of a statement follows page 2. A reader needs structure before it needs fields.

Notably, mixed packs create four common failures.

  • Merged records: Two statements are read as one account, so balances from different months mix.
  • Lost schedules: A tax schedule is read as an unknown document and never reaches its return.
  • Double scans: The same page appears twice and doubles a total.
  • Wrong reader: A lease runs through a paystub prompt, and the fields come back empty.

Indeed, document classification splitting removes these failures before any field is read. It is the stage where a messy upload becomes a list of separate, typed documents. As a result, the reviewer benefits twice. Extractors get clean input, and page ranges show exactly which pages form each document.

Moreover, a wrong split in document classification splitting is easy to see, so it is easy to question.

A diagram of 3 connected steps, each with a small drawing: Bundled document types, Annex page merging.

How does the splitter get from a page to a type?

DaletParse runs four jobs in order inside document classification splitting. It prepares the pages, runs document boundary detection, types each part and runs annex page merging. In fact, most of the preparation and scoring is handled by Python code. Models then describe the pages and choose a type from that description.

The output of document classification splitting is a list of sub-documents. Specifically, each one has a page range, a registry type, a confidence and a suggested file name. Likewise, documents that carry a rejection marking point to a written rejection.

For example, the typed result feeds the overall pipeline, where the type picks the route. The specialist extractor page covers what happens next.

Diagram of one mixed file split at boundaries, typed and routed to an extractor
Splitting finds where documents start, and the type picks the extractor.

What does the splitter do with each page in order?

The work of document classification splitting starts with page cleanup. It then moves to boundaries and two passes of typing.

How do we sort page types and clean each page up?

First, each page is called native, scanned or photo. A native page has a text layer with at least 20 words, and pdfplumber reads it directly. In contrast, a scanned page has fewer words and goes through OCR.

Besides, a scanned page whose quality check finds shadows or a watermark is treated as a photo. Therefore, photo pages get a cleaning step before they are read. Native pages are rendered at 72 DPI, scans at 210 DPI and photos at 300 DPI.

How are double scans and the page order put right?

Duplicate-page removal handles double scans. For example, it compares the first 300 characters of OCR text on consecutive non-native pages. Then, when similarity reaches 0.95, the repeat is removed and the pages are renumbered.

Page order detection runs only for scanned PDFs, ahead of document boundary detection. First, a vision pass reads printed page numbers and dates, and Python reassembles the sequence. Also, when those hints are not enough, a language model fallback proposes the order.

So how do we find where each new document begins?

Document boundary detection reads printed pagination from four crop zones on every page. In addition, it looks for text patterns, such as a statement period, a beginning balance or an account summary. Each page is then scored against a threshold of 50.

Overall, when text confidence falls below 0.7, a vision call takes over. Boundaries that are only predicted or inferred are marked doubtful. Therefore, they get a second check, described in the next section.

How does the two-pass check give each part a type?

First, the pass is visual. A vision model describes up to five pages of a sub-document. It notes the title, the institution, identifiers, the layout and any stamps, seals or VOID marks.

Second, the pass uses text only. A model reads that description and picks one registry type or the label "unclassified". The result holds the type, a confidence, the bank name, the primary entity and a suggested file name.

Finally, document classification splitting classifies the first document alone, and the rest run concurrently.

Illustration for Document Classification Splitting for Mixed Packs

How do we keep a tax schedule with its own return?

Specifically, fourteen types count as annexes. They include tax schedules A, B, C, D, E, F, 2, 3, SE and 8812. Exhibits, addenda, supplements and attachments count too.

Annex page merging means each annex page is joined to the previous document that is not an annex. Notably, annex page merging means annexes skip extraction on their own. The parent keeps them in its page range, so a schedule stays attached to its return.

However, a schedule that opens a file has no earlier parent. Test that case in an implementation, because it is the main test for annex page merging.

What happens when a document boundary looks a bit doubtful?

In document boundary detection, a boundary based on a prediction is weaker than one based on printed pagination. Therefore, DaletParse does not accept it blindly. Instead, it sends up to 15 surrounding pages to a vision call.

The call asks whether both sides belong to the same document. Also, the answer carries a confidence. A same-document verdict at 0.7 or higher merges the two parts. A lower confidence keeps the boundary as it stands.

Moreover, document classification splitting favors a split when evidence is thin. A reviewer would rather see two short documents than one merged record, which document boundary detection avoids on purpose. Besides, merged records are harder to repair, and a false split is easy to spot in the page ranges.

Why do some files stay whole on purpose in the split?

In fact, some documents contain internal sections that look like new documents. A tax return has forms and schedules, and a lease has an exhibit list. Bundled document types exist because splitting at every title page would damage the record.

For nine bundled document types, the pipeline keeps the entire file as one document. This happens when page 1 classifies as that type.

The nine are tax returns, property appraisal reports, lease agreements, credit reports and criminal reports. The rest are stakeholder agreements, employment contracts, payroll reports and brokerage statements.

However, the rule has a cost. For instance, imagine a pack with a lease followed by an unrelated passport scan. The lease type on page 1 keeps the whole file together.

Therefore, upload such packs as separate files, or check the result in an implementation first. Bundled document types are a deliberate trade, and the page ranges show where it applies.

DaletParse split and classify screen

What do markings and the unclassified label change for you?

Document classification splitting goes beyond naming a type. It also reads markings that change the outcome of a document. A specimen or draft marking produces REJ-SPEC-001.

A void or cancelled marking produces REJ-SPEC-002, and a copy or duplicate marking produces REJ-SPEC-003. Indeed, each of these documents is written as a rejection and is not extracted. An original document is requested by the rejection.

The validation page explains how that request travels in the envelope.

Indeed, a type string that is not in the registry map becomes "unclassified" with a confidence of zero. The label is honest, because it avoids a guessed type. However, it does not necessarily lead to a rejection. Code sends unknown types down the default route, which re-runs classification and switches only for a simple type.

What does the splitting step hand back to you at the end?

Each sub-document leaves document classification splitting with a short record you can read before any field is extracted. Early information can show the type, the bank and the primary entity while later work continues. It also tells you whether bundled document types kept a file whole.

  • The registry type, from 80 registered keys, or the label unclassified.
  • A confidence value for that type.
  • The bank name and primary entity, when the pages show them.
  • A suggested file name for the original PDF part.
  • The page range from document boundary detection, kept for every later finding.

The registry labels in document classification splitting are French strings in code, while prompts default to English. Therefore, expect to map labels in your own reports if you need English text. Besides, many type names are US-centric, such as the paystub and W-2 types.

Which parts of the split step should you check first?

A canonical test suite of 259 cases, all passing, guards document classification splitting on every release. Instead, its results depend on scan quality, bank layouts and how clear the printed pagination is. For example, page order detection helps only on scanned PDFs.

Two limits matter most for planning. First, the nine bundled document types keep a file whole. Second, unknown types do not reject themselves. Run a reference pack that includes such cases before you plan a workflow around document classification splitting.

In addition, a good implementation set includes a clean native PDF and a bad scan. Next, add a double scan and a pack with a missing page. Compare the page ranges with what a person would draw.

The PDF splitting steps article gives a practical checklist for that review.

Classification and splitting: Markings, Splitting step hand and Parts

How do you read the page ranges and the confidence values?

The page ranges are the first thing to check. First, open a result and compare each range with the pages you expect. Check annex page merging by finding each schedule inside the range of its return. In fact, a range that starts one page late often points to a missing cover page or a weak mark.

Next, read the confidence that document classification splitting gives each type. A low value is a prompt to look at the first page of that part. Use it to sort your review queue, so the least certain parts reach a person first.

Early information gives you the same view before extraction ends. Moreover, it lists page types, missing pages and cropped pages beside the type and the holder. Those fields tell you quickly whether the splitter saw the pack the way a person would.

Where can the split step go wrong in a real pack?

Every splitter has failure modes, and this one is no exception. Overall, knowing them helps you set up the right checks for bundled document types and annexes in an implementation.

  • Weak pagination: A document without printed page numbers makes document boundary detection rely on text patterns, which are less certain.
  • Predicted boundaries: A boundary inferred from context is marked doubtful and rechecked, and the recheck can still be wrong.
  • Bundled document types: A file that starts as a lease stays whole, even if later pages belong elsewhere.
  • Orphan schedules: A schedule at the top of a file has no parent, so annex page merging cannot attach it.
  • Unknown layouts: A page that matches no known pattern falls back to a vision call.

Overall, document classification splitting marks doubtful boundaries instead of hiding them. Treat each one as a place to look first when you review a pack through document classification splitting.

Which pack would you like to run through the splitter?

Pick the pack your team dreads, the one with scans out of order and schedules mixed into other files. Run it through DaletParse and compare the document classification splitting result with your own reading of the pack. Note which boundaries needed a second look and which types surprised you.

Book a meeting, and bring files that stress the splitter.

Questions and answers on this topic from the product team

How does DaletParse find where a document starts?

It reads printed pagination such as "Page 1 of 4" from four crop zones on each page. It also scores text patterns, for example a statement period or a beginning balance. Each page gets a score against a threshold of 50.

What happens to a document that fits no type?

The classifier labels it unclassified with a confidence of zero, instead of forcing a guessed type. Do not read that as an automatic rejection. The code sends unknown types down the default route.

Are annex pages extracted on their own?

No. Pages typed as annexes, such as tax schedules, exhibits, addenda. Also, attachments, merge into the previous document that is not an annex.

Why are some files never split?

Nine types are kept as one document when page 1 classifies as one of them. They include tax returns, property appraisal reports, lease agreements, credit reports, criminal reports, stakeholder agreements, employment contracts, payroll reports and brokerage statements. These files contain many internal sections that look like new documents, so splitting them would break the record apart.

Can the classifier reject a file?

Yes, in three cases. A specimen or draft marking produces REJ-SPEC-001. A void or cancelled marking produces REJ-SPEC-002.

Does classification report a confidence score?

Yes. The result holds the document type, a confidence, the bank name when one exists, the primary entity and a suggested file name.

See how DaletParse fits the providers your team uses today

Book a short meeting for a walkthrough with your own providers in mind, or join an in-person class to learn the method first.