import { type PathBuilderLike } from "path-ts"; import { type CJKSplitReport, type CoverageStats } from "#cjk/builder"; /** * Options for {@linkcode buildTWCorpus}, using the Python assembler's flag names. */ export interface TWCorpusOptions { parquet: PathBuilderLike; outDir: PathBuilderLike; trainRows: number; valRows: number; boardRows: number; boardBucketMin: number; rowsPerPart: number; statsSamplePerPart: number; countryFraction: number; maxFieldChars: number; maxRowGroups?: number; seed: number; force: boolean; } /** * The defaults of the Python assembler's flags. */ export declare const TW_CORPUS_DEFAULTS: { readonly trainRows: 2000000; readonly valRows: 20000; readonly boardRows: 20000; readonly boardBucketMin: 90; readonly rowsPerPart: 250000; readonly statsSamplePerPart: 50000; readonly countryFraction: 0.05; readonly maxFieldChars: 64; readonly seed: 42; }; /** * `build-report.json` serializes the TW build report in this key order. */ export interface TWCorpusReport { seed: number; parquet: string; label_set: string; source: string; license: string; /** * Rows per publishing agency, most common first. */ attribution: ReadonlyMap; eligible_rows_scanned: number; dropped_at_source: ReadonlyMap; per_region_cap: number; regions_train: number; board_bucket_min: number; board_districts: number; board_rows: number; registers: ReadonlyMap; char_vocab_size: number; centroid_units: number; fractions: { country: number; }; register_weights: ReadonlyMap; splits: ReadonlyMap; board_coverage: CoverageStats; } /** * Builds the corpus, its board, the district centroids and the character vocabulary * under `outDir`, and returns the build report. * * @throws When `outDir` holds files and `force` is unset, the parquet is missing, * the drop rate exceeds 2%, or a board district reaches train or val. */ export declare function buildTWCorpus(options: TWCorpusOptions): Promise; //# sourceMappingURL=assemble.d.ts.map