Til-Books-KazNEB
Kazakh (and some Russian) book texts harvested from KazNEB — the Kazakhstan National
Electronic Library (kazneb.kz) — and turned into machine-readable text via PyMuPDF
text-layer extraction or Qwen3-VL OCR of page scans. Part of the TilQazyna Kazakh
LLM corpus program.
TL;DR
- Two configs.
processed= quality-filtered, judged real books (use this for training).raw= the full harvest including previews/garbage (audit/debug only). - Each book is one row: full text + metadata + a model-assigned quality score and tier.
- Previews are filtered out. KazNEB's median item is only 4 pages — most IDs expose just a cover, table-of-contents, or a restricted preview. We keep only items with ≥10 pages and drop degenerate OCR.
How it was built
- ID discovery. KazNEB's catalogue caps deep pagination at ~10k results, so we enumerate the
whole item-ID space directly (
catalogue/view/<id>): a real item has a real<title>; placeholder IDs renderBook #<id>. The last real ID is ~1.76M. - Harvest (per ID).
catalogue/view→ a signedfull.pdftext-layer (extracted with PyMuPDF) when present; otherwise the page images frombookVieware downloaded and OCR'd with Qwen3-VL (Kazakh-aware prompt, verbatim transcription). - Quality gate (at harvest). Items with < 10 pages (cover / TOC / restricted preview) or degenerate OCR (one or two characters dominate, e.g. unreadable old Arabic/Latin scans) are dropped before OCR — saving compute and keeping the corpus clean.
- Judge. Every kept book is scored by a Qwen judge →
{score 1–5, category, lang}, plus a character-levelkk_ratio.tier = premium (score≥4 & kk_ratio≥0.5) / clean (score≥3) / raw.
Why filtering matters (measured)
A 1000-book sample, by page count:
| pages | share | what it is |
|---|---|---|
| 1–2 | 36 % | cover only / not-a-book |
| 3–9 | 29 % | preview / table-of-contents |
| 10–49 | 12 % | short books |
| 50–199 | 13 % | real books |
| 200+ | 9 % | full books |
~65 % of KazNEB IDs are previews/covers (median 4 pages). The page-count + garbage filter removes
this junk so the processed config contains real, readable books only.
Schema
processed config (use for training):
| field | type | meaning |
|---|---|---|
id |
string | KazNEB item ID |
title |
string | catalogue title (author / library suffix included) |
year |
string | year parsed from title, if any |
text |
string | full book text (digital extraction or OCR) |
text_raw |
string | pre-judge text (when a clean layer was applied) |
n_pages |
int | pages extracted/OCR'd |
route |
string | textpdf (digital text layer) or ocr (scanned) |
score |
int | judge quality 1–5 |
category |
string | judge topic label |
judge_lang / kk_ratio |
string / float | language label / Kazakh-character ratio |
tier |
string | premium / clean / raw |
source |
string | kazneb |
Usage
from datasets import load_dataset
ds = load_dataset("TilQazyna/Til-Books-KazNEB", "processed", split="train")
premium = ds.filter(lambda r: r["tier"] == "premium") # cleanest Kazakh book text
kk = ds.filter(lambda r: r["judge_lang"] == "kk")
Known limitations
- OCR noise. Scanned books carry OCR artifacts (page numbers, running headers, hyphenation
breaks
сло-\nво, occasional misreads). The judge tolerates these for genuine prose, but the text is not yet model-cleaned — a dedicated clean pass is planned. Thescorereflects readability. - Multilingual. KazNEB holds Kazakh, Russian and some foreign-language items. Use
judge_lang/kk_ratioto select Kazakh-only. - Truncated items. A few books expose only some pages on KazNEB itself; we keep what is available.
Provenance & ethics
Sourced from the public KazNEB catalogue for non-commercial Kazakh-language research. Respect the rights of the source library and original authors. Restricted/preview-only items are intentionally excluded.
- Downloads last month
- 520