/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * @file Route an already-written overlay parquet through the holdout policy. * * A parquet row has no `components` map, so each component is read back from `raw` over the `span_starts` / * `span_ends` / `span_tags` triple that `alignRow` wrote. */ import { type PathBuilderLike } from "path-ts"; import type { CanonicalRow } from "#types"; import { type CountryHoldout, type SplitName } from "#utils/split"; /** * The fields {@linkcode holdoutComponents} reads, with the span triple optional * so the absent-triple refusal is reachable from a test rather than only from a corrupt file. */ export interface SpannedRow { raw: string; source_id: string; span_starts?: readonly number[]; span_ends?: readonly number[]; span_tags?: readonly string[]; } /** * Read the components a holdout decision needs back out of one labeled row. * * Raises on an absent or non-parallel span triple, because treating an unreadable row * as one with no held-out component would put it in the train split. */ export declare function holdoutComponents(row: SpannedRow, index: number, input: string): CanonicalRow["components"]; export interface SplitSliceOptions { /** * The parquet to route. * Its rows are read once and held per split in memory. */ input: PathBuilderLike; /** * Where the per-split parquets are written. * Each filename combines the input and its split. */ outputDir: PathBuilderLike; /** * Defaults to `defaultHoldouts()`, which is the policy the base build applies. */ holdouts?: Record; } export interface SplitSliceResult { input: string; rows: number; counts: Record; /** * The file written per split. * * A split with zero rows has no output file. * An empty parquet would suggest that the writer lost its rows. */ outputs: Partial>; } /** * Split one overlay parquet into up to three, by the same policy the base build applies. * * Each output filename combines the input name and split name. * The function leaves the input file in place. */ export declare function splitOverlaySlice(options: SplitSliceOptions): Promise; //# sourceMappingURL=split-slice.d.ts.map