Dedupe labels and remove Structural rows

#4
by jbarrow - opened

Removes rows from the labels config whose function_majority is Structural, and deduplicates rows.

  • Input: 3,073,770 rows
  • Exact duplicate rows: 0 (dedup was a no-op; (document_id, section_index) was already unique)
  • Removed function_majority == "Structural": 352,325 rows
  • Output: 2,721,445 rows. Schema and zstd compression are unchanged. Rows with a null function_majority (16,372) are kept.

README: updated the labels row count, and the note that sections and labels share row order (they no longer align by position, so join on (document_id, section_index)).

The sections config is unchanged.

LOCUS org

Update: also dedupes within each document by exact content match (joined from sections), keeping the first occurrence by section_index. Applied after the Structural filter.

  • After Structural filter: 2,721,445 rows
  • Removed within-document duplicate content: 14,355 rows
  • Final: 2,707,090 rows

Duplicates across different documents (~40k extra copies, mostly shared model-code text across jurisdictions) are intentionally kept. The sections config is unchanged.

LOCUS org

Update: the same filtering now applies to the sections table (the text table), so sections and labels stay aligned row-for-row.

  1. Drop rows with function_majority == "Structural": 3,073,770 β†’ 2,721,445
  2. Within each document, drop rows whose content exactly repeats an earlier section (keep lowest section_index): β†’ 2,707,090

Verified from the actual content: 0 Structural rows, 0 within-document duplicate content, all 2,360 documents still present, schema unchanged, and keys identical in order to labels. Cross-document duplicate text is kept. manifest.json is left as the original build record.

jbarrow changed pull request status to merged

Sign up or log in to comment