Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,141 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Philippine Legal Documents Dataset
|
| 2 |
+
|
| 3 |
+
A comprehensive collection of Philippine legal documents from Lawphil.net, extracted from HTML to Markdown and organized for easy querying.
|
| 4 |
+
|
| 5 |
+
## Overview
|
| 6 |
+
|
| 7 |
+
This dataset contains **114,340** legal documents spanning from 1900 to 2025, including:
|
| 8 |
+
|
| 9 |
+
- **Jurisprudence** (68,080 documents) - Supreme Court decisions
|
| 10 |
+
- **Statutes** (19,793 documents) - Republic Acts, Commonwealth Acts, Presidential Decrees, etc.
|
| 11 |
+
- **Executive Issuances** (26,458 documents) - Administrative Orders, Executive Orders, Memorandum Orders, etc.
|
| 12 |
+
- **Constitutions** (9 documents) - Philippine constitutions from different periods
|
| 13 |
+
|
| 14 |
+
## Categories
|
| 15 |
+
|
| 16 |
+
| Category | Description | Sources |
|
| 17 |
+
|----------|-------------|---------|
|
| 18 |
+
| `juris` | Supreme Court decisions and jurisprudence | `juris` |
|
| 19 |
+
| `statutes` | Legislative acts and statutes | `acts`, `repacts`, `comacts`, `bataspam`, `presdecs` |
|
| 20 |
+
| `executive` | Executive issuances and orders | `ao`, `execord`, `mo`, `mc`, `proc`, `genor` |
|
| 21 |
+
| `consti` | Philippine constitutions | `consti` |
|
| 22 |
+
|
| 23 |
+
### Source Details
|
| 24 |
+
|
| 25 |
+
| Source | Description | Years | Count |
|
| 26 |
+
|--------|-------------|-------|-------|
|
| 27 |
+
| `juris` | Jurisprudence / Supreme Court decisions | 1901-2025 | 68,080 |
|
| 28 |
+
| `acts` | Acts of the Philippine Commission/Assembly | 1900-1935 | 4,257 |
|
| 29 |
+
| `repacts` | Republic Acts | 1946-2025 | 12,071 |
|
| 30 |
+
| `comacts` | Commonwealth Acts | 1935-1946 | 733 |
|
| 31 |
+
| `bataspam` | Batas Pambansa | 1978-1994 | 887 |
|
| 32 |
+
| `presdecs` | Presidential Decrees | 1972-1986 | 1,845 |
|
| 33 |
+
| `ao` | Administrative Orders | 1936-2025 | 2,811 |
|
| 34 |
+
| `execord` | Executive Orders | 1900s-2020s | 5,750 |
|
| 35 |
+
| `mo` | Memorandum Orders | 1900s-2020s | 2,401 |
|
| 36 |
+
| `mc` | Memorandum Circulars | 1900s-2020s | 2,220 |
|
| 37 |
+
| `proc` | Proclamations | 1901-2020s | 13,195 |
|
| 38 |
+
| `genor` | General Orders | 81 | |
|
| 39 |
+
| `consti` | Constitutions | 1902, 1916, 1935, 1943, 1973, 1986, 1987 | 9 |
|
| 40 |
+
|
| 41 |
+
## Usage
|
| 42 |
+
|
| 43 |
+
### Loading the Dataset
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
import pandas as pd
|
| 47 |
+
|
| 48 |
+
# Load the consolidated dataset
|
| 49 |
+
df = pd.read_parquet("lawphil_consolidated.parquet")
|
| 50 |
+
|
| 51 |
+
print(f"Total documents: {len(df):,}")
|
| 52 |
+
print(f"Columns: {df.columns.tolist()}")
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
### Filtering by Category
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
# Get all statutes
|
| 59 |
+
statutes = df[df['category'] == 'statutes']
|
| 60 |
+
|
| 61 |
+
# Get all jurisprudence
|
| 62 |
+
jurisprudence = df[df['category'] == 'juris']
|
| 63 |
+
|
| 64 |
+
# Get all executive issuances
|
| 65 |
+
executive = df[df['category'] == 'executive']
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
### Filtering by Source
|
| 69 |
+
|
| 70 |
+
```python
|
| 71 |
+
# Get only Republic Acts
|
| 72 |
+
ra = df[df['source'] == 'repacts']
|
| 73 |
+
|
| 74 |
+
# Get only Executive Orders
|
| 75 |
+
eo = df[df['source'] == 'execord']
|
| 76 |
+
|
| 77 |
+
# Get only Administrative Orders
|
| 78 |
+
ao = df[df['source'] == 'ao']
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
### Filtering by Year
|
| 82 |
+
|
| 83 |
+
```python
|
| 84 |
+
# Get documents from a specific year
|
| 85 |
+
docs_2020 = df[df['year'] == 2020]
|
| 86 |
+
|
| 87 |
+
# Get documents from a date range
|
| 88 |
+
docs_2000s = df[(df['year'] >= 2000) & (df['year'] < 2010)]
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
### Reading Document Content
|
| 92 |
+
|
| 93 |
+
```python
|
| 94 |
+
# Get a specific document
|
| 95 |
+
doc = df.iloc[0]
|
| 96 |
+
|
| 97 |
+
print(f"Title: {doc['title']}")
|
| 98 |
+
print(f"Source: {doc['source']}")
|
| 99 |
+
print(f"Year: {doc['year']}")
|
| 100 |
+
print(f"Path: {doc['path']}")
|
| 101 |
+
print(f"\nContent:\n{doc['content'][:500]}...")
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
### Searching by Keyword
|
| 105 |
+
|
| 106 |
+
```python
|
| 107 |
+
# Search in titles
|
| 108 |
+
results = df[df['title'].str.contains('labor', case=False, na=False)]
|
| 109 |
+
|
| 110 |
+
# Search in content
|
| 111 |
+
results = df[df['content'].str.contains('corruption', case=False, na=False)]
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
## Schema
|
| 115 |
+
|
| 116 |
+
| Column | Type | Description |
|
| 117 |
+
|--------|------|-------------|
|
| 118 |
+
| `id` | string | Unique identifier (format: `{source}:{path}`) |
|
| 119 |
+
| `source` | string | Document source (e.g., `repacts`, `execord`, `juris`) |
|
| 120 |
+
| `category` | string | High-level category (`juris`, `statutes`, `executive`, `consti`) |
|
| 121 |
+
| `year` | int | Year of the document |
|
| 122 |
+
| `month` | int | Month of the document (for jurisprudence only) |
|
| 123 |
+
| `path` | string | File path relative to project root |
|
| 124 |
+
| `basename` | string | Filename without extension |
|
| 125 |
+
| `title` | string | Document title extracted from content |
|
| 126 |
+
| `content` | string | Full markdown content |
|
| 127 |
+
|
| 128 |
+
## Statistics
|
| 129 |
+
|
| 130 |
+
- **Total Documents:** 115,340
|
| 131 |
+
- **Date Range:** 1901-2025
|
| 132 |
+
- **File Size:** 753 MB (consolidated parquet)
|
| 133 |
+
- **Sources:** 14 different legal document types
|
| 134 |
+
|
| 135 |
+
## Data Source
|
| 136 |
+
|
| 137 |
+
Documents were originally sourced from [Lawphil.net](https://lawphil.net), a project of the Arellano Law Foundation.
|
| 138 |
+
|
| 139 |
+
## License
|
| 140 |
+
|
| 141 |
+
The original documents from Lawphil.net are licensed under Creative Commons Attribution-NonCommercial 4.0.
|