CoolFace
Datasetpublic

tmquan/pbgdpl-vn-legal-qna

pbgdpl.gov.vn — Vietnamese Legal Q&A · Hỏi đáp pháp luật 🇻🇳 Tóm tắt. Bản thu thập đầy đủ chuyên mục Hỏi đáp pháp luật của Cổng thông tin điện tử Phổ biến giáo dục pháp luật — cổng giáo dục pháp luật công khai do Bộ Tư pháp vận hành. Mỗi dòng là một cặp câu hỏi của công dân (Q) và trả lời chính thức (A), kèm chú thích nguồn, lĩnh vực pháp lý, ngày gửi, và đường dẫn về trang gốc. 🇬🇧 Summary. A complete crawl of the public Hỏi đáp pháp luật ("Legal Q&A") section of… See the full description on the dataset page: https://huggingface.co/datasets/tmquan/pbgdpl-vn-legal-qna.

sourceHugging Faceotherupdated 4mo agoView on Hugging Face
0likes176downloads
Dataset Card

pbgdpl.gov.vn — Vietnamese Legal Q&A · Hỏi đáp pháp luật

🇻🇳 Tóm tắt. Bản thu thập đầy đủ chuyên mục Hỏi đáp pháp luật của Cổng thông tin điện tử Phổ biến giáo dục pháp luật — cổng giáo dục pháp luật công khai do Bộ Tư pháp vận hành. Mỗi dòng là một cặp câu hỏi của công dân (Q) và trả lời chính thức (A), kèm chú thích nguồn, lĩnh vực pháp lý, ngày gửi, và đường dẫn về trang gốc. 🇬🇧 Summary. A complete crawl of the public Hỏi đáp pháp luật ("Legal Q&A") section of `pbgdpl.gov.vn` — the Vietnamese Ministry of Justice (Bộ Tư pháp) legal-education portal. Each row is one public question (Q) paired with the official answer (A), preserving the source citation, legal-area assignment, submission date, and back-link to the original page.

Tổng quan · At a glance

Chỉ số · MetricGiá trị · Value
Số cặp Q&A · Records4 593
Ngôn ngữ · LanguageVietnamese (vi)
Khoảng thời gian · Date range2007-03-13 → 2021-10-20 (đã đóng băng từ cuối 2021 · frozen since late 2021)
Phân loại chủ đề · Topic taxonomy532 LinhVuc topics declared; 29 active
Trích dẫn pháp luật · Citation grounding98.1 % câu trả lời viện dẫn ít nhất một văn bản gốc · cite at least one primary-law instrument
Nguồn · Source<https://pbgdpl.gov.vn/Pages/hoi-dap-pl.aspx>
Thu thập lúc · Crawled2026-05-08 (run 20260508T121702Z)

Trực quan hoá · Visualizations

Pre-rendered PNG roll-ups, regenerated by `packages.datasites.pbgdpl.viz` on every re-crawl. — Generated alongside the JSONL by viz.py from analytics.json; refreshed each crawl.

Phân bố chủ đề · Topic distribution (multilevel pie / sunburst)

Vành trong là 6 lĩnh vực pháp luật rộng (Dân sự / Hình sự / Tư pháp / Thương mại / Hành chính / Khác); vành ngoài là 29 chủ đề LinhVuc đang hoạt động. Diện tích mỗi cung tỉ lệ với số câu hỏi. — Inner ring shows 6 broad legal domains (Civil / Criminal / Judicial / Commercial / Administrative / Other); outer ring shows the 29 active LinhVuc topics. Wedge area is proportional to the number of Q&A pairs.

[image]

Top chủ đề · Top topics (bar chart)

[image]

Phân bố theo năm · Year distribution

Câu hỏi được công bố theo năm (2007 → 2021). — Q&A publication date distribution across the active years (2007 → 2021).

[image]

Phân bố độ dài · Length distribution

Số ký tự của question_text và answer_text. — Character-length histograms for question_text and answer_text.

[image]

Mật độ trích dẫn · Citation density

Tần suất xuất hiện của các loại văn bản pháp luật (Luật / Bộ luật / Nghị định / Thông tư / Điều / Khoản …) trong câu trả lời. — Counts of primary-law instrument mentions inside answer_text.

[image]

Trực quan hoá embedding · Embedding scatter (4 views)

🇻🇳 Bốn ảnh 2D scatter của vector embedding 2048-D (sinh từ nvidia/llama-nemotron-embed-1b-v2 trên answer_text) cho 4 593 câu trả lời. Hai trục màu — 6 lĩnh vực pháp luật rộng và 29 chủ đề LinhVuc đang hoạt động — kết hợp với hai phép chiếu t-SNE và UMAP, cho ra tổng cộng 4 view (6 domains × {t-SNE, UMAP}, 29 topics × {t-SNE, UMAP}).

🇬🇧 Four 2D scatter views of 2048-D answer embeddings (produced by nvidia/llama-nemotron-embed-1b-v2) for all 4 593 Q&A pairs. We ship the cross product of two colour schemes — 6 broad legal domains and 29 active LinhVuc topics — with two projections, t-SNE and UMAP, giving 4 PNGs total.

t-SNE — coloured by 6 legal domains

[image]

UMAP — coloured by 6 legal domains

[image]

t-SNE — coloured by 29 LinhVuc topics

[image]

UMAP — coloured by 29 LinhVuc topics

[image]

Bộ dữ liệu này là gì? · What is in this dataset?

🇻🇳 Cổng "Hỏi đáp pháp luật" của Bộ Tư pháp là một dạng giáo dục pháp luật công khai: công dân gửi câu hỏi cụ thể (về thủ tục cấp giấy phép, thừa kế, tranh chấp đất đai, lao động, xử phạt vi phạm hành chính, …) và cán bộ chuyên môn của Bộ Tư pháp / các bộ ngành đối tác trả lời, có viện dẫn rõ điều, khoản, nghị định, thông tư cụ thể. Câu trả lời mang tính chất tham khảo (mỗi câu trả lời đều có dòng disclaimer "Nội dung trả lời chỉ mang tính chất tham khảo") nhưng vì người trả lời là cán bộ pháp chế và viện dẫn từ văn bản pháp luật gốc, nên tỉ lệ "grounded" rất cao.

🇬🇧 The "Hỏi đáp pháp luật" portal is a form of public legal education: citizens submit specific questions (about licensing procedures, inheritance, land disputes, labour, administrative penalties, …) and legal staff at the Ministry of Justice or partner ministries answer with explicit citations to articles, clauses, decrees, and circulars. The answers are formally for reference only (every answer carries a "Nội dung trả lời chỉ mang tính chất tham khảo" disclaimer) but because the authors are professional legal staff citing primary law, citation grounding is very high.

🇻🇳 Kích thước & độ sạch. 4 593 cặp Q–A, không trùng lặp (mọi answer đều có hash SHA-256 khác nhau), 0 bản ghi rỗng, 0 lỗi truy xuất; mỗi câu trả lời trung bình 3.1 viện dẫn điều luật, 91 % nhắc tới "Luật", 90 % nhắc tới "Điều".

🇬🇧 Size & cleanliness. 4 593 Q–A pairs with no duplicates (every answer has a unique SHA-256 hash), zero empty records, zero fetch errors. Each answer averages 3.1 article references; 91 % mention Luật (statute), 90 % reference Điều (article).

Tác vụ hỗ trợ · Supported tasks

  • —Question answering · Hỏi đáp — closed-domain Vietnamese legal QA. Dùng question_text → answer_text làm cặp giám sát. — Use question_text → answer_text as supervision pairs.
  • —Information retrieval · Tìm kiếm thông tin — 4 593 cặp (Q, A) là bộ đánh giá tốt cho dense / hybrid retrievers; tỉ lệ trích dẫn primary-law cao giúp dễ kiểm tra chéo với corpus văn bản pháp luật Việt Nam (ví dụ: phapdien.moj.gov.vn).
  • —Topic classification · Phân loại chủ đề — lv_id / lv_name cung cấp giám sát đơn nhãn 29 lớp (chủ đề pháp lý).
  • —Citation extraction / legal-NER — mật độ trích dẫn cao (91 % nhắc Luật, 90 % Điều, 60 % khoản, 38 % Nghị định) giúp bộ ngữ liệu này phù hợp làm tập đánh giá NER cho văn bản pháp luật Việt Nam.

Cấu trúc dữ liệu · Dataset structure

Mẫu bản ghi · Data instance

jsonc
{
  "item_id": 16557,
  "source": "pbgdpl.gov.vn",
  "source_url": "https://pbgdpl.gov.vn/SMPT_Publishing_UC/HoiDapPL/frmDSCauHoi.aspx?ItemID=16557",
  "scraped_at": "2026-05-08T12:50:18+00:00",
  "scrape_run_id": "20260508T121702Z",
  "listing_page": 256,
  "listing_position": 4,
  "is_featured": false,
  "lv_id": 104,
  "lv_name": "Dân sự",
  "title": "Hai lần thế chấp quyền sử dụng đất để đảm bảo cho hai nghĩa vụ",
  "title_listing": "Hai lần thế chấp quyền sử dụng đất…",
  "question_summary_listing": "Bà A vay bà B 200 triệu…",
  "question_text": "Ngày 22/10/2011, bà A vay bà B…",
  "answer_text":   "Người sử dụng đất có quyền thế chấp…",
  "date_sent_raw": "06/07/2012",
  "date_sent": "2012-07-06",
  "sender_name": null,
  "disclaimer": "(Nội dung trả lời chỉ mang tính chất tham khảo)",
  "question_char_len": 375,
  "answer_char_len": 2333,
  "question_word_count": 71,
  "answer_word_count": 491,
  "answer_text_hash": "3a6c0e…",
  "fetch_status": "ok",
  "fetch_error": null
}

Lược đồ trường · Data fields

Trường · FieldKiểu · TypeMô tả · Notes
item_idintKhóa chính · Primary key
sourcestrLuôn là pbgdpl.gov.vn · Always pbgdpl.gov.vn
source_urlstrURL ?ItemID= đúng đã được fetch · Exact URL fetched
scraped_atstrUTC ISO 8601, lúc fetch bản ghi này · Per-record fetch timestamp
scrape_run_idstrUTC YYYYMMDDTHHMMSSZ chung cho tất cả bản ghi cùng đợt · Shared by all records of one crawl run
listing_pageint?Trang ?page=N ban đầu nơi xuất hiện · Which ?page=N the item first appeared on
listing_positionint?Vị trí 1..8 trong trang đó · Slot 1..8 within that page
is_featuredboolCó trong "Câu hỏi được quan tâm" trên homepage · Highlighted on the homepage
lv_id / lv_nameint? / str?Lĩnh vực pháp luật được gán (1 trong 29 chủ đề; có thể null nếu không gán) · Single LinhVuc topic-id and Vietnamese name (one of the 29 active topics; may be null if none was assigned)
titlestrTiêu đề bản ghi (đoạn in nghiêng đậm) · Detail-page bold-italic title block
title_listingstr?Tiêu đề lấy từ trang listing trước khi vào detail · Listing-page title before detail-page enrichment
question_summary_listingstr?Tóm tắt câu hỏi xuất hiện trên trang listing · Question summary as shown on the listing page
question_textstrVăn bản câu hỏi đã làm sạch khoảng trắng · Whitespace-collapsed question body
answer_textstrVăn bản câu trả lời đã làm sạch khoảng trắng · Whitespace-collapsed answer body
date_sent_raw / date_sentstr?"Ngày gửi: dd/MM/yyyy" → ISO YYYY-MM-DD (best-effort)
sender_namestr?Tên người gửi (đã được trang nguồn công khai) · Public sender label as published by the source
disclaimerstr?Thường là "(Nội dung trả lời chỉ mang tính chất tham khảo)" · Typically the for-reference-only disclaimer
question_char_len, answer_char_lenintSố ký tự · Character counts
question_word_count, answer_word_countintSố từ (token theo whitespace) · Whitespace-token counts
answer_text_hashstr?SHA-256 của answer_text. Khóa dedup. · Dedup key
fetch_statusstrMọi bản ghi trong release này đều ok · ok for everything in this release
fetch_errorstr?Mô tả lỗi khi fetch_status khác ok (rỗng cho mọi dòng trong release này) · Failure description when fetch_status is not ok (null for every row in this release)

Splits & configs

ConfigSplitSố dòng · Records
qa (default)train4 593
listingstrain4 593

🇻🇳 Dùng load_dataset("tmquan/pbgdpl-vn-legal-qna") để nạp config Q&A mặc định; truyền name="listings" để có metadata bên listing. — Use load_dataset("tmquan/pbgdpl-vn-legal-qna") for the default Q&A config; pass name="listings" for the listing-side metadata view.

Cách dùng · How to use

python
from datasets import load_dataset

# Cấu hình mặc định: 4 593 cặp Q&A
qa = load_dataset("tmquan/pbgdpl-vn-legal-qna")
print(qa["train"][0])

# Listing-side metadata
listings = load_dataset("tmquan/pbgdpl-vn-legal-qna", name="listings")

# Lọc theo chủ đề (ví dụ: Hình sự)
hinhsu = qa["train"].filter(lambda r: r["lv_name"] == "Hình sự")

# Lấy các bản ghi có viện dẫn primary law
import re
RX = re.compile(r"(Luật|Bộ luật|Nghị định|Thông tư)")
grounded = qa["train"].filter(lambda r: bool(RX.search(r["answer_text"] or "")))

Cách dữ liệu được tạo · How the corpus was built

🇻🇳 Cổng nguồn chỉ phát ra một surface AJAX HTML duy nhất (đã kiểm tra mọi REST / OData / SOAP endpoint thông thường — đều 404 / 403 / không chứa Q&A). Vì vậy crawler là một bộ phân tích HTML-fragment chứ không phải pipeline PDF/OCR. Hai bước:

🇬🇧 The source portal exposes only an AJAX HTML user-control as a public surface (every standard REST / OData / SOAP endpoint we probed either 404'd, 403'd, or returned site infrastructure with no Q&A content). The crawler is therefore an HTML-fragment harvester, not a PDF / OCR pipeline. Two stages:

  • —harvest — đi qua ?page=N và ?lv=ID để có toàn bộ ItemID + cấu trúc lĩnh vực pháp luật. — walk ?page=N and ?lv=ID to get all ItemIDs + LinhVuc taxonomy.
  • —detail — ?ItemID=<id> cho mỗi ItemID, parse → qa.jsonl. — fetch ?ItemID=<id> for every ItemID and parse to qa.jsonl.

🇻🇳 Tốc độ "lịch sự" 2 QPS / 4 worker; toàn bộ ngữ liệu mất ~50 phút. Cache HTML đĩa làm mỗi bước idempotent — chạy lại không tốn mạng.

🇬🇧 Polite envelope: 2 QPS / 4 workers; full corpus run ~50 minutes. On-disk HTML cache makes every stage idempotent — re-runs do not hit the network.

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

🇻🇳 (i) Đã đóng băng từ 2021 — cổng nguồn không công bố thêm Q&A sau ngày 2021-10-20. Một số viện dẫn cũ tham chiếu các đạo luật đã bị thay thế (ví dụ: nhiều câu trả lời "Hôn nhân gia đình" còn viện dẫn Luật Hôn nhân và gia đình 2000 trong khi luật hiện hành là Luật Hôn nhân và gia đình 2014). Không nên dùng để xác định luật hiện hành — bộ ngữ liệu phù hợp cho retrieval, modelling, nghiên cứu lịch sử pháp lý. (ii) Disclaimer: mỗi câu trả lời đều có dòng "Nội dung trả lời chỉ mang tính chất tham khảo"; không thay thế tư vấn pháp lý có thẩm quyền. (iii) Chủ đề lệch: 5 chủ đề lớn nhất chiếm 54 % ngữ liệu; nhiều chủ đề chuyên biệt thưa hoặc rỗng. (iv) Ngày tháng lệch: ba "đợt phát hành" 2012 (964), 2015 (617), 2021 (609) chiếm khoảng nửa ngữ liệu. (v) Tên người gửi nhiễu: trộn cả nick, tên một phần, và các tài khoản tổ chức (Admin Portal (527), MOJ Admin (40)…) — xem mục ethics dưới đây.

🇬🇧 (i) Frozen since 2021 — the source portal stopped publishing new Q&A after 2021-10-20. Older items cite statutes that may have been superseded (e.g. many "Hôn nhân gia đình" answers reference the 2000 Law on Marriage and Family whereas the controlling statute is now the 2014 Law on Marriage and Family). Do not use this corpus to determine current legal rules — use it for retrieval, modelling, historical research only. (ii) Disclaimer: every answer carries the "for reference only" notice; not a substitute for qualified legal counsel. (iii) Topic skew: 54 % of the corpus is the top-5 civil-law topics; niche legal areas are sparse or absent. (iv) Temporal skew: three publishing waves (2012: 964, 2015: 617, 2021: 609) account for ~half the corpus. (v) Sender field is noisy: pseudonyms, partial names, and aggregate accounts mix together (Admin Portal (527), MOJ Admin (40), …) — see the ethics block below.

Riêng tư & đạo đức · Personal / sensitive information

🇻🇳 sender_name là nhãn người gửi đã được cổng nguồn công khai. ~93 % bản ghi (4 291 / 4 593) có nhãn không rỗng; có 3 371 giá trị khác nhau, đa phần là tên người Việt thật. Các tên này đã công khai trên pbgdpl.gov.vn (do trang nguồn chọn công khai), nhưng người dùng tải về vẫn nên coi là PII nhạy cảm thấp và ưu tiên các view gộp / dẫn xuất hơn là phơi bày từng dòng nếu có thể. Bộ dữ liệu giữ nguyên trường này để bạn có thể audit và tự quyết định ẩn danh hoá.

🇬🇧 sender_name is the public sender label as published by the source portal. About 93 % of records (4 291 / 4 593) have a non-empty sender name; 3 371 distinct values appear, mostly real-looking Vietnamese person names. These names are already public on pbgdpl.gov.vn — the source chose to publish them — but downstream consumers should still treat them as low-sensitivity PII and prefer derived/aggregated views over per-row exposure where practical. The dataset preserves the field verbatim so users can audit and make their own redaction decisions.

🇻🇳 Nếu bạn xây dataset dẫn xuất và muốn ẩn danh người gửi, hãy bỏ hoặc hash cột sender_name. — If you build a derivative dataset and want to redact senders, drop or hash the sender_name column.

Giấy phép · License

🇻🇳 Nội dung gốc do Bộ Tư pháp công bố trên cổng pbgdpl.gov.vn (tài liệu công cộng, miễn phí, không có giấy phép mở chính thức). Bản phân phối lại này được chia sẻ với giấy phép `other` (Vietnamese government public Q&A) kèm các kỳ vọng tối thiểu sau:

🇬🇧 Source content is published by Bộ Tư pháp on the public portal pbgdpl.gov.vn (government work for public information). The portal places no explicit reuse restriction on the Q&A items, but no formal open-data license is published. We therefore distribute under `other` (Vietnamese government public Q&A) with the following non-exclusive expectations:

  1. 1.Ghi nhận nguồn / Attribute the source (pbgdpl.gov.vn, Bộ Tư pháp) trong mọi dataset / publication dẫn xuất.
  2. 2.Giữ disclaimer gốc / Preserve the source disclaimer ("Nội dung trả lời chỉ mang tính chất tham khảo") khi tái phân phối text trả lời — không trình bày như tư vấn pháp lý có thẩm quyền.
  3. 3.Coi `sender_name` là PII nhạy cảm thấp / Treat `sender_name` as low-sensitivity PII như đã thảo luận ở trên.
  4. 4.Không tái phân phối với giấy phép thoáng hơn / Do not redistribute under a more permissive license (CC-BY / MIT…); hãy giữ nguyên thông báo này.
  5. 5.Tuân thủ pháp luật Việt Nam / Use is subject to applicable Vietnamese law và điều khoản sử dụng của trang nguồn.

Trích dẫn · Citation

bibtex
@misc{pbgdpl_2026,
  title        = {pbgdpl.gov.vn — Vietnamese Legal Q\&A Corpus},
  author       = {TMQuan},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/datasets/tmquan/pbgdpl-vn-legal-qna}},
  note         = {Article-level mirror of Vietnam's public Hỏi đáp pháp luật corpus, with topic taxonomy and citation-density metadata.}
}

@misc{pbgdpl_moj_2026,
  title        = {Hỏi đáp pháp luật — Cổng thông tin điện tử Phổ biến giáo dục pháp luật},
  author       = {{Ministry of Justice of Vietnam}},
  year         = {2026},
  howpublished = {\url{https://pbgdpl.gov.vn/Pages/hoi-dap-pl.aspx}},
  note         = {Official public legal-education Q\&A surface published by the Ministry of Justice of Vietnam (Bộ Tư pháp).}
}