Dataset Viewer
Auto-converted to Parquet Duplicate
The dataset viewer is not available for this split.
Not found.
Error code:   ResponseNotFound

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Bộ Pháp Điển Việt Nam — phapdien.moj.gov.vn

🇻🇳 Tóm tắt. Bộ ngữ liệu cấp Điều của Bộ Pháp Điển Việt Nam — bộ pháp điển chính thức do Bộ Tư pháp công bố. Mỗi dòng documents là một Điều kèm toàn văn đã chuẩn hoá, chương sở thuộc, đề mục và chủ đề. Kèm theo là vector nhúng ngữ nghĩa 4096-D (embeddings), toạ độ giảm chiều trong không gian chung ViLA (reduces), và từ điển ontology song ngữ Việt–Anh (chủ đề · đề mục · thuật ngữ).

🇬🇧 One-line. Article-level corpus of the Bộ Pháp Điển — the official codification of Vietnamese law published by the Ministry of Justice — with 4096-D semantic embeddings and joint-space 2-D/3-D projections shared across the six-dataset ViLA legal corpus.

Standardised to the ViLA common-corpus layout: documents (main table) · embeddings (Nemotron-3-Embed-8B, 4096-D) · reduces (t-SNE / UMAP coordinates in one joint space fit over all six ViLA legal datasets). Domain extras — the bilingual ontology (ontology_topics, ontology_subjects, ontology_glossary) and the raw portal tables (subjects, tree_nodes) — ship alongside.

3 · Tổng quan · Overview

🇻🇳 Bộ Pháp Điển được tổ chức theo ba cấp: Chủ đề (topic) → Đề mục (subject) → Điều (article). Bộ dữ liệu này phủ toàn bộ 43 chủ đề, 202 đề mục, và corpus ~66k điều, thu thập từ cổng chính thức của Bộ Tư pháp ngày 2026-07-21. · 🇬🇧 The Vietnamese legal codification has a strict three-level ontology — topic (Chủ đề) → subject (Đề mục) → article (Điều). This dataset covers the complete ontology — 43 topics, 202 subjects, and the full article corpus — crawled from the Ministry of Justice portal on 2026-07-21.

Chỉ số · Metric Giá trị · Value
Điều luật · Articles (documents) 65,967 rows
Vector nhúng · Embedding rows (embeddings) 65,997 (429 empty dividers carry embedding_dim = 0)
Toạ độ giảm chiều · Reduction rows (reduces) 262,272 = 65,568 content articles × {t-SNE, UMAP} × {2-D, 3-D}
Đề mục · Subjects 202
Chủ đề · Topics 43 (corpus) · 42 curated in ontology_topics
Ngôn ngữ · Language Vietnamese (vi); the ontology tables add English (en) labels
Số mã băm nội dung khác nhau · Distinct content hashes 64,559
Tổng số ký tự / từ · Total characters / words 80,936,862 / 17,900,064
Có tiêu đề chương · With chapter heading 99.1%
Có chú thích nguồn / liên kết vbpl.vn · With source-note / vbpl.vn link 100.0% / 100.0%
Nội dung trống (mục phân cách) · Empty content (section dividers) 429
Embedding model nvidia/Nemotron-3-Embed-8B-BF16 (4096-D)
Nguồn · Source https://phapdien.moj.gov.vn/Pages/home.aspx
Cơ quan công bố · Publisher Ministry of Justice of Vietnam (Bộ Tư pháp)
Thu thập lúc · Crawled 2026-07-21 (202/202 đề mục fetched without error)

Độ dài Điều luật (ký tự) · Article length (characters): median 744, mean 1,226, p90 2,554, p99 7,348, max 376,842.

Vị trí trong ngữ liệu chung ViLA · Place in the shared ViLA corpus. phapdien contributes 65,568 of the 2,326,918 points (≈ 2.33 M) in the joint embedding space that spans all six ViLA legal datasets (cbba, tvpl-vbpl, hdpl, phapdien, tnpl, anle). Its reduces coordinates are directly comparable, point-for-point, with every other dataset's.

4 · Cấu hình · Configs

🇻🇳 Bộ dữ liệu phơi bày 8 config. documents là bảng chính; embeddings / reduces là các config chuẩn ViLA; phần còn lại là bảng ontology / tham chiếu. · 🇬🇧 The dataset exposes 8 configs: the three ViLA-standard ones (documents, embeddings, reduces) plus five domain extras.

Config Split Số dòng · Rows File(s) Vai trò · Role
documents (default) train 65,967 documents-*.parquet (7) Main article table
embeddings train 65,997 embeddings-*.parquet (33) Nemotron-8B 4096-D vectors
reduces train 262,272 reduces.parquet Joint-space t-SNE/UMAP 2-D+3-D coordinates
subjects train 202 subjects.parquet Per-đề-mục fetch metadata
tree_nodes train 245 tree_nodes.parquet Raw jstree topic/subject nodes
ontology_topics train 42 ontology_topics.parquet Curated bilingual topic dictionary
ontology_subjects train 202 ontology_subjects.parquet Curated bilingual subject dictionary
ontology_glossary train 116 ontology_glossary.parquet Cross-cutting VI↔EN legal lexicon

⚠️ Row-count note. documents materialises 65,967 rows while embeddings carries 65,997 (of which 429 are empty section-dividers with embedding_dim = 0, leaving 65,568 content vectors — exactly the rows projected in reduces). Join on keys, not row order.

Khoá nối · Join story. record_id là khoá chính đảm bảo duy nhất của documents. article_id là mã trích dẫn dễ đọc nhưng nguồn tái sử dụng ~200 mã, nên không duy nhất toàn cục — khi nối embeddings / reduces về đúng một Điều, hãy ghép (subject_id, article_id). Các bảng ontology (ontology_*, tree_nodes) nối qua UUID topic_id / subject_id. · 🇬🇧 record_id is the guaranteed-unique primary key of documents. article_id is the human-facing citation code but the source reuses ~200 codes, so it is not globally unique — join embeddings / reduces back to a single article on (subject_id, article_id). Ontology tables join on the topic_id / subject_id UUIDs.

5 · Lược đồ · Schema

Quy ước cột song ngữ · Bilingual column convention. documents/subjects are English-primary (unsuffixed = EN, _vi companion = VI); ontology_topics/ontology_subjects use explicit _vi/_en suffix pairs; ontology_glossary uses bare vi/en. Vietnamese content fields (article_title, chapter_title, content_text, …) keep unsuffixed names — the source publishes them in Vietnamese only.

documents — one row per Điều (article)

Column Type Notes
record_id string Guaranteed-unique row key — sha1(subject_id | article_id | content_hash)[:16]. Primary key.
subject_id string UUID of the đề-mục this article belongs to.
topic_id string UUID of the chủ-đề (topic) the đề-mục sits under.
topic_number int64 Topic display number (1–45).
topic_title / topic_title_vi string Topic name — English / Vietnamese.
subject_number int64 Đề-mục display number within its topic.
subject_title / subject_title_vi string Đề-mục name — English / Vietnamese.
article_id string Canonical citation code, e.g. Điều 39.13.TT.70.6. Not globally unique (source reuses ~200 codes) — use record_id.
article_anchor string Raw portal <a name> anchor, prefixed with #; strip client-side to recover the raw id. Not unique; may be empty.
article_title string Full title incl. the Điều N.M.X.Y prefix.
chapter_title string Chapter heading the article sits under, if any.
source_note_text string Citation back to the originating instrument (Luật/Nghị định/Thông tư).
source_links list<struct<text,href>> Hyperlinks inside source_note_text, typically to vbpl.vn.
related_note_text string Cross-references to other articles, when present.
content_text string Normalised article body (whitespace-collapsed, NBSP-stripped).
content_char_len / content_word_count int64 Character / whitespace-token counts of content_text.
source_url string Portal locator (ViewBoPD.aspx?demucid=…#<anchor>); opens the đề-mục viewer.
scraped_at string ISO-8601 UTC capture timestamp.

embeddings — one row per article (Nemotron-8B)

Dense vectors from nvidia/Nemotron-3-Embed-8B-BF16 (4096-D, mean-pooling, passage: prefix) over content_text, plus denormalised metadata for in-place filtering.

Column Type Notes
article_id string Citation code. Join key (with subject_id) back to documents.
embedding list<double> Dense vector, 4096-D for content rows; empty dividers carry a short/zero vector with embedding_dim = 0.
embedding_dim int64 4096 for content rows, 0 for empty dividers.
embedding_model_id string nvidia/Nemotron-3-Embed-8B-BF16.
embedding_text_hash string Hash of the embedded text (dedup / provenance).
embedding_chunks_used int64 Chunks pooled into the vector (1 when not chunked).
embedding_chunking string none (single pass) or empty (nothing to embed).
article_title, subject_id, subject_number, subject_title, topic_id, topic_number, topic_title, chapter_title, source_url, content_char_len mixed Denormalised metadata mirroring documents (*_number are strings here).

reduces — joint-space projection coordinates (long)

One row per (article × method × dim). These are phapdien's coordinates inside one joint t-SNE/UMAP fit over all six ViLA datasets (see §5). Long, tidy layout shared verbatim across every ViLA card.

Column Type Notes
id string article_id citation code (e.g. Điều 1.1.LQ.1). Join to documents/embeddings on article_id (+ subject_id to disambiguate). 225 codes recur (max 3×) → 65,568 rows per variant map to 65,335 distinct ids; all rows kept.
dataset string Constant phapdien — identifies the source dataset within the shared space.
language string Constant vi.
method string tsne or umap.
dim int64 2 or 3.
coords list<double> Projected coordinates; length equals dim.

Domain extras

  • subjects (202) — per-đề-mục fetch record: subject_id, topic_id, topic_number, topic_title/topic_title_vi, subject_number, subject_title/subject_title_vi, source_url, file_version, fetch_status, fetch_error, scraped_at.
  • tree_nodes (245) — raw jstree ontology node: node_id, parent_id, kind (topic/subject), number, title, raw_text.
  • ontology_topics (42) — topic_id, topic_number, topic_title_vi, topic_title_en, topic_note, article_count, demuc_count.
  • ontology_subjects (202) — topic_id, topic_number, topic_title_vi, topic_title_en, subject_id, subject_title_vi, subject_title_en, article_count.
  • ontology_glossary (116) — category (slug: instrument, structure, codification, court, agency, procedure, civil, criminal, admin, status, finance, labour, police), vi, en, note. All three ontology tables also ship as .csv; ontology.json bundles them as a tree.

6 · Embeddings · Nhúng vector

🇻🇳 Mỗi điều được nhúng bằng nvidia/Nemotron-3-Embed-8B-BF16 (4096-D, mean-pooling, tiền tố passage:) từ trường content_text (tiếng Việt). · 🇬🇧 Every article is embedded with nvidia/Nemotron-3-Embed-8B-BF16 (4096-D, mean-pooling, passage: prefix) over the Vietnamese content_text field. Content-bearing articles get a full 4096-D vector; the 429 empty section-dividers carry embedding_dim = 0 (filter content_char_len > 0 for content only). A single 8-billion-parameter encoder is used across the whole ViLA corpus so vectors are directly comparable between datasets.

from datasets import load_dataset
emb = load_dataset("tmquan/phapdien-moj-gov-vn", "embeddings", split="train")
vec = emb[0]["embedding"]   # 4096-D list<double>

7 · Giảm chiều — ngữ liệu chung · Dimensionality reduction — the common corpus

🇻🇳 Config reduces là bảng dài {id, dataset, language, method, dim, coords}. Toạ độ đến từ một lần fit chung duy nhất trên toàn bộ sáu bộ dữ liệu ViLA (2,326,918 điểm ≈ 2.33 M, embedding nvidia/Nemotron-3-Embed-8B-BF16, KHÔNG dùng PCA). Mỗi phương pháp {tsne, umap} được fit ở cả 2-D và 3-D; giữ tất cả các dòng. · 🇬🇧 The reduces config is a long table {id, dataset, language, method, dim, coords}. Coordinates come from one single joint fit over all six ViLA legal datasets (2,326,918 points ≈ 2.33 M, Nemotron-3-Embed-8B, no PCA). Each method {tsne, umap} is fit at both 2-D and 3-D; all rows are kept.

method dim rows (phapdien)
tsne 2 65,568
tsne 3 65,568
umap 2 65,568
umap 3 65,568
total 262,272

Because the fit is joint, a phapdien article and, say, a tvpl-vbpl document that sit near each other in coords are genuinely semantically close — cross-dataset geometry is meaningful. There are no PCA rows and no PCA projections anywhere in this dataset.

8 · Trực quan hoá · Visualizations

Ngữ liệu chung ViLA (6 bộ) · The shared ViLA corpus (all 6 datasets)

Cùng không gian nhúng chung; phapdien là một trong sáu bộ. — The same shared embedding space; phapdien is one of the six colours.

Global corpus — UMAP by dataset Global corpus — t-SNE by dataset Global corpus — UMAP by language (VI vs EN)

Cấu trúc ngữ nghĩa của phapdien trong không gian chung · This dataset's structure in the shared space

t-SNE và UMAP 2-D của phapdien, toạ độ lấy từ lần fit chung 6 bộ (không fit lại riêng), tô màu theo chủ đề pháp luật (12 chủ đề lớn nhất + Other); kèm bản đồ cụm HDBSCAN. — t-SNE and UMAP 2-D of phapdien, with coordinates from the shared 6-dataset joint reduce (not a per-dataset re-fit), coloured by legal topic (top-12 + Other); plus an HDBSCAN cluster map.

t-SNE coloured by legal topic UMAP coloured by legal topic UMAP coloured by HDBSCAN cluster

Ontology (chủ đề · đề mục · văn bản) · Ontology figures

All 43 topics, bilingual Article count per topic Treemap of the top-20 topics Sunburst of topic → subject Vietnamese legal-instrument hierarchy

Sơ đồ 43 chủ đề (mindmap) · 43-topic mind-map (mermaid, source in ontology_mindmap.mmd)
mindmap
  root((**Bộ Pháp Điển**<br/>~66,000 Điều))
    #39 Trật tự, an toàn xã hội · 5,080 Điều
    #34 Thương mại, đầu tư, chứng khoán · 4,490 Điều
    #14 Giao thông, vận tải · 4,267 Điều
    #24 Nông nghiệp, nông thôn · 3,773 Điều
    #45 Y tế, dược · 3,709 Điều
    #37 Tố tụng và giải quyết tranh chấp · 3,042 Điều
    #22 Ngân hàng, tiền tệ · 2,834 Điều
    #33 Thuế, phí, lệ phí · 2,365 Điều
    #28 Tài sản công, nợ công · 2,124 Điều
    #27 Tài nguyên · 2,111 Điều
    #1  An ninh quốc gia · 1,898 Điều
    #25 Quốc phòng · 1,799 Điều

9 · Gợi ý phân tích · Analysis pointers

Từ toạ độ chung reduces, bạn có thể: · From the shared reduces coordinates you can:

  • kNN graph / retrieval — nearest neighbours in coords (or, for exact work, the 4096-D embeddings) surface semantically-similar Điều within phapdien and — thanks to the joint fit — across the other five ViLA datasets (statute text, case law, Q&A, terminology).
  • Clustering — run HDBSCAN / k-means on the 3-D umap coordinates; compare against the curated topic_id / subject_id labels to measure how well the codification ontology matches embedding geometry. (A ready-made per-dataset HDBSCAN labelling is visualised above.)
  • Cross-dataset geometry — filter reduces by dataset to overlay phapdien articles on cbba judgments or tvpl-vbpl statutes and study where codified law sits relative to primary instruments and case law.
  • Topic structure — colour a 2-D projection by topic_number to see the 43-topic macro-structure (see §6).

10 · Cách dùng · How to use

from datasets import load_dataset

# Bảng chính · Main table (default): codified articles
docs = load_dataset("tmquan/phapdien-moj-gov-vn", "documents", split="train")
print(docs[0]["topic_title"], "/", docs[0]["topic_title_vi"])

# Vector nhúng · Embeddings (4096-D Nemotron-8B)
emb = load_dataset("tmquan/phapdien-moj-gov-vn", "embeddings", split="train")

# Toạ độ không gian chung · Shared-space coordinates (long: tsne/umap × 2D/3D)
red = load_dataset("tmquan/phapdien-moj-gov-vn", "reduces", split="train")
umap2d = red.filter(lambda r: r["method"] == "umap" and r["dim"] == 2)

# Ontology song ngữ + bảng tham chiếu · Bilingual ontology + reference tables
topics   = load_dataset("tmquan/phapdien-moj-gov-vn", "ontology_topics",   split="train")
subj_dic = load_dataset("tmquan/phapdien-moj-gov-vn", "ontology_subjects", split="train")
glossary = load_dataset("tmquan/phapdien-moj-gov-vn", "ontology_glossary", split="train")
subjects = load_dataset("tmquan/phapdien-moj-gov-vn", "subjects",   split="train")
tree     = load_dataset("tmquan/phapdien-moj-gov-vn", "tree_nodes", split="train")

documents already carries both bilingual topic/subject columns, so no join is required for common use; join embeddings / reduces back on (subject_id, article_id).

11 · Nguồn & cách thu thập · Provenance & crawl

🇻🇳 Bộ ngữ liệu được thu thập bằng crawler tuỳ chỉnh đi qua đúng các surface mà cổng nguồn phơi ra cho trình duyệt — không có endpoint JSON / SOAP công khai. · 🇬🇧 Harvested with a custom crawler that follows the exact surfaces the source portal exposes to a browser — there is no public JSON / SOAP endpoint for the codified content:

  1. Fetch the topic/đề-mục tree from TreeBoPD.aspx; the ASP.NET WebForms response embeds the entire jstree JSON (→ tree_nodes, subjects).
  2. Per đề-mục, GET ViewBoPD.aspx?demucid=<uuid>&mapc=1 to pull the fileVersion token.
  3. POST to ActionHandler.aspx (do=html) with (deMucID, fileVersion) for the full codified legal HTML.
  4. Parse each <p class="pDieu"> into one row (attaching pChuong chapter, pGhiChu source- note + links, pChiDan related cross-references) → documents.

Captured at 2026-07-21T10:09:42+00:00; 202/202 đề mục fetched without error. Embeddings and the joint reduces projection were computed downstream as part of the ViLA common-corpus build.

Ontology extras. The ontology_* tables are a hand-curated Vietnamese ↔ English dictionary (42 topics + 202 subjects + 116 glossary terms) and the source-of-truth for the bilingual labels denormalised into documents. ontology.json bundles all three as a tree; parallel .csv files ship too.

Hạn chế đã biết · Known limitations

(i) The portal renders text client-side, so source_url opens the đề-mục viewer rather than scrolling to the article — use the vbpl.vn link in source_links as the browsable source of record. (ii) article_id is not unique (source reuses ~200 codes) — use record_id as the primary key and join embeddings/reduces on (subject_id, article_id). (iii) Row-count skew: documents has 65,967 rows while embeddings has 65,997 — join on keys, not row order. (iv) 429 empty divider rows carry embedding_dim = 0 and are excluded from reduces; filter content_char_len > 0 for content-bearing articles only.

12 · Giấy phép & trích dẫn · License & citation

Văn bản pháp điển do Bộ Tư pháp công bố trên cổng công cộng, không thu phí. Bản phân phối lại này dùng giấy phép CC-BY-4.0 — vui lòng kiểm tra điều khoản của trang nguồn trước khi tái phân phối thương mại và ghi nhận tác giả gốc. · The codified text is published by the Ministry of Justice on a public portal without paywall. This redistribution is shared under CC-BY-4.0 — please check the source-website terms of use before commercial redistribution and attribute the original publisher.

@misc{phapdien_2026,
  title        = {Vietnamese Codified Law Corpus (phapdien.moj.gov.vn)},
  author       = {TMQuan},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/datasets/tmquan/phapdien-moj-gov-vn}},
  note         = {Article-level mirror of the Vietnamese codified legal corpus, with Nemotron-8B embeddings, joint-space ViLA projections, and a curated Vietnamese--English ontology.}
}

@misc{phapdien_moj_2026,
  title        = {Vietnamese Codified Law Corpus},
  author       = {{Bộ Pháp Điển Việt Nam}},
  year         = {2026},
  howpublished = {\url{https://phapdien.moj.gov.vn/}},
  note         = {Official codified body of Vietnamese law, published by the Ministry of Justice (Bộ Tư pháp).}
}
Downloads last month
888

Spaces using tmquan/phapdien-moj-gov-vn 2

Collection including tmquan/phapdien-moj-gov-vn