KennethEnevoldsen commited on
Commit
4a05531
·
unverified ·
2 Parent(s): ade7725 8e1237a

Merge branch 'nordjyllandnews' into pr/15

Browse files
README.md CHANGED
@@ -81,6 +81,10 @@ configs:
81
  data_files:
82
  - split: train
83
  path: data/wiki/*.parquet
 
 
 
 
84
  - config_name: relig
85
  data_files:
86
  - split: train
 
81
  data_files:
82
  - split: train
83
  path: data/wiki/*.parquet
84
+ - config_name: nordjyllandnews
85
+ data_files:
86
+ - split: train
87
+ path: data/nordjyllandnews/*.parquet
88
  - config_name: relig
89
  data_files:
90
  - split: train
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