# korpus_pl_courts v1.0 — evaluation samples

Two evaluation samples drawn from **korpus_pl_courts v1.0**, a corpus of
505,611 Polish court judgments (~3.18 B tokens) built from the full dump
of the SAOS aggregator (https://www.saos.org.pl/). See `DATASHEET.md`
for the full corpus documentation.

| File | Records | Purpose |
|---|---|---|
| `korpus_pl_courts_v1.0_sample_500.jsonl(.gz)` | 500 | quick look |
| `korpus_pl_courts_v1.0_sample_10k.jsonl(.gz)` | 10,000 | serious evaluation |

## How the samples were drawn

Stratified random sampling, fully reproducible (`random.seed(42)`,
deterministic iteration order; script: `tools/make_samples.py`):

1. records allocated across court types in corpus proportions
   (~86.3% common courts, ~7.5% Supreme Court, ~4.4% National Appeal
   Chamber, ~1.8% Constitutional Tribunal; largest-remainder method),
2. within each court type, allocation across [year bucket ×
   has-reasoning-section] cells in corpus proportions — so the year
   spread (1986–2026) and the ~76% share of records with an
   UZASADNIENIE section match the full corpus,
3. **the two samples are disjoint** — the 500-record sample is NOT a
   subset of the 10k sample; no record appears in both.

Both samples passed the same release gate as the full corpus: zero
residual-PII pattern hits, line-by-line JSON validation.

## Record schema

Each line is one JSON object with 17 fields (`id`, `sections`, `court`,
`division`, `court_type`, `judgment_type`, `judgment_date`,
`docket_numbers`, `judges`, `keywords`, `legal_bases`, `language`,
`tokens_est`, `anon_count`, `pii_masked_count`, `source_url`, `license`,
`hash`). Full field documentation: `DATASHEET.md`.

### Reconstructing the full text

The document text is stored once, in `sections`. Reconstruct it
deterministically — headers become standalone lines, sections are
separated by a blank line:

```python
def build_text(sections):
    parts = []
    for s in sections:
        parts.append(f"{s['header']}\n{s['text']}" if s["header"] else s["text"])
    return "\n\n".join(parts)
```

Verify integrity: `tokens_est == len(build_text(sections)) / 3.5` and
`hash` is the SHA-256 hex digest of that text lowercased with whitespace
collapsed (`" ".join(text.lower().split())`).

## Legal status

Under Article 4 of the Polish Copyright Act, court judgments are
official materials not subject to copyright; see `DATASHEET.md` for the
personal-data discussion. Sample usage terms: `LICENSE_SAMPLE.txt`.

## Contact

Licensing and full-corpus access: **licensing@aioil.ai**
