tmquan's picture
Add Sankey citation graph (case_type->code->article) + co-citation arc; update card
c1f8b09 verified
|
Raw
History Blame
20.8 kB
metadata
language:
  - vi
license: cc-by-4.0
pretty_name: Vietnamese Bản án Corpus
size_categories:
  - 1M<n<10M
task_categories:
  - text-classification
  - text-retrieval
  - question-answering
  - text-generation
  - sentence-similarity
  - feature-extraction
tags:
  - legal
  - vietnamese
  - vietnam
  - law
  - court-judgment
  - ban-an
  - statute-citation
source_datasets:
  - original
configs:
  - config_name: documents
    default: true
    data_files:
      - split: train
        path: documents-*.parquet
  - config_name: sentences
    data_files:
      - split: train
        path: sentences-*.parquet
  - config_name: embed
    data_files:
      - split: train
        path: embed-*.parquet
  - config_name: reduce
    data_files:
      - split: train
        path: reduce-*.parquet

Vietnamese Bản án Corpus — congbobanan.toaan.gov.vn

🇻🇳 Tóm tắt. Kho dữ liệu đa cấp gồm khoảng 1,370,726 bản án + quyết định của Toà án Việt Nam, thu thập từ cổng công bố bản án congbobanan.toaan.gov.vn của Tòa án nhân dân tối cao. Mỗi văn bản đi kèm markdown đã chuẩn hoá tiếng Việt (NFC + chính tả hiện đại), lớp cấu trúc phân cấp document → section → paragraph → sentence, lớp trích dẫn luật, và metadata sidebar từ trang chi tiết. Bộ dữ liệu ship bốn cấu hình HF: documents (mặc định) · sentences · embed (2048-D) · reduce (chiếu 2D PCA + UMAP).

🇬🇧 Summary. A multi-level corpus of ~1,370,726 Vietnamese court judgments + decisions (bản án) harvested from congbobanan.toaan.gov.vn (the Supreme People's Court judgment-publication portal). Every document carries a Vietnamese-normalised markdown body (NFC + modern orthography), a hierarchical structure layer (document → section → paragraph → sentence), a statute-citation layer, and HTML sidebar metadata. Four HF configs ship: documents (default) · sentences · embed (2048-D) · reduce (PCA + UMAP 2D projections).

Tổng quan · At a glance

Chỉ số · Metric Giá trị · Value
Văn bản · Documents 1,370,726
Câu · Sentences (corpus-wide) 88,408,214
Tổng ký tự · Total characters 11,617,918,966
Có cấu trúc · With structure layer 1,370,726
Có trích dẫn luật · With statute references 1,362,934
Tham chiếu điều luật · Statute references 17,527,905
Có embedding · With embedding vector 1,370,726
Có projection · With reduce projections 1,370,726
Trung vị trang · Median pages / doc 3
Trung vị ký tự · Median chars / doc 5,812
Trung vị đoạn · Median paragraphs / doc 25
Trung vị câu · Median sentences / doc 49
Trung vị lượt xem · Median views (luot_xem) 8
Trung vị lượt tải · Median downloads (luot_tai) 24

Phân loại văn bản · Document classes

Lớp nhãn dưới đây được tính trên toàn bộ kho dữ liệu — vì vậy tỉ lệ ở đây có ý nghĩa thống kê hơn hẳn các kho nhỏ. — The class distributions below are computed over the entire corpus, so the proportions are far more statistically meaningful than a small sample.

Loại văn bản · Document type (doc_type)

Value Count Share
quyet-dinh 788,549 57.5%
ban-an 572,705 41.8%

Loại vụ việc · Case category (loai_vu_viec)

Value Count Share
Hôn nhân và gia đình 680,929 49.7%
Dân sự 276,457 20.2%
Kinh doanh thương mại 24,069 1.8%
Lao động 5,781 0.4%

Lĩnh vực · Case type (case_type, from structure layer)

Value Count Share
unknown 450,983 32.9%
hon_nhan_gia_dinh 420,990 30.7%
hinh_su 255,877 18.7%
dan_su 207,707 15.2%
kinh_doanh_thuong_mai 17,311 1.3%
hanh_chinh 13,723 1.0%
lao_dong 4,135 0.3%

Cấp xét xử · Adjudication level (cap_xet_xu)

Value Count Share
Sơ thẩm 1,237,537 90.3%
Phúc thẩm 121,754 8.9%
Giám đốc thẩm 1,844 0.1%
Tái thẩm 119 0.0%

Cấp toà · Court level (court_level)

Value Count Share
huyen 661,311 48.2%
unknown 406,410 29.6%
tinh 276,758 20.2%
cap_cao 25,510 1.9%
toi_cao 737 0.1%

Áp dụng án lệ · Precedent applied (ap_dung_an_le)

Value Count Share
Không 1,359,607 99.2%
Có áp dụng 1,647 0.1%

Phân tích trích dẫn luật · Statute-citation analysis

Lớp trích dẫn được dựng từ trường statute_refs trong extracted_json: tổng cộng 17,527,905 tham chiếu điều luật trên 1,362,934 văn bản. Bộ luật (code) chỉ được trình trích xuất gán sẵn cho ~1.4% tham chiếu; phần còn lại được suy ra từ cửa sổ ±220 ký tự quanh vị trí trích dẫn (giống pipeline của kho anle), đạt 93.7% độ phủ mã bộ luật. — The citation layer is built from the statute_refs field in extracted_json: 17,527,905 statute references across 1,362,934 documents. The extractor pre-populates the statute code for only ~1.4% of references; the rest are recovered from the ±220-char markdown window around each citation (the same approach as the anle pipeline), reaching 93.7% code coverage.

Bộ luật được trích dẫn nhiều nhất · Top cited codes

Code Name Citations Documents
BLTTDS Civil Procedure Code 6,997,990 930,489
BLHS Criminal Code 3,230,518 253,512
BLTTHS Criminal Procedure Code 1,745,670 248,114
LTHADS Civil Enforcement Law 1,500,105 482,959
LXLVPHC Law on Handling of Administrative Violations 918,736 95,611

Cặp đồng trích dẫn mạnh nhất · Strongest co-citation pairs

Code A Code B Co-citing documents
BLTTDS LTHADS 409,831
BLHS BLTTHS 240,091
BLDS BLTTDS 207,066
BLDS LTHADS 199,587
BLTTDS LHNGD 196,919
LHNGD LTHADS 105,653

Tổng số trích dẫn theo bộ luật. — Total citations per statute code.

08_top_codes.png

Các cặp (bộ luật, điều) được trích dẫn nhiều nhất. — Most-cited (code, article) pairs.

09_top_articles.png

Đồ thị trích dẫn 3 cột: case_type → bộ luật → điều luật; độ rộng liên kết ∝ số trích dẫn; cạnh trái tô theo case_type, cạnh phải theo bộ luật. — Three-column citation flow: case_type → statute code → (code, article); link width ∝ #citations; left links coloured by case_type, right links by code. (Cùng kiểu hình fig_cite_network của kho anle. — The same Sankey/alluvial style as anle's fig_cite_network.)

10_citation_network.png

Cung đồng trích dẫn: các bộ luật xếp trên trục ngang theo thứ tự phổ (spectral), mỗi cung nối một cặp bộ luật được trích dẫn chung, độ dày & màu ∝ số văn bản đồng trích dẫn. — Co-citation arc diagram: codes on a horizontal baseline in spectral order, each arc links a pair of co-cited codes, arc width & colour ∝ co-citing document count.

13_citation_arc.png

Đồ thị Sankey ở trên dựng từ bộ ba (case_type, bộ luật, điều)case_type lấy từ lớp cấu trúc của mỗi văn bản, ghép với statute_refs trong extracted_json (12 bộ luật hàng đầu, tối đa 6 điều/bộ luật, giống mật độ của anle). Hình cung là biến thể đồng-trích-dẫn của fig_cite_arc (kho anle dùng streamgraph theo mạch tự sự, cần progress/section_kind mà lớp trích dẫn congbobanan không lưu). — The Sankey above is built from (case_type, code, article) triples — each document's structure-layer case_type joined to its statute_refs (top 12 codes, ≤6 articles each, matching anle's density). The arc figure is the co-citation variant of fig_cite_arc (anle uses a narrative-arc streamgraph, which needs the per-reference progress / section_kind the congbobanan citation layer does not retain).

Các con số trên được lưu kèm trong assets/citation_summary.jsonassets/citation_edges.csv để kiểm chứng. — These numbers are mirrored in assets/citation_summary.json and assets/citation_edges.csv for auditing.

Phân bố kho dữ liệu · Corpus distributions

Phân bố độ dài văn bản (ký tự & số trang). — Document-size distribution: character count and page count, with medians marked.

01_doc_size.png

Số bản án theo năm công bố (ngay_cong_bo). — Judgments per publication year, showing the portal's coverage ramp.

02_docs_over_time.png

Cơ cấu loại vụ việc theo nhãn sidebar (loai_vu_viec). — Case-category mix from the portal sidebar labels.

03_case_category.png

Phân bố theo cấp xét xử (cap_xet_xu) và cấp toà (court_level). — Distribution by adjudication level and court level.

04_court_level.png

Quan hệ pháp luật phổ biến nhất (quan_he_phap_luat). — Most frequent legal-relationship labels.

05_legal_relationship.png

Phân bố lượt xem & lượt tải (thang log). — View / download popularity on a log scale, with medians.

06_popularity.png

Phân bố nhãn thực thể được trích xuất (entities). — Distribution of extracted entity tags (regex NER).

07_entity_tags.png

Các toà xét xử bận rộn nhất (toa_an_xet_xu). — Busiest adjudicating courts by document count.

11_top_courts.png

Bản đồ embedding · Embedding landscape

Mỗi điểm là một văn bản; toạ độ là vector embedding 2048-D từ nvidia/llama-nemotron-embed-1b-v2 chiếu xuống 2D bằng UMAP, tô màu theo thuộc tính văn bản. PCA cũng được tính sẵn và lưu trong reduce-*.parquet (pca_x/pca_y). — Each dot is one document; coordinates are the 2D UMAP projection of a 2048-D embedding from nvidia/llama-nemotron-embed-1b-v2, coloured by document facets. PCA is also pre-computed in reduce-*.parquet (pca_x/pca_y).

UMAP — lĩnh vực · case_type

embedding-case-type-umap.png

UMAP — cấp xét xử · doc_subtype

embedding-doc-subtype-umap.png

UMAP — cấp toà · court_level

embedding-court-level-umap.png

Lược đồ · Schemas

The dataset ships four Hugging Face configs, all joinable on the doc_name primary key.

documents (default) — one row per judgment

Identification + structure-derived meta

Field Type Description
doc_name / case_id string Stable integer document id (as a string).
source string Always congbobanan.toaan.gov.vn.
detail_url / pdf_url string Deep links back to the portal page / PDF.
doc_code string E.g. 38/2021/DS-PT (sequence/year/case-type-procedure).
doc_type string ban_an | quyet_dinh | …
case_type string dan_su | hinh_su | hon_nhan_gia_dinh | lao_dong | kinh_doanh_thuong_mai | hanh_chinh.
doc_subtype string so_tham | phuc_tham | giam_doc_tham | tai_tham.
year int32 Year extracted from doc_code.
title / subject string Header line / V/v … matter line.
issue_date string ISO 8601 issue date when discoverable.
issuing_authority string Full court name.
court_level string huyen | tinh | cap_cao | toi_cao.
jurisdiction string Province / city qualifier.

Sidebar metadata (HTML detail-page co-update — see How built)

Field Type Description
ban_an_so string Judgment number from the portal sidebar.
ngay string Judgment date (ngày).
ten_ban_an string Human-readable judgment title.
ngay_cong_bo string Publication date on the portal.
quan_he_phap_luat string Legal-relationship label.
cap_xet_xu string Adjudication level as labelled by the portal.
loai_vu_viec string Case-matter type as labelled by the portal.
toa_an_xet_xu string Adjudicating court name.
ap_dung_an_le string Whether a precedent (án lệ) was applied (/Không).
dinh_chinh string Correction / erratum note.
thong_tin_vu_viec string Free-text case-information blurb.
tong_binh_chon string Aggregate user-rating string.
luot_xem / luot_tai int64 View / download counters.
pdf_filename string Original PDF filename as served.

Any sidebar field may be null on ghost / sparse detail pages.

Body, stats, provenance, hierarchy

Field Type Description
markdown string NFC-normalised, modern-orthography Vietnamese markdown (page-segmented with ## Page N).
num_pages / num_sections / num_paragraphs / num_sentences int32 Counts from the structure layer.
char_len int32 Character length of markdown.
text_hash string SHA-256 (first 32 hex) of markdown.
parser_model / parsed_at string Parse-stage provenance.
confidence float64 (nullable) Parser confidence; null for the default parser.
structure_json string Full DocumentStructure (meta + stats + sections + paragraphs + sentences) as JSON.
extracted_json string Regex NER + statute links (entities, relations, statute_refs) as JSON.

sentences — one row per sentence

Flattens section → paragraph → sentence so consumers can stream and filter sentences without parsing structure_json. Carries join key doc_name, ids (sentence_id/paragraph_id/section_id), promoted parent filter columns (case_type, doc_type, doc_subtype, court_level, year, cap_xet_xu, loai_vu_viec), location (section_kind, paragraph_kind, paragraph_marker, page, index_in_paragraph, global_index, char_start, char_end), and the text payload.

embed — one row per document

doc_name, text_hash, embedding (list<float32>, 2048-D), embedding_dim, embedding_model_id, embedding_text_hash, embedding_chunks_used, embedding_chunking. Default embedder: nvidia/llama-nemotron-embed-1b-v2.

reduce — one row per document

Field Type Description
doc_name / text_hash string Join keys.
pca_x / pca_y float64 PCA 2D projection axes.
umap_x / umap_y float64 UMAP 2D projection axes.
cluster_id int64 Unused placeholder (all -1); clustering is not provided in this release. The column is retained for schema stability.
import json
from datasets import load_dataset

docs = load_dataset("tmquan/congbobanan-toaan-gov-vn", "documents", split="train")
row = docs[0]
print(row["ban_an_so"], row["toa_an_xet_xu"], row["loai_vu_viec"])
refs = json.loads(row["extracted_json"])["statute_refs"]
print(len(refs), "statute references")

Cách thu thập + chuẩn hoá · How the corpus was built

A five-stage NeMo Curator flow (download → parse → extract → embed → reduce) under packages/datasites/congbobanan. The precedent / án-lệ site layer stays off for this judgment portal.

  1. Download — enumerates the integer case-ID range and downloads each published judgment (PDF, with DOCX / DOC fallbacks).
  2. Parsepypdf for digital PDFs; a self-hosted OCR VLM for image-only scans. Output is NFC-normalised Vietnamese markdown with modern orthography. Only the digital-PDF cohort (Cases A + B) is included here; the OCR-only cohort is excluded from this release.
  3. Extract — two deterministic layers: generic regex/dictionary NER (dates, courts, articles) + statute linking (Điều N khoản M Bộ luật …statute_refs), and structure segmentation into the five-section template (header → case_summary → findings → decision → footer), paragraphs (marker-classified), and sentences.
  4. Embed — default model nvidia/llama-nemotron-embed-1b-v2 (2048-D). The embedding recipe is vector-identical to the anle corpus (same model, same sliding-window-chunk + mean-pool contract), so embeddings are directly comparable across the two datasets. The full set of routable models is in manifest.json["pipeline"]["embed"]["registry"].
  5. ReducePCA + UMAP 2D projections (pca, umap) over the full embedding matrix. No clustering is provided in this release: the cluster_id column is retained for schema stability but is an all--1 placeholder.

HTML metadata co-update. The sidebar columns (ban_an_so, ngay, ten_ban_an, ngay_cong_bo, quan_he_phap_luat, cap_xet_xu, loai_vu_viec, toa_an_xet_xu, ap_dung_an_le, dinh_chinh, thong_tin_vu_viec, tong_binh_chon, luot_xem, luot_tai, pdf_filename) do not come from the PDF body. The harvester scrapes them from the portal's HTML detail panel; the parser passes them through unchanged, making each record a co-update of two independent sources (HTML sidebar + parser output). See wiki/PARSING.md § 6.

Chất lượng & lưu ý · Data-quality caveats

  • Weak / regex labels. case_type, doc_subtype, court_level, doc_type and the statute code are produced by deterministic regex heuristics, not human annotation. The statute code in particular is pre-populated for only ~1.4% of references; the citation analysis here recovers the rest from markdown context (≈94% coverage) but a residual UNKNOWN band remains.
  • Sidebar null rates. Any HTML-sidebar field can be null on ghost or sparse detail pages; do not assume universal coverage.
  • OCR cohort excluded. Only digital-PDF Cases A + B ship here; the image-only OCR cohort is held back, so the corpus skews toward machine-readable judgments.
  • Free-text facets. quan_he_phap_luat and toa_an_xet_xu are high-cardinality free text; the figures show only the head of a long tail.

Captured: 2026-06-10T07:02:49.376355+00:00.

Nguồn · Source

Giấy phép · License

Văn bản gốc được Toà án nhân dân tối cao công bố trên cổng thông tin công cộng. 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 sử dụng của trang nguồn trước khi tái phân phối thương mại. — The source documents are published by the Supreme People's Court on a public portal. This redistribution is shared under CC-BY-4.0; please check the source-website terms of use before commercial redistribution.

Trích dẫn · Citation

@misc{congbobanan_2026,
  title        = {Vietnamese Bản án Corpus (congbobanan.toaan.gov.vn)},
  author       = {TMQuan},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/datasets/tmquan/congbobanan-toaan-gov-vn}},
  note         = {Multi-level mirror (~1.37M Vietnamese court judgments) with hierarchical structure (DocumentMeta + Section + Paragraph + Sentence), statute-citation layer, 2048-D embeddings, and 2D projections.}
}

@misc{congbobanan_toaan_2026,
  title        = {Cổng công bố bản án và quyết định của Toà án},
  author       = {{Công bố bản án — Tòa án nhân dân tối cao}},
  year         = {2026},
  howpublished = {\url{https://congbobanan.toaan.gov.vn/}},
  note         = {Official portal for the publication of Vietnamese court judgments (bản án) + decisions, published by the Supreme People's Court.}
}