Datasets:
Tasks:
Text Generation
Formats:
parquet
Sub-tasks:
language-modeling
Languages:
Danish
Size:
1M - 10M
License:
KennethEnevoldsen
commited on
Added Nordjylland News
Browse files
data/nordjyllandnews/create.py
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
This scripts download nordjylland news and converts it to the format of danish dynaword
|
3 |
+
"""
|
4 |
+
|
5 |
+
import random
|
6 |
+
from pathlib import Path
|
7 |
+
|
8 |
+
from datasets import load_dataset
|
9 |
+
|
10 |
+
source = "nordjyllandnews"
|
11 |
+
ds = load_dataset("alexandrainst/nordjylland-news-summarization", split="train")
|
12 |
+
|
13 |
+
schemas = [
|
14 |
+
"{summary}\n\n{text}",
|
15 |
+
"{text}\n\nOpsummering:\n{summary}",
|
16 |
+
"{text}\n\nReferat:\n{summary}",
|
17 |
+
"Lav et referat af nedenstående tekst:\n\nTekst:\n{text}\n\nReferat:\n{summary}",
|
18 |
+
]
|
19 |
+
|
20 |
+
|
21 |
+
def convert_sample(example):
|
22 |
+
schema = random.sample(schemas, k=1)[0]
|
23 |
+
|
24 |
+
new_example = dict(
|
25 |
+
text=schema.format(text=example["text"], summary=example["summary"]),
|
26 |
+
source=source,
|
27 |
+
domain="News",
|
28 |
+
license="Creative Commons Legal Code\n\nCC0 1.0 Universal",
|
29 |
+
added="2024-12-16",
|
30 |
+
created="2000-01-01, 2024-01-01", # best guess
|
31 |
+
metadata=dict(source_pretty="Nordjylland News"),
|
32 |
+
)
|
33 |
+
|
34 |
+
return new_example
|
35 |
+
|
36 |
+
|
37 |
+
ds = ds.map(convert_sample)
|
38 |
+
|
39 |
+
save_path = Path(__file__).parent / f"{source}.parquet"
|
40 |
+
ds.to_parquet(save_path)
|
data/nordjyllandnews/nordjyllandnews.md
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
pretty_name: Nordjylland News
|
3 |
+
language:
|
4 |
+
- da
|
5 |
+
license: cc0-1.0
|
6 |
+
license_name: Creative Commons Zero v1.0 Universal
|
7 |
+
size_categories:
|
8 |
+
- 10-100k
|
9 |
+
task_categories:
|
10 |
+
- text-generation
|
11 |
+
- fill-mask
|
12 |
+
task_ids:
|
13 |
+
- language-modeling
|
14 |
+
---
|
15 |
+
|
16 |
+
# Dataset Card for Nordjylland News
|
17 |
+
|
18 |
+
source: https://huggingface.co/datasets/alexandrainst/nordjylland-news-summarization
|
19 |
+
|
20 |
+
## Dataset Description
|
21 |
+
- **Number of records:** 75200
|
22 |
+
- **Languages:** Danish
|
23 |
+
|
24 |
+
## Opportunities for Improvement
|
25 |
+
|
26 |
+
An updated version of the this data could be fetched from their [API](https://developer.bazo.dk/#876ab6f9-e057-43e3-897a-1563de34397e).
|
27 |
+
|
28 |
+
# Sourced data
|
29 |
+
This dataset is derived from [`alexandrainst/nordjylland-news-summarization`](https://huggingface.co/datasets/alexandrainst/nordjylland-news-summarization)
|
data/nordjyllandnews/nordjyllandnews.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:438950abf3c8b922fabf84caa08f4b9df170b0e1e6606c071a721dd21323cfe3
|
3 |
+
size 78048869
|