PhysShell bobur-m commited on
Commit
a5f829d
·
0 Parent(s):

Duplicate from bobur-m/adiletcodex

Browse files

Co-authored-by: Bobur Mukhsimbayev <bobur-m@users.noreply.huggingface.co>

Files changed (6) hide show
  1. .gitattributes +60 -0
  2. CODEBOOK.md +101 -0
  3. LICENSE +20 -0
  4. README.md +133 -0
  5. adiletcodex.csv.gz +3 -0
  6. adiletcodex.jsonl.gz +3 -0
.gitattributes ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.avro filter=lfs diff=lfs merge=lfs -text
4
+ *.bin filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
7
+ *.ftz filter=lfs diff=lfs merge=lfs -text
8
+ *.gz filter=lfs diff=lfs merge=lfs -text
9
+ *.h5 filter=lfs diff=lfs merge=lfs -text
10
+ *.joblib filter=lfs diff=lfs merge=lfs -text
11
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
12
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
13
+ *.mds filter=lfs diff=lfs merge=lfs -text
14
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
15
+ *.model filter=lfs diff=lfs merge=lfs -text
16
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
17
+ *.npy filter=lfs diff=lfs merge=lfs -text
18
+ *.npz filter=lfs diff=lfs merge=lfs -text
19
+ *.onnx filter=lfs diff=lfs merge=lfs -text
20
+ *.ot filter=lfs diff=lfs merge=lfs -text
21
+ *.parquet filter=lfs diff=lfs merge=lfs -text
22
+ *.pb filter=lfs diff=lfs merge=lfs -text
23
+ *.pickle filter=lfs diff=lfs merge=lfs -text
24
+ *.pkl filter=lfs diff=lfs merge=lfs -text
25
+ *.pt filter=lfs diff=lfs merge=lfs -text
26
+ *.pth filter=lfs diff=lfs merge=lfs -text
27
+ *.rar filter=lfs diff=lfs merge=lfs -text
28
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
29
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
31
+ *.tar filter=lfs diff=lfs merge=lfs -text
32
+ *.tflite filter=lfs diff=lfs merge=lfs -text
33
+ *.tgz filter=lfs diff=lfs merge=lfs -text
34
+ *.wasm filter=lfs diff=lfs merge=lfs -text
35
+ *.xz filter=lfs diff=lfs merge=lfs -text
36
+ *.zip filter=lfs diff=lfs merge=lfs -text
37
+ *.zst filter=lfs diff=lfs merge=lfs -text
38
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
39
+ # Audio files - uncompressed
40
+ *.pcm filter=lfs diff=lfs merge=lfs -text
41
+ *.sam filter=lfs diff=lfs merge=lfs -text
42
+ *.raw filter=lfs diff=lfs merge=lfs -text
43
+ # Audio files - compressed
44
+ *.aac filter=lfs diff=lfs merge=lfs -text
45
+ *.flac filter=lfs diff=lfs merge=lfs -text
46
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
47
+ *.ogg filter=lfs diff=lfs merge=lfs -text
48
+ *.wav filter=lfs diff=lfs merge=lfs -text
49
+ # Image files - uncompressed
50
+ *.bmp filter=lfs diff=lfs merge=lfs -text
51
+ *.gif filter=lfs diff=lfs merge=lfs -text
52
+ *.png filter=lfs diff=lfs merge=lfs -text
53
+ *.tiff filter=lfs diff=lfs merge=lfs -text
54
+ # Image files - compressed
55
+ *.jpg filter=lfs diff=lfs merge=lfs -text
56
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
57
+ *.webp filter=lfs diff=lfs merge=lfs -text
58
+ # Video files - compressed
59
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
60
+ *.webm filter=lfs diff=lfs merge=lfs -text
CODEBOOK.md ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AdiletCodex - Codebook
2
+
3
+ One record = one article of one document in one language. Files: `adiletcodex.jsonl`
4
+ (nested fields kept) and `adiletcodex.csv` (flat; nested fields omitted).
5
+
6
+ ## Identity & language
7
+ | Field | Type | Description |
8
+ |---|---|---|
9
+ | `doc_id` | string | adilet NGR of the document (same id across languages), e.g. `K1400000226` |
10
+ | `doc_type` | string | `code` or `law` |
11
+ | `slug` | string\|null | short mnemonic for codes (e.g. `criminal`), null for laws |
12
+ | `lang` | string | `rus` (Russian), `kaz` (Kazakh), `eng` (English) |
13
+ | `title` | string | document title in this language |
14
+ | `url` | string | canonical adilet URL |
15
+
16
+ ## Document metadata (from the adilet requisites page)
17
+ The adilet document "passport" is published in **Russian only**. In v2.0 several passport fields
18
+ are **localized** to the row's `lang`; each keeps an `*_ru` companion with the original Russian
19
+ value for provenance. Russian (`rus`) rows keep the Russian value in the field itself. Two
20
+ localization methods are used, and they are **not** equivalent in authority:
21
+
22
+ - **curated term map** - hand-reviewed official translations (`act_form`, `adopting_organ`,
23
+ `database_section`);
24
+ - **reference metadata (machine-translated)** - translated by local Qwen3.5-122B-A10B (thinking
25
+ disabled) for convenience (filtering / search), **not** authoritative, with the original
26
+ Russian kept in the `*_ru` companion (`legal_sphere`, `publication_reference`); the Kazakh
27
+ output uses correct Kazakh legal terminology. The substantive text (`article_text`, `title`,
28
+ etc.) is the official adilet translation, not machine translation.
29
+
30
+ Fields still marked **Russian-by-source** are not translated at all.
31
+
32
+ | Field | Type | Language | Description |
33
+ |---|---|---|---|
34
+ | `status` | string | per-language | e.g. `upd` (updated / in force). Use this for validity / in-force state. |
35
+ | `act_form` | string | **localized (curated)** | form of act, localized to `lang`: EN `Code`/`Law`/`Constitution`/`Constitutional Law`; KK `Кодекс`/`Заң`/`Конституция`/`Конституциялық заң`; RU `Кодекс`/`Закон`/`Конституция`/`Конституционный закон` (RU may include amendment-noise values). |
36
+ | `act_form_ru` | string | Russian source | original Russian `act_form` from the adilet card, kept on every row for provenance (v2.0). |
37
+ | `legal_sphere` | string | **reference metadata (machine-translated)** | subject area / legal-relations sphere; local Qwen3.5-122B-A10B MT (254 unique values), convenience only. |
38
+ | `legal_sphere_ru` | string | Russian source | original Russian `legal_sphere`, kept on every row for provenance (v2.0). |
39
+ | `database_section` | string | **localized (curated)** | adilet database section (thematic classifier), 35 fixed sections; curated EN/KK map. |
40
+ | `database_section_ru` | string | Russian source | original Russian `database_section`, kept on every row for provenance (v2.0). |
41
+ | `adopting_organ` | string\|null | **localized (curated)** | body that adopted the act (Parliament / President, with former-name notes); curated EN/KK map. |
42
+ | `adopting_organ_ru` | string\|null | Russian source | original Russian `adopting_organ`, kept on every row for provenance (v2.0). |
43
+ | `state_registry_number` | string | - | number in the State Register of NLAs |
44
+ | `npa_registration_number` | string | - | act's own number, e.g. `226-v` |
45
+ | `adoption_date` | string | - | dd.mm.yyyy |
46
+ | `change_date` | string\|null | - | date of last amendment (null if never amended) |
47
+ | `publication_date` | string\|null | - | official publication date |
48
+ | `publication_reference` | string | **reference metadata (machine-translated)** | official publication source(s); local Qwen3.5-122B-A10B MT (333 unique values) with a digit/date/number-preservation check (Russian kept on mismatch), convenience only. |
49
+ | `publication_reference_ru` | string | Russian source | original Russian `publication_reference`, kept on every row for provenance (v2.0). |
50
+ | `adoption_place` | string | **Russian-by-source** | e.g. `г. Астана` |
51
+ | `region_action` | string | **Russian-by-source** | territorial scope |
52
+ | `citation` | string | per-language | human-readable source citation of the act (e.g. `Code of the Republic of Kazakhstan dated 20 June, 2003 № 442`); `doc_date` / `doc_number` are parsed from it. |
53
+ | `doc_date`, `doc_number` | string\|null | - | adoption date (ISO `yyyy-mm-dd`) / number parsed from `citation` |
54
+
55
+ > **Removed in v2.0:** `legal_force`. It duplicated `act_form` in 323/343 documents and was
56
+ > mislabeled - it was never a validity indicator. Use `status` for validity and `act_form` for
57
+ > the type of act. See `../CHANGELOG.md`.
58
+
59
+ ## Structural hierarchy & article
60
+ | Field | Type | Description |
61
+ |---|---|---|
62
+ | `part` | string\|null | top level (e.g. `ОБЩАЯ ЧАСТЬ` / `SPECIAL PART` / `Жалпы бөлік`) |
63
+ | `section` | string\|null | Раздел / N-бөлім / Section |
64
+ | `chapter` | string\|null | Глава / N-тарау / Chapter |
65
+ | `article_id` | string\|null | internal HTML anchor id |
66
+ | `article_no` | string\|null | article number (e.g. `99`, inserts like `50-1`) |
67
+ | `article_title` | string | full article heading |
68
+ | `article_text` | string | full article body (concatenated points) |
69
+ | `paragraphs` | list | numbered points: `{id, number, text, links}` (JSONL only) |
70
+ | `notes` | list | amendment/editorial footnotes: `{text, links}` (JSONL only) |
71
+ | `links` | list | article-level hyperlinks (JSONL only) |
72
+
73
+ ## Notes
74
+ - Languages align by (`doc_id`, `article_no`). A document keeps the same `doc_id` across
75
+ languages.
76
+ - Gaps in `article_no` within a document correspond to repealed articles.
77
+ - English exists for most but not all documents (adilet does not translate everything):
78
+ 296 of 343 documents are present in all three languages, 37 in Kazakh+Russian, 5 in Kazakh
79
+ only, 3 in Russian only, 2 in Kazakh+English.
80
+ - `adopting_organ` / `adopting_organ_ru` are null for 288 records (documents whose adilet card
81
+ lists no adopting body); `publication_reference` / `publication_reference_ru` are empty for
82
+ 127 records (documents with no publication source recorded).
83
+
84
+ ## Known limitations
85
+ - **Same-number articles: fixed in v2.0.** The v1.1 pre-release audit found 19 (`doc_id`,
86
+ `lang`, `article_no`) groups with more than one record, from three causes: (a) a displayed
87
+ number that recurs across structural parts; (b) entry-into-force / amendment clauses inside
88
+ "Final and transitional provisions" (or enactment) articles that the parser emitted as
89
+ separate records (their `article_title` was a clause fragment, e.g. `article 38;`); and (c)
90
+ compound inserted numbers (e.g. `Article 15-24`) whose `article_no` had been truncated to the
91
+ base number (`15`). All 19 were repaired in v2.0 without dropping any wording: (c) was fixed
92
+ by restoring the full `article_no` (confirmed against the aligned Kazakh/Russian rows); (b)
93
+ and the stale same-language duplicates were merged back into the correct parent article and
94
+ the empty fragment removed. After the fix `article_no` is unique within every (`doc_id`,
95
+ `lang`) group - 0 duplicate keys remain. See `../CHANGELOG.md` and
96
+ `../localization/fix_duplicate_articles.py`.
97
+ - **Reference-metadata fields are machine translation.** `legal_sphere` and
98
+ `publication_reference` (and only these) are translated by a local LLM for
99
+ filtering/search convenience and are not authoritative; the original Russian is always kept in
100
+ the `*_ru` companion column. The substantive article content (`title`, `status`,
101
+ `article_title`, `article_text`) is the official adilet.zan.kz translation.
LICENSE ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AdiletCodex - License
2
+ ======================
3
+
4
+ Dataset compilation (this dataset: the selection, parsing, article segmentation,
5
+ cross-language alignment, and metadata):
6
+
7
+ Creative Commons Attribution 4.0 International (CC BY 4.0)
8
+ Full text: https://creativecommons.org/licenses/by/4.0/legalcode
9
+
10
+ You are free to share and adapt the material for any purpose, provided you give
11
+ appropriate credit (cite the dataset, see README_DATASET.md) and indicate if changes
12
+ were made.
13
+
14
+ Underlying legal texts:
15
+ The article texts are official normative legal acts of the Republic of Kazakhstan,
16
+ which are public. They were obtained from the official Information and Legal System
17
+ adilet.zan.kz. Please retain attribution to adilet.zan.kz. This is an unofficial
18
+ research copy; the authoritative, in-force text is the one published on adilet.zan.kz.
19
+
20
+ The dataset is provided "as is", without warranty of any kind.
README.md ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ language:
4
+ - kk
5
+ - ru
6
+ - en
7
+ multilinguality: multilingual
8
+ pretty_name: 'AdiletCodex: Trilingual (KK/RU/EN) Article-Level Corpus of Kazakh Legal Codes and Laws'
9
+ tags:
10
+ - legal
11
+ - law
12
+ - legal-nlp
13
+ - kazakhstan
14
+ - kz
15
+ - kazakh
16
+ - russian
17
+ - english
18
+ - legislation
19
+ - statute
20
+ - codes
21
+ - laws
22
+ - adilet
23
+ - article-level
24
+ - trilingual
25
+ - multilingual
26
+ - low-resource
27
+ - central-asia
28
+ - legal-information-retrieval
29
+ task_categories:
30
+ - text-retrieval
31
+ - text-classification
32
+ - text-generation
33
+ size_categories:
34
+ - 10K<n<100K
35
+ ---
36
+
37
+ # AdiletCodex: A Trilingual (Kazakh-Russian-English) Article-Level Corpus of the Codes and Laws of Kazakhstan
38
+
39
+ A full-text, **article-level**, **trilingual (Kazakh + Russian + English)** corpus of the
40
+ currently in-force codes and substantive laws of the Republic of Kazakhstan, parsed from the
41
+ official legal database [adilet.zan.kz](https://adilet.zan.kz).
42
+
43
+ - **65,807** article records across **343** documents (**24 codes + 319 laws**, incl. the Constitution)
44
+ - **296** documents present in all three languages (RU 22,112 / KK 22,098 / EN 21,597)
45
+ - Adoption years **1991-2026**
46
+ - Each record: full article text + structural hierarchy (part/section/chapter/article) +
47
+ numbered points + amendment notes + cross-reference links + rich document metadata
48
+ (act form, legal sphere, adopting body, registration numbers, dates, status)
49
+
50
+ To our knowledge this is the **first article-structured, trilingual, full-text** corpus of
51
+ Kazakh legislation.
52
+
53
+ ## Why this corpus
54
+ Kazakh legal NLP has lacked a **structured, full-text** foundation: existing resources are
55
+ either document-level metadata, Russian-only, or downstream QA sets built on top of statutes
56
+ they do not themselves release. AdiletCodex fills that gap with the **article** as the unit of
57
+ record, the **three official language versions** side by side, and the **structural +
58
+ amendment + metadata** context needed for legal information retrieval, cross-lingual and RAG
59
+ grounding, translation-fidelity study, and temporal ("law-as-of-date") modeling.
60
+
61
+ ## Related datasets and how AdiletCodex differs
62
+ - **KazakhLawCorpus** (Tleubayeva, *Data* MDPI 2026; 215,889 records) - document-level
63
+ **metadata only**, Kazakh only, no article text. AdiletCodex is complementary and strictly
64
+ more granular: full text, article-level, trilingual.
65
+ - **justicedao/ipfs_kazakhstan_laws_ir** (HF, ~399k rows) - article-level but **Russian only**,
66
+ undocumented, no hierarchy / amendments / status / KK / EN. AdiletCodex adds the two other
67
+ official languages, the structural hierarchy, amendment notes, status, metadata, and docs.
68
+ - **olzhasAl/adilet-legal-qa-kz** (HF, 13,159 QA pairs, RU+KK) and other Kazakh legal-QA / LoRA
69
+ sets - **downstream tasks**, not a source corpus. AdiletCodex provides the underlying statute
70
+ text those tasks are grounded in.
71
+ - **Uzbek legal corpus** (Tomaris AI) - a methodological twin for a neighbouring jurisdiction
72
+ (Uzbek-Latin only, no descriptor paper); AdiletCodex is the Kazakh, trilingual counterpart.
73
+ - **RusLawOD** (HF irlspbru/RusLawOD, 304k texts) - Russian national statutory corpus; a
74
+ language / scope comparator, not Kazakh.
75
+
76
+ ## Files
77
+ - `adiletcodex.jsonl` - one article per line (keeps nested paragraphs/notes/links)
78
+ - `adiletcodex.csv` - flat columns
79
+
80
+ ## Load
81
+ ```python
82
+ from datasets import load_dataset
83
+ ds = load_dataset("json", data_files="adiletcodex.jsonl", split="train")
84
+ ```
85
+
86
+ ## Schema
87
+ `doc_id, doc_type, slug, lang, title, status, act_form, act_form_ru, legal_sphere, legal_sphere_ru,
88
+ adopting_organ, adopting_organ_ru, database_section, database_section_ru, state_registry_number,
89
+ npa_registration_number, adoption_date, change_date, publication_date, publication_reference,
90
+ publication_reference_ru, adoption_place, region_action, citation, doc_date, doc_number, part,
91
+ section, chapter, article_id, article_no, article_title, article_text, paragraphs, notes, links, url`
92
+
93
+ (37 fields total; `paragraphs`, `notes`, `links` are nested and JSONL-only, so the CSV carries
94
+ the 34 scalar fields. `citation` is the human-readable source citation, with `doc_date` /
95
+ `doc_number` parsed from it.)
96
+
97
+ **Language of metadata fields.** Only `title`, `status`, `article_title`, `article_text` are
98
+ truly per-language and are the **official** adilet translations. The document-"passport" fields
99
+ come from adilet's Russian-only document card; in v2.0 several are **localized** to the row's
100
+ language, each with an `*_ru` companion preserving the Russian source (Russian rows keep the
101
+ Russian value):
102
+
103
+ - **Curated term map** (hand-reviewed, not machine translation): `act_form`, `adopting_organ`,
104
+ `database_section`.
105
+ - **Machine-translated (local Qwen3.5-122B-A10B, thinking disabled) reference metadata** -
106
+ convenience only, not authoritative, with the Russian source kept in the `*_ru` companion:
107
+ `legal_sphere`, `publication_reference`. The Kazakh output uses correct Kazakh legal
108
+ terminology (the earlier Qwen2.5-32B Kazakh was replaced). A number-preservation check
109
+ protects all digits/dates/article numbers in `publication_reference` (Russian original kept
110
+ on any mismatch).
111
+ - **Still Russian-by-source:** `region_action`, `adoption_place`.
112
+
113
+ Use `status` for validity/in-force state. Reproducibility artifacts (term + translation maps,
114
+ QA-failure log, scripts) are in `localization/`.
115
+
116
+ > **Changed in v2.0 (major):** `act_form`, `adopting_organ`, `database_section` are localized per
117
+ > `lang` via a curated map, and `legal_sphere`, `publication_reference` via machine translation
118
+ > (all with `*_ru` provenance companions); the redundant/mislabeled `legal_force` field was
119
+ > removed (use `status` for in-force state). Separately, 18 parser-artifact records (split-off
120
+ > entry-into-force / amendment fragments, a quoted old-code article, truncated compound article
121
+ > numbers, and stale same-language duplicates) were repaired without dropping any wording, so the
122
+ > record count is 65,807 (was 65,825 in v1.0) with 0 duplicate `(doc_id, lang, article_no)` keys.
123
+
124
+ ## License & source
125
+ Compilation: CC-BY-4.0. Underlying texts are official public acts of the Republic of
126
+ Kazakhstan (source: adilet.zan.kz). Unofficial research copy; verify in-force text on adilet.
127
+
128
+ ## Citation
129
+ Mukhsimbayev, B., Pak, A., & Kuralbayev, A. (2026). *AdiletCodex: A Trilingual (Kazakh-Russian-English)
130
+ Article-Level Corpus of the Codes and Laws of Kazakhstan* (v2.0) [Data set]. Zenodo.
131
+ https://doi.org/10.5281/zenodo.22812625 (concept DOI, always resolves to the latest version).
132
+ Latest is v2.0 (version DOI 10.5281/zenodo.23260689, published 2026-10-09); v1.0 version DOI:
133
+ 10.5281/zenodo.22812626.
adiletcodex.csv.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07b163eb48cbfb8f345c6b77f8d3b1073cf3407a0293cc0379f36022e6a58c4d
3
+ size 36317305
adiletcodex.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1573b2a7be5ec9ac7d584f69bf3418f5d1da22936331ddbbb3a8ccacc322d44b
3
+ size 52383106