renzzyyy1028/civil-code-phil
Civilex — Philippine Legal RAG & SFT Dataset Retrieval corpus and supervised fine-tuning (SFT) data for a retrieval-augmented generation (RAG) pipeline over Philippine law: the Civil Code (Republic Act No. 386) and Supreme Court jurisprudence. Produced by the civilex-thesis research pipeline. Contents: 11k+ Supreme Court jurisprudence cases spanning 1949–2025, and 2,270 articles from the Civil Code (Republic Act No. 386). Dataset structure . ├── README.md ├──… See the full description on the dataset page: https://huggingface.co/datasets/renzzyyy1028/civil-code-phil.
Civilex — Philippine Legal RAG & SFT Dataset
Retrieval corpus and supervised fine-tuning (SFT) data for a retrieval-augmented generation (RAG) pipeline over Philippine law: the Civil Code (Republic Act No. 386) and Supreme Court jurisprudence. Produced by the civilex-thesis research pipeline.
Contents: 11k+ Supreme Court jurisprudence cases spanning 1949–2025, and 2,270 articles from the Civil Code (Republic Act No. 386).
Dataset structure
.
├── README.md
├── civil_code_rag.jsonl # Civil Code articles + hierarchy + citation linkage
├── jurisprudence_chunks.jsonl # RAG-ready chunks of Supreme Court decisions
├── jurisprudence_document.jsonl # Full Supreme Court decisions (one row per case)
├── article_case_index.json # Auxiliary: article → case citation index (dict, not a table)
└── training/
├── train_clean.jsonl # SFT chat examples (train)
└── eval.jsonl # SFT chat examples (validation)Subsets (configs)
Data fields
civil_code
jurisprudence_chunks
jurisprudence_documents
training
article_case_index.json (auxiliary, not a config)
Top-level dict (not a table): {article_id: {total_jurisprudence_citations, top_cases, ...}}. Not loadable via load_dataset configs — load it directly:
import json
index = json.load(open("article_case_index.json"))Usage
from datasets import load_dataset
civil_code = load_dataset("<org>/<repo>", "civil_code")["train"]
chunks = load_dataset("<org>/<repo>", "jurisprudence_chunks")["train"]
cases = load_dataset("<org>/<repo>", "jurisprudence_documents")["train"]
sft_train = load_dataset("<org>/<repo>", "training")["train"]
sft_eval = load_dataset("<org>/<repo>", "training")["validation"]Join path for RAG: jurisprudence_chunks.case_uid → jurisprudence_documents.case_uid, and jurisprudence_chunks.civil_code_articles → civil_code.article_number.
Dataset creation
- Statutes: Civil Code of the Philippines (Republic Act No. 386), structured into articles with hierarchy.
- Jurisprudence: Supreme Court decisions sourced from lawphil.net, chunked and annotated with topic labels and Civil Code citations.
- Training data: chat-format examples generated from the corpus for plain-language legal explanation (research use,
civilex-thesispipeline).
Considerations for using the data
- Not legal advice. This is a research corpus for a student thesis; annotations, summaries, and SFT outputs are machine-generated and may contain errors.
- Coverage is limited to the Civil Code and the scraped jurisprudence subset — not a complete corpus of Philippine law.
- Bias: topic labels and summaries are produced by automated pipelines; verify against the source
urlbefore relying on any record. - Privacy: decisions are public court records; case names appear as published.
License
Dataset documentation and annotations: CC BY 4.0. Underlying statutes are laws of the Philippines; court decisions are public records sourced from lawphil.net. Attribution: Civilex thesis research project.
