You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

Constitution of the Republic of Dagestan — 13 languages

Scans of the Constitution of the Republic of Dagestan in thirteen languages: eleven indigenous languages of Dagestan and the North Caucasus, plus Azerbaijani and Russian. 291 PDF pages across 13 files.

Most PDF pages are two-page book spreads, not single pages. 245 of the 291 are landscape scans of an open book, so the corpus is really 536 book pages. Anyone building an OCR pipeline needs to split them — see Per-file caveats.

The scans now ship with OCR text, aligned article by article across all thirteen languages — 105 articles, 1,364 article rows, 3,938 paragraph rows. See The aligned corpus. The text is machine-generated and unverified for the eleven scanned minority languages; treat it as noisy until a native speaker says otherwise.

Why this dataset

The same legal document appears here in thirteen languages, which makes it a document-aligned parallel corpus. Several of these languages — Agul, Rutul, Tsakhur, Tabasaran, Lak — have very little machine-readable text available anywhere, and almost no OCR ground truth. All of them use Cyrillic orthographies with extended digraphs and letters (гъ, къ, хь, Ӏ, …) that off-the-shelf OCR handles poorly.

The intended uses are OCR training and evaluation for Cyrillic-script minority languages, and — now that the text is aligned at the article level — machine translation and cross-lingual retrieval. For most of these languages this is one of the very few parallel corpora that exists.

Contents

PDF pages is what a reader sees when opening the file. Book pages is what you get after splitting the spreads, and is the number that matters for OCR: it equals 2 × spreads + singles. The singles are covers and title pages.

ISO 639-3 Language Family PDF pages Spreads Book pages Size Source
agx Agul Northeast Caucasian (Lezgic) 21 19 40 12.0 MB scan
ava Avar Northeast Caucasian (Avar–Andic) 25 24 49 13.5 MB scan
azj North Azerbaijani Turkic (Oghuz) 17 16 33 10.2 MB scan
che Chechen Northeast Caucasian (Nakh) 21 20 41 11.8 MB scan
dar Dargwa Northeast Caucasian (Dargic) 25 22 47 15.3 MB scan
kum Kumyk Turkic (Kipchak) 21 19 40 11.5 MB scan
lbe Lak Northeast Caucasian (Lak) 22 21 43 12.7 MB scan
lez Lezgian Northeast Caucasian (Lezgic) 21 21 42 34.6 MB scan
nog Nogai Turkic (Kipchak) 22 20 42 12.6 MB scan
rus Russian Indo-European (Slavic) 27 0 27 0.3 MB born-digital
rut Rutul Northeast Caucasian (Lezgic) 22 20 42 12.1 MB scan
tab Tabasaran Northeast Caucasian (Lezgic) 22 20 42 12.7 MB scan
tkr Tsakhur Northeast Caucasian (Lezgic) 25 23 48 14.3 MB scan

Total: 13 files, 291 PDF pages, 245 spreads, 536 book pages, ~177 MB.

A handful of book pages are blank — the inside covers, and the left half of each title spread, which in several copies holds a library envelope rather than print.

Structure

There are four subsets, and in three of them the split is the language:

subset splits rows one row is
pdfs train 13 a PDF: the metadata, and a URL to the scan
articles agxtkr (13) 1,364 one article of the Constitution, in one language
paragraphs agxtkr (13) 3,938 one paragraph of one article, in one language
pages agxtkr (13) 536 one book page (536, not 291)

pages columns are lang, seq (book-page order within the language), pdf_page (the PDF page it was cut from), half (L / R of a spread, or S for a portrait single), text, text_source (ocr | born_digital), ocr_engine.

pdfs carries lang, language, family, pdf_pages, spreads, book_pages, text_source, size_bytes, pdf_url. It does not embed the PDFs — it points at them. Fetch the scans themselves with hf download (below).

Note that pdf_pages was called pages in earlier revisions. It was renamed because the number was ambiguous: most PDF pages hold two book pages, so pages meant neither one thing nor the other. book_pages (2 × spreads + singles) is the count you want for OCR.

data/                  what the Hub serves — one JSONL per (language, subset)
├── pdfs.jsonl
└── {lang}/articles.jsonl  paragraphs.jsonl  pages.jsonl
pdf/
├── metadata.csv    one row per PDF: lang, language, family,
│                   pdf_pages, spreads, book_pages, text_source
├── agx.pdf  ava.pdf  azj.pdf  che.pdf  dar.pdf  kum.pdf  lbe.pdf
├── lez.pdf  nog.pdf  rus.pdf  rut.pdf  tab.pdf  tkr.pdf
└── (one PDF per language, named by ISO 639-3 code)
ocr/
├── pages.jsonl     all 536 book pages, pooled
├── txt/{lang}/     one file per book page, easy to hand-correct
├── docs/{lang}.txt the full text per language
└── aligned/
    ├── articles.jsonl     all 1,364 article rows, pooled
    └── paragraphs.jsonl   all 3,938 paragraph rows, pooled
ocr_openrouter.ipynb   scans -> text (vision model, via OpenRouter)
align.ipynb            text  -> the aligned parallel corpus (no API, no cost)
build_hub_data.py      the above -> data/
README.md

data/ is generated from ocr/ and pdf/ by build_hub_data.py; the pooled files under ocr/ are the same rows, unsplit, for anyone who would rather read the JSONL directly than go through datasets.

Loading

from datasets import load_dataset

REPO = "AlidarAsvarov/dagestan-constitution"

# one language
agx = load_dataset(REPO, "articles", split="agx")
agx[0]["article_id"]     # 1  — the canonical join key, NOT the printed number

# all thirteen at once — small, no PDFs fetched
arts = load_dataset(REPO, "articles")
arts["lez"][0]["text"]

# the scans: metadata and URLs, not the bytes
pdfs = load_dataset(REPO, "pdfs", split="train")
pdfs[0]["pdf_url"]

Everything is JSONL rather than CSV because an article's text spans several paragraphs: in CSV that is a multi-line quoted field, which is valid but breaks anything that reads the file line by line.

To fetch the raw PDFs:

hf download AlidarAsvarov/dagestan-constitution --repo-type dataset \
    --include "pdf/*" --local-dir .

or, for everything including the scans:

from huggingface_hub import snapshot_download

path = snapshot_download("AlidarAsvarov/dagestan-constitution", repo_type="dataset")

The text subsets are plain JSONL and need nothing but datasets. The PDFs are never loaded by the library, so there is no pdfplumber dependency.

The aligned corpus

The Constitution has 105 articles, and all thirteen editions contain all of them (with one exception, below). Every language marks an article heading the same way — a number next to the local word for article — which is what makes the corpus alignable at all:

Статья 5 (rus, ava, dar, kum) · Статья 5-мур (lbe) · 5-статья (lez) · 5-пу статья (agx) · 5 статья (che, rut) · 5-нши статья (nog) · Маддә 5 (azj) · 5-пи мадда (tab) · МаддаӀ 5 (tkr)

Alignment is structural, not neural, and that is not a shortcut — it is forced. LaBSE, LASER, SONAR and vecalign cover none of Agul, Rutul, Tsakhur, Tabasaran, Lak, Dargwa, Avar, Lezgian or Nogai. There is no sentence encoder for these languages, so the usual bitext-mining stack cannot run here at all. Articles are anchored on the headings; paragraphs are aligned inside each article with length-based Gale–Church, where the search space is a handful of paragraphs.

column
article_id canonical, 1–105 — the join key. Taken from the Russian.
printed_no the number as printed in that book. Not always the same thing.
chapter_id 1–10, derived from the Russian (Глава N) and joined on article_id.
text, n_paras, source_pages, text_source, ocr_engine, note

Any of the 78 language pairs is a join on article_id — the aligner only ever runs against Russian, and everything else falls out:

arts = load_dataset("AlidarAsvarov/dagestan-constitution", "articles")
lez = {r["article_id"]: r["text"] for r in arts["lez"]}
tab = {r["article_id"]: r["text"] for r in arts["tab"]}
pairs = [(lez[n], tab[n]) for n in lez.keys() & tab.keys()]

Alignment issues — the full list

Everything found while aligning, in the order it matters. Nothing here is hypothetical: each item was checked against the Russian text or, where noted, against the scan itself.

1. The printed article numbers are not a reliable key

This is the single thing to know before using the data, and it is why article_id and printed_no are two different columns.

The Avar edition is misnumbered in print. Its Статья 14 is Russian article 15, 15→16, 16→17. Russian article 14 — recognising private, state and municipal forms of property — is in the Avar book, but carries no heading at all: it sits as a bare paragraph at the end of article 13. The book then skips the number 17 outright and resynchronises at 18.

This was confirmed by rendering and reading the scan (ava.pdf, PDF page 5, left half), not inferred from statistics. Joining thirteen languages on the printed number silently pairs the wrong provisions for four articles — the failure mode that produces a corpus which looks fine and trains a subtly wrong model.

2. Dropped headings run two articles together

Where a heading is missing, its article's text flows into the previous one. The span is split back apart by paragraph alignment, so each article_id still gets its own text — but the boundary was inferred from paragraph lengths, not read off the page.

language printed actually carries what got lost
agx 17 Russian 17 + 18 heading for 18 (a chapter heading sits between them)
agx 33 Russian 33 + 34 heading misprinted — it reads 37-пу статья
agx 61 Russian 61 + 62 heading for 62
agx 75 Russian 75 + 76 heading for 76
che 76 Russian 76 + 77 heading for 77 (the oath of office)
azj 78 Russian 78 + 79 heading for 79 (decrees and orders)

All are flagged in note as heading absent; split from printed N. These are the first rows to check if something downstream looks wrong.

3. A whole article is missing

che has no Russian article 95 (judicial independence). Its printed 95 is the prosecutor's office — Russian 96. This is absence in the edition, not an OCR failure. Hence 1,364 article rows rather than 105 × 13 = 1,365, and che is the one language with 104 articles.

4. azj is a condensed translation, not a close one

One paragraph where Russian runs three, and the shortest text in the corpus (53k characters against Russian's 64k). Its paragraph-count agreement with Russian is 36%, against 60–70% for everything else. Trust it at article level; treat its paragraph rows as approximate.

5. Length outliers that are not misalignments

Several editions omit the Russian amendment annotations — Часть третья утратила силу. — Закон Республики Дагестан от 29.04.2013 N 22. Russian article 76 carries one, so kum, dar and tab look 2–3× too short there while saying exactly the same thing. Checked by hand; the provisions match. Do not "fix" these.

6. OCR and typesetting quirks the pipeline has to absorb

These are handled in align.ipynb, but they are why the raw ocr/docs/*.txt cannot be aligned directly:

  • Page breaks cut paragraphs in half, often mid-word, with the page number wedged into the gap (…варитта- / 3 / ри кьабул…). ~150 paragraphs across the corpus are stitched back together.
  • tkr writes its palochka as І (U+0406), not Ӏ (U+04C0), in some headings — so МаддаӀ and МаддаІ both occur and the anchor regex must accept both. Five Tsakhur articles hinge on it.
  • The OCR model wrapped some headings in markdown (**Статья 14.**), which hides them from a start-of-paragraph anchor. Stripping markdown cut the unanchored headings from 30 to 13.
  • Chapter headings belong to no article. Глава 2, 2-ПУ КӀИЛ, ФАСИЛ 2 sit between articles, and left in they both pollute the text and skew the content alignment. They are detected by shape (short, all-caps, no full stop) and removed.
  • Chapter 11 has no numbered articles. "ЗАКЛЮЧИТЕЛЬНЫЕ И ПЕРЕХОДНЫЕ ПОЛОЖЕНИЯ" follows article 105 and holds only unnumbered provisions, so chapter_id runs 1–10, not 1–11.
  • Russian puts Статья N in its own paragraph block; every other language inlines it. Left unnormalised, this alone makes every Russian article look one paragraph longer than its translations.

7. A bug this exposed in the OCR stage

extract_text_layer used plain page.get_text(), which re-wrapped the born-digital Russian raggedly — 41% of lines were fragments, degrading to one word per line in justified passages, and paragraph boundaries were unrecoverable. It now uses page.get_text("blocks"). This was a real defect in the shipped Russian text, not merely an alignment inconvenience, and it is fixed in ocr/pages.jsonl, ocr/txt/rus/ and ocr/docs/rus.txt.

How good is it

68% of paragraph pairs are 1:1; the rest are 2:1 (17%), 1:2 (11%), 2:2 (3%) or unmatched (1%). 96–97% of each document's characters land inside an article — the remainder is the cover, the title page and the chapter headings, which are deliberately excluded from article text.

Eight of the twelve translated editions map cleanly onto the Russian numbering with no deviation at all: dar, kum, lbe, lez, nog, rut, tab, tkr. Every defect above is confined to agx, ava, azj and che.

azj is a condensed translation, not a close one. It runs one paragraph where Russian runs three and is the shortest text in the corpus. Trust it at article level; treat its paragraph rows as approximate. Several editions also omit the Russian amendment annotations ("Часть третья утратила силу…"), which is why their articles can be much shorter than the Russian without anything being misaligned.

Per-file caveats

Several things will bite anyone building a pipeline over this, so they are stated up front rather than left to be discovered.

Most PDF pages are two-page spreads. 245 of the 291 PDF pages are landscape scans of an open book: printed page 8 on the left, page 9 on the right, with a gutter down the middle. The remaining 46 are portrait singles — covers and title pages — plus the 27 pages of rus.pdf. Do not feed a spread to an OCR engine whole. A vision model will often interleave the two pages into one scrambled reading order, and each page gets only half the pixel budget. Split at the gutter first.

The gutter is reliably found as the vertical strip carrying the least ink, searched within a band around the centre so that a wide outer margin cannot win. Across all 245 spreads it sits within a few percent of the midpoint, with one exception worth knowing: on the title spread of ava, che, dar and lbe the left page is entirely blank (it holds a library envelope), so there is no ink minimum to find and the detector drifts. Falling back to the midpoint whenever the detection lands more than ~10% off centre handles those four correctly.

The palochka is printed as a bare vertical stroke. In these editions the palochka is typeset as a plain vertical bar, visually identical to Latin IIамал, гIайде. An OCR engine returning I is therefore transcribing the glyph faithfully, not failing.

Normalise it to Ӏ (U+04C0, CYRILLIC LETTER PALOCHKA). This is the capital form, and it is the correct character even inside lowercase words: Dagestani orthographies use the one glyph in both cases. Do not use U+04CF (ӏ, the lowercase palochka) — it is rarely used in practice and will not match text from other sources.

The rewrite is safe when scoped: replacing I, l or 1 with Ӏ only where the character sits inside a Cyrillic word leaves article numbers, years and Глава I untouched.

rus.pdf is not a scan. It is a born-digital export from Microsoft Word (2013), 27 pages, with a real embedded text layer — about 66,000 characters, extractable today with pdftotext rus.pdf -. Every other file is a photograph of a printed page with no text layer whatsoever. So Russian is ground truth, not OCR output, and must not be pooled with OCR'd text without a flag distinguishing the two. It is useful as a structural reference (article numbering, section breaks) for validating an OCR pipeline before trusting it on Agul — and, because the same document exists here as both image and text, as a way to measure a candidate OCR model's character error rate before committing to it.

lez.pdf has /Rotate 270 on its pages. Renderers that honour the rotation entry produce upright spreads; those that ignore it produce sideways ones. It is also physically distinct from the rest: 34.6 MB (roughly triple the others), scanned in October 2024, with no Creator metadata — it predates the rest of the collection and was made with different equipment. It is the only file with no portrait pages at all.

The other eleven were captured with Adobe Scan for iOS in June 2025 and carry its automatic cropping, deskewing, and contrast enhancement. That processing is not reversible from these files; if you need the unprocessed camera images, they are not part of this release.

Provenance

All scans were made by Alidar Asvarov from printed copies held by the Russian State Library (Российская государственная библиотека), Moscow. No third-party scan, image, or digitisation was used.

The specific print edition (publisher, year, shelf mark) is not recorded.

The Russian PDF is a born-digital copy of the official text; it was not produced by the dataset author.

The Constitution of the Republic of Dagestan was adopted by the Constitutional Assembly of the Republic on 10 July 2003.

Licensing

Released under CC0 1.0 — public domain dedication. Two separate things are being licensed, and both are clear:

  • The underlying text. Official documents of state bodies, including their official translations, are excluded from copyright protection under Article 1259(6) of the Civil Code of the Russian Federation. The constitutional text and its official translations into the languages of Dagestan are therefore not subject to copyright.
  • The scans. Made by the dataset author, who dedicates them to the public domain under CC0. Note that under Russian law a faithful reproduction of a public-domain work does not attract a new copyright, so this dedication mostly serves to remove doubt rather than to waive a right that clearly existed.

Limitations

The OCR text is machine-generated and unverified for eleven of the twelve scanned languages; treat it as noisy until a native-speaker pass says otherwise. Its character error rate has not been measured — rus.pdf exists as both scan and ground-truth text, so it can be, and should be before anyone trusts the text at the character level.

The alignment says two texts are the same article. It does not say the translation is faithful, and it was verified structurally — coverage, length ratios, and by reading the anomalies against the Russian — not by anyone who reads Agul. Paragraph rows below the article level are length-aligned, so a 2:1 or 1:2 bead is a guess that happens to be a good one 68–96% of the time, not a fact.

Page counts differ across languages (33 to 49 book pages) because typesetting differs, not because content is missing. That is now verified article by article: every edition carries all 105 articles, except che, which is missing Russian article 95.

This is a single legal document in a formal register. It is not a general-purpose language sample, and a model trained only on it will reflect the vocabulary and syntax of constitutional prose.

Citation

@misc{asvarov2026dagestan,
  title        = {Constitution of the Republic of Dagestan: scans in 13 languages},
  author       = {Asvarov, Alidar},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/AlidarAsvarov/dagestan-constitution}}
}
Downloads last month
59