4. Mô hình dữ liệu 5 bảng và kiểm chuẩn toàn cục (25.000 bài)

4. Mô hình dữ liệu 5 bảng và kiểm chuẩn toàn cục (25.000 bài)#

4.1 Cấu trúc 5 bảng M1-M2 và kết quả validate_project#

Toàn bộ dữ liệu hợp nhất của 5 thành viên gồm 2 bảng M1 (papers, references) và 3 bảng M2 (elements, hierarchy, bibtex) được kiểm tra đồng thời bởi src/parser/validation.py bằng SQLite key-index trên đĩa cho toàn bộ 25.000 bài báo / 41.498 version.

Hide code cell source

from pathlib import Path
import json
import pandas as pd
import matplotlib.pyplot as plt
from IPython.display import display, Markdown
data = json.loads((Path.cwd().parent / 'report_summary.json').read_text(encoding='utf-8'))
scope, m1, m2, bench = data['scope'], data['m1'], data['m2'], data['m2_benchmark']
plt.rcParams.update({'figure.figsize': (9.2, 4.2), 'axes.spines.top': False, 'axes.spines.right': False, 'figure.dpi': 120})
print(f"Toàn nhóm (5 thành viên): {scope['papers']:,} paper / {scope['versions']:,} version | Cập nhật: {data['report_date']}")
Toàn nhóm (5 thành viên): 25,000 paper / 41,498 version | Cập nhật: 2026-11-22

Hide code cell source

for name, rows in m1['schemas'].items():
    display(Markdown(f"**Schema bảng `{name}`**"))
    display(pd.DataFrame(rows))
row_summary = pd.DataFrame([
    {'Giai đoạn': 'M1', 'Bảng': 'papers (course)', 'Số dòng': scope['papers']},
    {'Giai đoạn': 'M1', 'Bảng': 'references (course)', 'Số dòng': m1['arxiv_reference_rows']},
    {'Giai đoạn': 'M2', 'Bảng': 'elements', 'Số dòng': m2['rows']['elements']},
    {'Giai đoạn': 'M2', 'Bảng': 'hierarchy', 'Số dòng': m2['rows']['hierarchy']},
    {'Giai đoạn': 'M2', 'Bảng': 'bibtex', 'Số dòng': m2['rows']['bibtex']},
])
display(Markdown('**Bảng 4.1. Tổng số bản ghi của 5 bảng hợp nhất (25.000 bài).**'))
display(row_summary)
display(pd.DataFrame([{
    'structural_valid': m2['structural_valid'],
    'processing_complete': m2['processing_complete'],
    'expected_versions': scope['versions'],
    'recorded_versions': scope['versions'],
    'missing_versions': m2['missing_versions'],
    'validation_errors': len(m2['validation_errors']),
}]))

Schema bảng papers

column type nullable
0 arxiv_id string False
1 title string True
2 authors list<element: string> True
3 submission_date string True
4 revised_dates list<element: string> True
5 venue string True

Schema bảng references

column type nullable
0 arxiv_id string False
1 ref_arxiv_id string False
2 ref_title string True
3 ref_authors list<element: string> True
4 ref_submission_date string True
5 ref_s2_id string True

Schema bảng elements

column type nullable
0 element_id string False
1 arxiv_id string False
2 kind dictionary<values=string, indices=int32, order... True
3 content string True

Schema bảng hierarchy

column type nullable
0 arxiv_id string False
1 version int32 True
2 element_id string False
3 parent_id string False

Schema bảng bibtex

column type nullable
0 arxiv_id string False
1 citation_key string False
2 entry_type dictionary<values=string, indices=int32, order... True
3 title string True
4 authors list<item: string> True
5 year int32 True
6 doi string True
7 journal string True
8 url string True

Bảng 4.1. Tổng số bản ghi của 5 bảng hợp nhất (25.000 bài).

Giai đoạn Bảng Số dòng
0 M1 papers (course) 25000
1 M1 references (course) 456149
2 M2 elements 15006000
3 M2 hierarchy 22532299
4 M2 bibtex 1177293
structural_valid processing_complete expected_versions recorded_versions missing_versions validation_errors
0 True False 41498 41498 0 0

Tài liệu và mã nguồn tham chiếu#