Datasets:
Tasks:
Text Generation
Formats:
parquet
Sub-tasks:
language-modeling
Languages:
Danish
Size:
1M - 10M
License:
KennethEnevoldsen
commited on
Added outline for dataset schema test
Browse files- tests/test_dataset_schema.py +29 -0
- tests/test_load.py +1 -0
tests/test_dataset_schema.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# from datetime import date
|
2 |
+
# from typing import Any
|
3 |
+
|
4 |
+
# from pydantic import BaseModel
|
5 |
+
|
6 |
+
# # {
|
7 |
+
# # "text": "SAMLEDE VÆRKER\n\nJEPPE AAKJÆR GYLDENDALSKE BOGHANDEL...",
|
8 |
+
# # "source": "adl",
|
9 |
+
# # "id": "adl_aakjaer06val",
|
10 |
+
# # "added": "2020-09-14",
|
11 |
+
# # "created": "1700-01-01, 2022-01-01",
|
12 |
+
# # "license": "Creative Commons Legal Code\n\nCC0 1.0 Universal",
|
13 |
+
# # "domain": "Wiki & Books",
|
14 |
+
# # "metadata": {"source-pretty": "Archive for Danish Literature"},
|
15 |
+
# # }
|
16 |
+
|
17 |
+
|
18 |
+
# class Dataset(BaseModel):
|
19 |
+
# text: str
|
20 |
+
# source: str
|
21 |
+
# id: str
|
22 |
+
# added: date # date.fromisoformat
|
23 |
+
# created: tuple[date, date]
|
24 |
+
# license: str # TODO: should probably be a literal
|
25 |
+
# domain: str # TODO: convert to literal
|
26 |
+
# metadata: dict[str, Any]
|
27 |
+
|
28 |
+
# def metadata_validator(cls):
|
29 |
+
# assert "source-pretty" in cls.metadata
|
tests/test_load.py
CHANGED
@@ -20,3 +20,4 @@ def test_dataset_loads():
|
|
20 |
|
21 |
# for dataset in datasets:
|
22 |
# assert dataset in configs
|
|
|
|
20 |
|
21 |
# for dataset in datasets:
|
22 |
# assert dataset in configs
|
23 |
+
|