Datasets:
Upload folder using huggingface_hub
Browse files- .gitattributes +2 -0
- README.md +71 -3
- data/train.jsonl +3 -0
- dataset_config.json +36 -0
- meta/discovery_cache/discovered_documents_20250928_195619.json +3 -0
- meta/phase_status.json +7 -0
.gitattributes
CHANGED
|
@@ -57,3 +57,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 57 |
# Video files - compressed
|
| 58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 57 |
# Video files - compressed
|
| 58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
data/train.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
meta/discovery_cache/discovered_documents_20250928_195619.json filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,71 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UK Legislation Dataset
|
| 2 |
+
|
| 3 |
+
This directory packages scraped UK legislation into a layout that can be ingested directly with the Hugging Face `datasets` library. All documents live in JSON Lines format inside `data/` with one piece of legislation per line. The schema captures both plain-text and XML renderings, along with document-level metadata and section breakdowns.
|
| 4 |
+
|
| 5 |
+
## Repository Layout
|
| 6 |
+
|
| 7 |
+
- `data/train.jsonl` – full corpus of 175,515 documents ready for `load_dataset`.
|
| 8 |
+
- `meta/` – auxiliary files that describe the scrape workflow and provenance.
|
| 9 |
+
- `dataset_config.json` – declarative configuration that mirrors the `load_dataset` arguments used during training.
|
| 10 |
+
|
| 11 |
+
## Data Fields
|
| 12 |
+
|
| 13 |
+
Every record is a JSON object with the following keys:
|
| 14 |
+
|
| 15 |
+
- `id` (`string`): canonical legislation identifier, e.g. `ukpga_2025_23`.
|
| 16 |
+
- `title` (`string`): preferred title.
|
| 17 |
+
- `type` (`string`): legislation class (`ukpga`, `uksi`, etc.).
|
| 18 |
+
- `year` (`int`): legislation year.
|
| 19 |
+
- `number` (`int`): act or statutory instrument number within the year.
|
| 20 |
+
- `text_content` (`string`): consolidated plain-text content.
|
| 21 |
+
- `xml_content` (`string`): raw XML body as served by legislation.gov.uk.
|
| 22 |
+
- `publication_date`, `enacted_date`, `coming_into_force_date` (`string`): ISO dates when known.
|
| 23 |
+
- `extent` (`array[string]`): geographic extent codes.
|
| 24 |
+
- `status` (`string`): legislation status (`In Force`, `Prospective`, etc.).
|
| 25 |
+
- `sections` (`array[object]`): ordered section data with `id`, `number`, `title`, `content` fields per section.
|
| 26 |
+
- `metadata` (`object`): scraped metadata such as `classification` and `title`.
|
| 27 |
+
- `url` (`string`): source URL.
|
| 28 |
+
- `checksum` (`string`): SHA1 checksum of the XML payload.
|
| 29 |
+
|
| 30 |
+
## Loading With `datasets`
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from datasets import load_dataset
|
| 34 |
+
|
| 35 |
+
dataset = load_dataset(
|
| 36 |
+
"json",
|
| 37 |
+
data_files={"train": "data/train.jsonl"},
|
| 38 |
+
features={
|
| 39 |
+
"id": "string",
|
| 40 |
+
"title": "string",
|
| 41 |
+
"type": "string",
|
| 42 |
+
"year": "int32",
|
| 43 |
+
"number": "int32",
|
| 44 |
+
"text_content": "string",
|
| 45 |
+
"xml_content": "string",
|
| 46 |
+
"publication_date": "string",
|
| 47 |
+
"enacted_date": "string",
|
| 48 |
+
"coming_into_force_date": "string",
|
| 49 |
+
"extent": ["string"],
|
| 50 |
+
"status": "string",
|
| 51 |
+
"sections": [{
|
| 52 |
+
"id": "string",
|
| 53 |
+
"number": "string",
|
| 54 |
+
"title": "string",
|
| 55 |
+
"content": "string",
|
| 56 |
+
}],
|
| 57 |
+
"metadata": {
|
| 58 |
+
"classification": "string",
|
| 59 |
+
"title": "string",
|
| 60 |
+
},
|
| 61 |
+
"url": "string",
|
| 62 |
+
"checksum": "string",
|
| 63 |
+
},
|
| 64 |
+
)
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
You can further split the dataset with the usual `train_test_split` utilities or by sharding `train.jsonl` into additional files.
|
| 68 |
+
|
| 69 |
+
## Provenance & Licensing
|
| 70 |
+
|
| 71 |
+
The dataset originates from legislation.gov.uk. Legislative content is generally covered by the UK Open Government Licence v3.0, but confirm applicability to your downstream use-case.
|
data/train.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eac5375c52cce2121a3d95d0c0ecd4165f132a8c9b7a549e89a0a18686c732b2
|
| 3 |
+
size 13119988636
|
dataset_config.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset_type": "json",
|
| 3 |
+
"data_files": {
|
| 4 |
+
"train": "data/train.jsonl"
|
| 5 |
+
},
|
| 6 |
+
"features": {
|
| 7 |
+
"id": "string",
|
| 8 |
+
"title": "string",
|
| 9 |
+
"type": "string",
|
| 10 |
+
"year": "int32",
|
| 11 |
+
"number": "int32",
|
| 12 |
+
"text_content": "string",
|
| 13 |
+
"xml_content": "string",
|
| 14 |
+
"publication_date": "string",
|
| 15 |
+
"enacted_date": "string",
|
| 16 |
+
"coming_into_force_date": "string",
|
| 17 |
+
"extent": [
|
| 18 |
+
"string"
|
| 19 |
+
],
|
| 20 |
+
"status": "string",
|
| 21 |
+
"sections": [
|
| 22 |
+
{
|
| 23 |
+
"id": "string",
|
| 24 |
+
"number": "string",
|
| 25 |
+
"title": "string",
|
| 26 |
+
"content": "string"
|
| 27 |
+
}
|
| 28 |
+
],
|
| 29 |
+
"metadata": {
|
| 30 |
+
"classification": "string",
|
| 31 |
+
"title": "string"
|
| 32 |
+
},
|
| 33 |
+
"url": "string",
|
| 34 |
+
"checksum": "string"
|
| 35 |
+
}
|
| 36 |
+
}
|
meta/discovery_cache/discovered_documents_20250928_195619.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cdb379ee7535f334b89b4856f81cfcf8fd38a592a28193ddfe6669b568c5f657
|
| 3 |
+
size 54817286
|
meta/phase_status.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"completed_phases": [
|
| 3 |
+
"discovery",
|
| 4 |
+
"scraping"
|
| 5 |
+
],
|
| 6 |
+
"last_updated": "2025-09-28T19:56:21.226744"
|
| 7 |
+
}
|