Upload 2 files
Browse files- README.md +84 -3
- train.jsonl +0 -0
README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
| 1 |
-
---
|
| 2 |
-
license:
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- eu-law
|
| 7 |
+
- legal
|
| 8 |
+
- gdpr
|
| 9 |
+
- ai-act
|
| 10 |
+
- rag
|
| 11 |
+
- retrieval
|
| 12 |
+
- instruction-tuning
|
| 13 |
+
task_categories:
|
| 14 |
+
- text-generation
|
| 15 |
+
- text-retrieval
|
| 16 |
+
configs:
|
| 17 |
+
- config_name: chunks
|
| 18 |
+
data_files: chunks/train.jsonl
|
| 19 |
+
- config_name: finetuning
|
| 20 |
+
data_files: finetuning/train.jsonl
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# EuropeGram: EU Legal Text -- RAG Chunks & Instruction Data
|
| 24 |
+
|
| 25 |
+
Structured, chunked, and instruction-formatted text derived from official EU
|
| 26 |
+
legislation, built for retrieval-augmented generation (RAG) and LoRA
|
| 27 |
+
fine-tuning experiments comparing Base / RAG / Fine-tuned / Fine-tuned+RAG
|
| 28 |
+
LLM strategies over EU documents. Produced by the EuropeGram project's
|
| 29 |
+
extraction -> chunking -> fine-tuning-export pipeline.
|
| 30 |
+
|
| 31 |
+
## Source documents
|
| 32 |
+
|
| 33 |
+
| Document | CELEX ID | Source | Chunks | Instruction pairs |
|
| 34 |
+
|---|---|---|---|---|
|
| 35 |
+
| Regulation (EU) 2024/1689 (Artificial Intelligence Act) | `32024R1689` | [EUR-Lex](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32024R1689) | 316 | 126 |
|
| 36 |
+
| Regulation (EU) 2016/679 (General Data Protection Regulation) | `32016R0679` | [EUR-Lex](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32016R0679) | 187 | 99 |
|
| 37 |
+
|
| 38 |
+
**Attribution & authenticity notice.** The underlying legal texts are
|
| 39 |
+
reproduced from the official PDF renditions published on EUR-Lex. Reuse of
|
| 40 |
+
EU legislation is permitted free of charge under [Decision
|
| 41 |
+
2011/833/EU](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32011D0833),
|
| 42 |
+
provided the source is acknowledged and the meaning or message of the
|
| 43 |
+
original is not distorted. **Only the versions published in the Official
|
| 44 |
+
Journal of the European Union are authentic and legally binding** -- this
|
| 45 |
+
dataset is a derived, machine-processed artifact for ML research and must
|
| 46 |
+
not be treated as an authoritative legal source.
|
| 47 |
+
|
| 48 |
+
## Configs
|
| 49 |
+
|
| 50 |
+
### `chunks`
|
| 51 |
+
|
| 52 |
+
One row per RAG chunk (structure-aware: packed by article/annex paragraph,
|
| 53 |
+
capped at `max_chars` with `overlap_chars` overlap for long ones -- see
|
| 54 |
+
`europegram.rag.chunker`). Fields:
|
| 55 |
+
|
| 56 |
+
- `id`: chunk id, e.g. `article-4-chunk-0`
|
| 57 |
+
- `text`: chunk text (first chunk of an article/annex is prefixed with its heading)
|
| 58 |
+
- `document_id`, `celex_id`: which source document
|
| 59 |
+
- `ref_type`: `"article"` or `"annex"`
|
| 60 |
+
- `ref_id`: e.g. `"article-4"`, `"annex-viii"`
|
| 61 |
+
- `title`: article/annex title
|
| 62 |
+
- `chapter_number`, `chapter_title`: containing chapter, when applicable (nullable)
|
| 63 |
+
- `page_start`, `page_end`: page span in the source PDF
|
| 64 |
+
- `chunk_index`: position of this chunk within its article/annex (0-based)
|
| 65 |
+
|
| 66 |
+
### `finetuning`
|
| 67 |
+
|
| 68 |
+
One Alpaca-style instruction/output pair per article/annex, for LoRA
|
| 69 |
+
fine-tuning (see `europegram.finetuning.dataset_builder` and
|
| 70 |
+
`colab/finetune_lora.ipynb`). Fields:
|
| 71 |
+
|
| 72 |
+
- `instruction`: natural-language question about one article/annex
|
| 73 |
+
- `input`: always empty (kept for Alpaca-format compatibility)
|
| 74 |
+
- `output`: the article/annex's full text -- the target completion
|
| 75 |
+
- `document_id`, `celex_id`, `ref_id`: provenance, so any model output can be traced back to a specific legal reference
|
| 76 |
+
|
| 77 |
+
## Loading
|
| 78 |
+
|
| 79 |
+
```python
|
| 80 |
+
from datasets import load_dataset
|
| 81 |
+
|
| 82 |
+
chunks = load_dataset("<your-username>/<dataset-name>", "chunks", split="train")
|
| 83 |
+
finetuning = load_dataset("<your-username>/<dataset-name>", "finetuning", split="train")
|
| 84 |
+
```
|
train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|