Datasets:
Search is not available for this dataset
The dataset viewer is not available for this split.
Server error while post-processing the rows. This occured on row 27. Please report the issue.
Error code: RowsPostProcessingError
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.
VBPL.vn — Vietnamese Legal Corpus
Văn bản pháp luật Trung ương Việt Nam crawl từ vbpl.vn — Cơ sở dữ liệu quốc gia về pháp luật, Bộ Tư pháp.
Nguồn
- vbpl.vn (Bộ Tư pháp Việt Nam)
- API:
https://vbpl-bientap-gateway.moj.gov.vn/api - Phạm vi: văn bản cấp Trung ương (Quốc hội, Chính phủ, Bộ ngành...)
Cấu trúc
data/
├── vanban.parquet # Bảng chính: 1 dòng = 1 văn bản (~50 cột)
├── vanban.jsonl # Tương đương vanban.parquet dạng JSONL
├── nodes.jsonl # Nodes cho graph (1 dòng = 1 doc, các trường core)
├── edges.jsonl # Edges cho graph (~37k cạnh từ references metadata)
├── vanban_process.parquet # Sau khi clean text (optional, có khi đã chạy 2_clean)
├── chunks.parquet # Chia theo Điều/Khoản, ~450k chunks (recommend cho query)
├── chunks.jsonl # Same as chunks.parquet, JSONL cho streaming
└── provision_relations.jsonl # PROVISION-level relations (Điều/Khoản bị sửa)
reports/
├── stats_all.md # Báo cáo thống kê toàn corpus
├── stats_<loai>.md # Báo cáo per loại văn bản
├── charts_all/ # PNG biểu đồ
└── charts_<loai>/
Schema vanban.parquet
| Group | Columns |
|---|---|
| Identity | id, so_ky_hieu, title, loai_van_ban, loai_van_ban_code |
| Agency | co_quan_ban_hanh, organization_id, organization_name |
| Dates | ngay_ban_hanh, ngay_co_hieu_luc, ngay_het_hieu_luc (+ _iso variants) |
| Status | tinh_trang_hieu_luc, linh_vuc, nganh, doc_status, lang |
| Flags | is_lw, is_consolidated, is_constitution, is_administrative, ... |
| Relational (JSON) | references_json, document_issues_json, document_related_list_json, provision_tree_json |
| Text | text_clean, has_text |
Schema edges.jsonl (Graph)
Mỗi dòng = 1 relation giữa 2 văn bản:
{
"source_doc_id": "32801",
"source_so_ky_hieu": "Không số",
"target_doc_id": "96118",
"target_so_ky_hieu": "96/2015/QH13",
"target_title": "Luật Trưng cầu ý dân...",
"reference_type": 10,
"relation_type": "CITES",
"source": "meta.references"
}
14 loại relation_type: CITES, AMENDS, REPLACES, REPEALS, BASED_ON, CONSOLIDATES, ...
Sử dụng
import pandas as pd
import json
# Tabular data — 42k VB
df = pd.read_parquet('hf://datasets/Monmoonluna/vbpl-vn-legal-corpus/data/vanban.parquet')
print(df['loai_van_ban'].value_counts())
# Chunks cho RAG — 447k chunks, ~600 token avg
chunks = pd.read_parquet('hf://datasets/Monmoonluna/vbpl-vn-legal-corpus/data/chunks.parquet')
print(f'{len(chunks):,} chunks')
print(chunks[['so_ky_hieu','chunk_type','text']].head(3))
# Build graph từ edges
import networkx as nx
edges = pd.read_json('hf://datasets/Monmoonluna/vbpl-vn-legal-corpus/data/edges.jsonl', lines=True)
G = nx.DiGraph()
for _, e in edges.iterrows():
G.add_edge(e['source_so_ky_hieu'], e['target_so_ky_hieu'],
relation=e['relation_type'])
print(f'Graph: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges')
# Hoặc parse references inline từ vanban.parquet
df['refs'] = df['references_json'].apply(lambda s: json.loads(s) if s else [])
Pipeline code
Code crawl + xử lý đầy đủ tại: https://github.com/Monmoonluna/LEGALSEARCHVN_LOCALAI
Licence
Văn bản pháp luật Việt Nam thuộc public domain. Phần code + script được phát hành theo CC-BY-SA-4.0.
- Downloads last month
- 80