Datasets:
Tasks:
Text Generation
Formats:
parquet
Sub-tasks:
language-modeling
Languages:
Danish
Size:
10M - 100M
ArXiv:
DOI:
License:
Adding Scrape Hovedstaden (#70)
Browse files- Adding the scrape_hovedstaden data (78cc135f92c8c12ee8ba131d1a03befc5c78477d)
- Fixing minor things after reviews (23d4959512fd74b1faa5450f25c10953c7a7cf60)
- Merge branch 'main' into pr/70 (8e2259b9aaa48bb3950b8b4111d10a92ba834459)
- Bump version and add changelog. (a3551d1c007c0f9d886ab8db3d1cc70c4dec107c)
- CHANGELOG.md +7 -0
- README.md +47 -41
- data/scrape_hovedstaden/create.py +76 -0
- data/scrape_hovedstaden/descriptive_stats.json +6 -0
- data/scrape_hovedstaden/images/dist_document_length.png +3 -0
- data/scrape_hovedstaden/scrape_hovedstaden.md +98 -0
- data/scrape_hovedstaden/scrape_hovedstaden.parquet +3 -0
- descriptive_stats.json +4 -4
- images/dist_document_length.png +2 -2
- images/domain_distribution.png +2 -2
- pyproject.toml +1 -1
- src/dynaword/typings.py +1 -0
- test_results.log +10 -10
- uv.lock +1 -1
CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
| 5 |
|
| 6 |
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
## [v1.2.1] - 2025-06-24
|
| 9 |
|
| 10 |
### Fixed
|
|
|
|
| 5 |
|
| 6 |
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
| 7 |
|
| 8 |
+
## [v1.2.2] - 2025-06-26
|
| 9 |
+
|
| 10 |
+
### Added
|
| 11 |
+
|
| 12 |
+
- Added the new `scrape_hovedstaden` dataset.
|
| 13 |
+
- Added a new domain type `Medical`.
|
| 14 |
+
|
| 15 |
## [v1.2.1] - 2025-06-24
|
| 16 |
|
| 17 |
### Fixed
|
README.md
CHANGED
|
@@ -141,6 +141,10 @@ configs:
|
|
| 141 |
data_files:
|
| 142 |
- split: train
|
| 143 |
path: data/nota/*.parquet
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
annotations_creators:
|
| 145 |
- no-annotation
|
| 146 |
language_creators:
|
|
@@ -174,7 +178,7 @@ https://github.com/huggingface/datasets/blob/main/templates/README_guide.md
|
|
| 174 |
<!-- START README TABLE -->
|
| 175 |
| | |
|
| 176 |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 177 |
-
| **Version** | 1.2.
|
| 178 |
| **Language** | dan, dansk, Danish |
|
| 179 |
| **License** | Openly Licensed, See the respective dataset |
|
| 180 |
| **Models** | For model trained used this data see [danish-foundation-models](https://huggingface.co/danish-foundation-models) |
|
|
@@ -211,9 +215,9 @@ https://github.com/huggingface/datasets/blob/main/templates/README_guide.md
|
|
| 211 |
|
| 212 |
<!-- START-DESC-STATS -->
|
| 213 |
- **Language**: dan, dansk, Danish
|
| 214 |
-
- **Number of samples**:
|
| 215 |
-
- **Number of tokens (Llama 3)**: 4.
|
| 216 |
-
- **Average document length (characters)**:
|
| 217 |
<!-- END-DESC-STATS -->
|
| 218 |
|
| 219 |
|
|
@@ -311,43 +315,44 @@ This data generally contains no annotation besides the metadata attached to each
|
|
| 311 |
Below follows a brief overview of the sources in the corpus along with their individual license.
|
| 312 |
|
| 313 |
<!-- START-MAIN TABLE -->
|
| 314 |
-
| Source
|
| 315 |
-
|
| 316 |
-
| [cellar]
|
| 317 |
-
| [ncc_books]
|
| 318 |
-
| [retsinformationdk]
|
| 319 |
-
| [hest]
|
| 320 |
-
| [ncc_parliament]
|
| 321 |
-
| [opensubtitles]
|
| 322 |
-
| [ai-aktindsigt]
|
| 323 |
-
| [miljoeportalen]
|
| 324 |
-
| [skat]
|
| 325 |
-
| [wiki]
|
| 326 |
-
| [ft]
|
| 327 |
-
| [memo]
|
| 328 |
-
| [ep]
|
| 329 |
-
| [adl]
|
| 330 |
-
| [retspraksis]
|
| 331 |
-
| [fm-udgivelser]
|
| 332 |
-
| [nordjyllandnews]
|
| 333 |
-
| [eur-lex-sum-da]
|
| 334 |
-
| [ncc_maalfrid]
|
| 335 |
-
| [
|
| 336 |
-
| [
|
| 337 |
-
| [
|
| 338 |
-
| [
|
| 339 |
-
| [
|
| 340 |
-
| [
|
| 341 |
-
| [
|
| 342 |
-
| [
|
| 343 |
-
| [
|
| 344 |
-
| [
|
| 345 |
-
| [
|
| 346 |
-
| [
|
| 347 |
-
| [
|
| 348 |
-
| [
|
| 349 |
-
| [
|
| 350 |
-
|
|
|
|
|
| 351 |
|
| 352 |
[ai-aktindsigt]: data/ai-aktindsigt/ai-aktindsigt.md
|
| 353 |
[cellar]: data/cellar/cellar.md
|
|
@@ -383,6 +388,7 @@ Below follows a brief overview of the sources in the corpus along with their ind
|
|
| 383 |
[nordjyllandnews]: data/nordjyllandnews/nordjyllandnews.md
|
| 384 |
[relig]: data/relig/relig.md
|
| 385 |
[nota]: data/nota/nota.md
|
|
|
|
| 386 |
|
| 387 |
|
| 388 |
[CC-0]: https://creativecommons.org/publicdomain/zero/1.0/legalcode.en
|
|
|
|
| 141 |
data_files:
|
| 142 |
- split: train
|
| 143 |
path: data/nota/*.parquet
|
| 144 |
+
- config_name: scrape_hovedstaden
|
| 145 |
+
data_files:
|
| 146 |
+
- split: train
|
| 147 |
+
path: data/scrape_hovedstaden/*.parquet
|
| 148 |
annotations_creators:
|
| 149 |
- no-annotation
|
| 150 |
language_creators:
|
|
|
|
| 178 |
<!-- START README TABLE -->
|
| 179 |
| | |
|
| 180 |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 181 |
+
| **Version** | 1.2.2 ([Changelog](/CHANGELOG.md)) |
|
| 182 |
| **Language** | dan, dansk, Danish |
|
| 183 |
| **License** | Openly Licensed, See the respective dataset |
|
| 184 |
| **Models** | For model trained used this data see [danish-foundation-models](https://huggingface.co/danish-foundation-models) |
|
|
|
|
| 215 |
|
| 216 |
<!-- START-DESC-STATS -->
|
| 217 |
- **Language**: dan, dansk, Danish
|
| 218 |
+
- **Number of samples**: 915.09K
|
| 219 |
+
- **Number of tokens (Llama 3)**: 4.40B
|
| 220 |
+
- **Average document length (characters)**: 14778.01
|
| 221 |
<!-- END-DESC-STATS -->
|
| 222 |
|
| 223 |
|
|
|
|
| 315 |
Below follows a brief overview of the sources in the corpus along with their individual license.
|
| 316 |
|
| 317 |
<!-- START-MAIN TABLE -->
|
| 318 |
+
| Source | Description | Domain | N. Tokens | License |
|
| 319 |
+
|:---------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------|:------------|:-----------------------|
|
| 320 |
+
| [cellar] | The official digital repository for European Union legal documents and open data | Legal | 1.15B | [CC-BY-SA 4.0] |
|
| 321 |
+
| [ncc_books] | Danish books extracted from the [Norwegian Colossal Corpus](https://huggingface.co/datasets/NbAiLab/NCC) derived from OCR | Books | 531.97M | [CC-0] |
|
| 322 |
+
| [retsinformationdk] | [retsinformation.dk](https://www.retsinformation.dk) (legal-information.dk) the official legal information system of Denmark | Legal | 516.35M | [Danish Copyright Law] |
|
| 323 |
+
| [hest] | Samples from the Danish debate forum www.heste-nettet.dk | Social Media | 389.32M | [CC-0] |
|
| 324 |
+
| [ncc_parliament] | Collections from the Norwegian parliament in Danish. Extracted from the [Norwegian Colossal Corpus](https://huggingface.co/datasets/NbAiLab/NCC) derived from ocr | Other | 338.87M | [NLOD 2.0] |
|
| 325 |
+
| [opensubtitles] | Danish subsection of [OpenSubtitles](https://opus.nlpl.eu/OpenSubtitles/corpus/version/OpenSubtitles) | Conversation | 271.60M | [CC-0] |
|
| 326 |
+
| [ai-aktindsigt] | Multiple web scrapes from municipality websites collected as a part of the [AI-aktindsigt](https://ai-aktindsigt.dk) project | Web | 139.23M | [Apache 2.0] |
|
| 327 |
+
| [miljoeportalen] | Data from [Danmarks Miljøportalen](https://www.miljoeportal.dk/om-danmarks-miljoeportal/) (Denmark's Environment Portal) | Web | 127.38M | [CC-0] |
|
| 328 |
+
| [skat] | Skat is the Danish tax authority. This dataset contains content from its website skat.dk | Legal | 122.11M | [CC-0] |
|
| 329 |
+
| [wiki] | The Danish subsection of [wikipedia](https://en.wikipedia.org/wiki/Main_Page) | Encyclopedic | 122.00M | [CC-0] |
|
| 330 |
+
| [ft] | Records from all meetings of The Danish parliament (Folketinget) in the parliament hall | Conversation | 114.09M | [CC-0] |
|
| 331 |
+
| [memo] | The MeMo corpus comprising almost all Danish novels from the period 1870-1899, known as the Modern Breakthrough | Books | 113.74M | [CC-BY-SA 4.0] |
|
| 332 |
+
| [ep] | The Danish subsection of [Europarl](https://aclanthology.org/2005.mtsummit-papers.11/) | Conversation | 100.84M | [CC-0] |
|
| 333 |
+
| [adl] | Danish literature from 1700-2023 from the [Archive for Danish Literature](https://tekster.kb.dk/text?editorial=no&f%5Bsubcollection_ssi%5D%5B%5D=adl&match=one&search_field=Alt) (ADL) | Books | 58.49M | [CC-0] |
|
| 334 |
+
| [retspraksis] | Case law or judical practice in Denmark derived from [Retspraksis](https://da.wikipedia.org/wiki/Retspraksis) | Legal | 56.26M | [CC-0] |
|
| 335 |
+
| [fm-udgivelser] | The official publication series of the Danish Ministry of Finance containing economic analyses, budget proposals, and fiscal policy documents | Legal | 50.34M | [CC-BY-SA 4.0] |
|
| 336 |
+
| [nordjyllandnews] | Articles from the Danish Newspaper [TV2 Nord](https://www.tv2nord.dk) | News | 37.90M | [CC-0] |
|
| 337 |
+
| [eur-lex-sum-da] | The Danish subsection of EUR-lex SUM consisting of EU legislation paired with professionally written summaries | Legal | 31.37M | [CC-BY-SA 4.0] |
|
| 338 |
+
| [ncc_maalfrid] | Danish content from Norwegian institutions websites | Web | 29.26M | [NLOD 2.0] |
|
| 339 |
+
| [scrape_hovedstaden] | Guidelines and informational documents for healthcare professionals from the Capital Region | Medical | 27.07M | [CC-0] |
|
| 340 |
+
| [tv2r] | Contemporary Danish newswire articles published between 2010 and 2019 | News | 21.67M | [CC-BY-SA 4.0] |
|
| 341 |
+
| [danske-taler] | Danish Speeches from [dansketaler.dk](https://www.dansketaler.dk) | Conversation | 8.81M | [CC-0] |
|
| 342 |
+
| [nota] | The text only part of the [Nota lyd- og tekstdata](https://sprogteknologi.dk/dataset/nota-lyd-og-tekstdata) dataset | Readaloud | 7.30M | [CC-0] |
|
| 343 |
+
| [gutenberg] | The Danish subsection from Project [Gutenberg](https://www.gutenberg.org) | Books | 6.76M | [Gutenberg] |
|
| 344 |
+
| [wikibooks] | The Danish Subsection of [Wikibooks](https://www.wikibooks.org) | Books | 6.24M | [CC-0] |
|
| 345 |
+
| [wikisource] | The Danish subsection of [Wikisource](https://en.wikisource.org/wiki/Main_Page) | Encyclopedic | 5.34M | [CC-0] |
|
| 346 |
+
| [jvj] | The works of the Danish author and poet, [Johannes V. Jensen](https://da.wikipedia.org/wiki/Johannes_V._Jensen) | Books | 3.55M | [CC-BY-SA 4.0] |
|
| 347 |
+
| [spont] | Conversational samples collected as a part of research projects at Aarhus University | Conversation | 1.56M | [CC-0] |
|
| 348 |
+
| [dannet] | [DanNet](https://cst.ku.dk/projekter/dannet) is a Danish WordNet | Other | 1.48M | [DanNet 1.0] |
|
| 349 |
+
| [relig] | Danish religious text from the 1700-2022 | Books | 1.24M | [CC-0] |
|
| 350 |
+
| [ncc_newspaper] | OCR'd Newspapers derived from [NCC](https://huggingface.co/datasets/NbAiLab/NCC) | News | 1.05M | [CC-0] |
|
| 351 |
+
| [botxt] | The Bornholmsk Ordbog Dictionary Project | Dialect | 847.97K | [CC-0] |
|
| 352 |
+
| [naat] | Danish speeches from 1930-2022 | Conversation | 286.68K | [CC-0] |
|
| 353 |
+
| [depbank] | The Danish subsection of the [Universal Dependencies Treebank](https://github.com/UniversalDependencies/UD_Danish-DDT) | Other | 185.45K | [CC-BY-SA 4.0] |
|
| 354 |
+
| [synne] | Dataset collected from [synnejysk forening's website](https://www.synnejysk.dk), covering the Danish dialect sønderjysk | Other | 52.02K | [CC-0] |
|
| 355 |
+
| **Total** | | | 4.40B | |
|
| 356 |
|
| 357 |
[ai-aktindsigt]: data/ai-aktindsigt/ai-aktindsigt.md
|
| 358 |
[cellar]: data/cellar/cellar.md
|
|
|
|
| 388 |
[nordjyllandnews]: data/nordjyllandnews/nordjyllandnews.md
|
| 389 |
[relig]: data/relig/relig.md
|
| 390 |
[nota]: data/nota/nota.md
|
| 391 |
+
[scrape_hovedstaden]: data/scrape_hovedstaden/scrape_hovedstaden.md
|
| 392 |
|
| 393 |
|
| 394 |
[CC-0]: https://creativecommons.org/publicdomain/zero/1.0/legalcode.en
|
data/scrape_hovedstaden/create.py
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# /// script
|
| 2 |
+
# requires-python = "==3.12"
|
| 3 |
+
# dependencies = [
|
| 4 |
+
# "datasets==3.2.0",
|
| 5 |
+
# "dynaword"
|
| 6 |
+
# ]
|
| 7 |
+
# [tool.uv.sources]
|
| 8 |
+
# dynaword = { git = "https://huggingface.co/datasets/danish-foundation-models/danish-dynaword", rev = "00e7f2aee7f7ad2da423419f77ecbb9c0536de0d" }
|
| 9 |
+
# ///
|
| 10 |
+
"""
|
| 11 |
+
Script for downloading and processing the Scrape Hovedstaden texts.
|
| 12 |
+
|
| 13 |
+
Note: To run this script, you need to set `GIT_LFS_SKIP_SMUDGE=1` to be able to install dynaword:
|
| 14 |
+
|
| 15 |
+
```bash
|
| 16 |
+
GIT_LFS_SKIP_SMUDGE=1 uv run data/scrape_hovedstaden/create.py
|
| 17 |
+
```
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
import logging
|
| 21 |
+
import subprocess
|
| 22 |
+
from datetime import datetime
|
| 23 |
+
from pathlib import Path
|
| 24 |
+
from typing import Any, cast
|
| 25 |
+
|
| 26 |
+
import pandas as pd
|
| 27 |
+
from datasets import Dataset, load_dataset
|
| 28 |
+
|
| 29 |
+
from dynaword.process_dataset import (
|
| 30 |
+
add_token_count,
|
| 31 |
+
ensure_column_order,
|
| 32 |
+
remove_duplicate_text,
|
| 33 |
+
remove_empty_texts,
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
logger = logging.getLogger(__name__)
|
| 37 |
+
|
| 38 |
+
download_path = Path(__file__).parent / "tmp"
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def main():
|
| 42 |
+
save_path = Path(__file__).parent / "scrape_hovedstaden.parquet"
|
| 43 |
+
# Download data from repo: Den-Intelligente-Patientjournal/region_hovedstaden_text
|
| 44 |
+
ds = load_dataset(
|
| 45 |
+
"Den-Intelligente-Patientjournal/region_hovedstaden_text", split="train"
|
| 46 |
+
)
|
| 47 |
+
dataset: Dataset = cast(Dataset, ds)
|
| 48 |
+
|
| 49 |
+
# Extract the cleaned column
|
| 50 |
+
dataset = dataset.rename_column("cleaned", "text")
|
| 51 |
+
|
| 52 |
+
# Add created column: 2015 and 2020
|
| 53 |
+
dataset = dataset.add_column("created", ["2015-01-01, 2020-12-31"] * len(dataset)) # type: ignore
|
| 54 |
+
# Add added column: today
|
| 55 |
+
dataset = dataset.add_column(
|
| 56 |
+
"added", [datetime.today().date().strftime("%Y-%m-%d")] * len(dataset)
|
| 57 |
+
) # type: ignore
|
| 58 |
+
# Add source column: scrape_hovedstaden
|
| 59 |
+
dataset = dataset.add_column("source", ["scrape_hovedstaden"] * len(dataset)) # type: ignore
|
| 60 |
+
# Add id column: scrape_hovedstade_{idx}
|
| 61 |
+
dataset = dataset.add_column(
|
| 62 |
+
"id", [f"scrape_hovedstaden_{i}" for i in range(len(dataset))]
|
| 63 |
+
) # type: ignore
|
| 64 |
+
|
| 65 |
+
# quality checks and processing
|
| 66 |
+
dataset = remove_empty_texts(dataset)
|
| 67 |
+
dataset = remove_duplicate_text(dataset)
|
| 68 |
+
dataset = add_token_count(dataset)
|
| 69 |
+
dataset = ensure_column_order(dataset)
|
| 70 |
+
|
| 71 |
+
# save to parquet
|
| 72 |
+
dataset.to_parquet(save_path)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
if __name__ == "__main__":
|
| 76 |
+
main()
|
data/scrape_hovedstaden/descriptive_stats.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"number_of_samples": 23996,
|
| 3 |
+
"average_document_length": 3329.0515919319887,
|
| 4 |
+
"number_of_tokens": 27066716,
|
| 5 |
+
"revision": "78cc135f92c8c12ee8ba131d1a03befc5c78477d"
|
| 6 |
+
}
|
data/scrape_hovedstaden/images/dist_document_length.png
ADDED
|
Git LFS Details
|
data/scrape_hovedstaden/scrape_hovedstaden.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: "Health Hovedstaden"
|
| 3 |
+
language:
|
| 4 |
+
- da
|
| 5 |
+
license: cc0-1.0
|
| 6 |
+
license_name: CC-0
|
| 7 |
+
task_categories:
|
| 8 |
+
- text-generation
|
| 9 |
+
- fill-mask
|
| 10 |
+
task_ids:
|
| 11 |
+
- language-modeling
|
| 12 |
+
source_datasets:
|
| 13 |
+
- Den-Intelligente-Patientjournal/region_hovedstaden_text
|
| 14 |
+
domains:
|
| 15 |
+
- Medical
|
| 16 |
+
- Encyclopedic
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Dataset Card for Health Hovedstaden
|
| 20 |
+
|
| 21 |
+
<!-- START-SHORT DESCRIPTION -->
|
| 22 |
+
Guidelines and informational documents for healthcare professionals from the Capital Region
|
| 23 |
+
<!-- END-SHORT DESCRIPTION -->
|
| 24 |
+
|
| 25 |
+
The document collection consists of guidelines and informational documents for healthcare professionals in the Capital Region of Denmark. The documents therefore contain a number of specialized terms and concepts that are frequently used within the healthcare sector.
|
| 26 |
+
|
| 27 |
+
The corpus was created based on the texts in the document collection and has been post-processed so that the texts can be used for the development of language technology.
|
| 28 |
+
|
| 29 |
+
Martin Sundahl Laursen and Thiusius R. Savarimuthu from the University of Southern Denmark have assisted the Danish Agency for Digital Government with the post-processing of the data. Read their joint paper on "Automatic Annotation of Training Data for Deep Learning Based De-identification of Narrative Clinical Text."
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
## Dataset Description
|
| 35 |
+
|
| 36 |
+
<!-- START-DESC-STATS -->
|
| 37 |
+
- **Language**: dan, dansk, Danish
|
| 38 |
+
- **Domains**: Medical, Encyclopedic
|
| 39 |
+
- **Number of samples**: 24.00K
|
| 40 |
+
- **Number of tokens (Llama 3)**: 27.07M
|
| 41 |
+
- **Average document length (characters)**: 3329.05
|
| 42 |
+
<!-- END-DESC-STATS -->
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
## Dataset Structure
|
| 46 |
+
An example from the dataset looks as follows.
|
| 47 |
+
|
| 48 |
+
<!-- START-SAMPLE -->
|
| 49 |
+
```py
|
| 50 |
+
{
|
| 51 |
+
"id": "scrape_hovedstaden_0",
|
| 52 |
+
"text": "Acetylsalicylsyre - Aspirin, Akutlægebil\n\nMålgrupper og anvendelsesområde\nDefinitioner\nFremgangsmåde[...]",
|
| 53 |
+
"source": "scrape_hovedstaden",
|
| 54 |
+
"added": "2025-06-25",
|
| 55 |
+
"created": "2015-01-01, 2020-12-31",
|
| 56 |
+
"token_count": 766
|
| 57 |
+
}
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
### Data Fields
|
| 61 |
+
|
| 62 |
+
An entry in the dataset consists of the following fields:
|
| 63 |
+
|
| 64 |
+
- `id` (`str`): An unique identifier for each document.
|
| 65 |
+
- `text`(`str`): The content of the document.
|
| 66 |
+
- `source` (`str`): The source of the document (see [Source Data](#source-data)).
|
| 67 |
+
- `added` (`str`): An date for when the document was added to this collection.
|
| 68 |
+
- `created` (`str`): An date range for when the document was originally created.
|
| 69 |
+
- `token_count` (`int`): The number of tokens in the sample computed using the Llama 8B tokenizer
|
| 70 |
+
<!-- END-SAMPLE -->
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
### Additional Processing
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
### Unintended Uses
|
| 78 |
+
|
| 79 |
+
Please note that the corpus has been developed for the purpose of language technology development and should not be used as a source of healthcare information. The documents were scraped at a specific time and will therefore not be updated with changes. In this regard, please refer to the Capital Region of Denmark's document collection.
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
### Dataset Statistics
|
| 83 |
+
|
| 84 |
+
<!-- START-DATASET PLOTS -->
|
| 85 |
+
<p align="center">
|
| 86 |
+
<img src="./images/dist_document_length.png" width="600" style="margin-right: 10px;" />
|
| 87 |
+
</p>
|
| 88 |
+
<!-- END-DATASET PLOTS -->
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
# Additional Information
|
| 92 |
+
|
| 93 |
+
## License Information
|
| 94 |
+
The dataset have been released under a CC-0 license.
|
| 95 |
+
|
| 96 |
+
### Citation Information
|
| 97 |
+
|
| 98 |
+
If you are using the data please reference the following paper [Automatic Annotation of Training Data for Deep Learning Based De-identification of Narrative Clinical Text](https://ceur-ws.org/Vol-3416/paper_5.pdf)
|
data/scrape_hovedstaden/scrape_hovedstaden.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:830fcdc9a16310bf1d165db79ba8b49bdee33cd7b3849ca0564b010d9f3df318
|
| 3 |
+
size 41434842
|
descriptive_stats.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
-
"number_of_samples":
|
| 3 |
-
"average_document_length":
|
| 4 |
-
"number_of_tokens":
|
| 5 |
-
"revision": "
|
| 6 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"number_of_samples": 915090,
|
| 3 |
+
"average_document_length": 14778.0072255188,
|
| 4 |
+
"number_of_tokens": 4396075044,
|
| 5 |
+
"revision": "8e2259b9aaa48bb3950b8b4111d10a92ba834459"
|
| 6 |
}
|
images/dist_document_length.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
images/domain_distribution.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
pyproject.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
[project]
|
| 2 |
name = "dynaword"
|
| 3 |
-
version = "1.2.
|
| 4 |
description = "project code for the danish dynaword project"
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.12,<3.13" # 3.13 have issues with spacy and pytorch
|
|
|
|
| 1 |
[project]
|
| 2 |
name = "dynaword"
|
| 3 |
+
version = "1.2.2"
|
| 4 |
description = "project code for the danish dynaword project"
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.12,<3.13" # 3.13 have issues with spacy and pytorch
|
src/dynaword/typings.py
CHANGED
|
@@ -6,6 +6,7 @@ DOMAIN = Literal[
|
|
| 6 |
"Dialect",
|
| 7 |
"Encyclopedic",
|
| 8 |
"Legal",
|
|
|
|
| 9 |
"News",
|
| 10 |
"Other",
|
| 11 |
"Readaloud",
|
|
|
|
| 6 |
"Dialect",
|
| 7 |
"Encyclopedic",
|
| 8 |
"Legal",
|
| 9 |
+
"Medical",
|
| 10 |
"News",
|
| 11 |
"Other",
|
| 12 |
"Readaloud",
|
test_results.log
CHANGED
|
@@ -2,23 +2,23 @@
|
|
| 2 |
platform darwin -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0
|
| 3 |
rootdir: /Users/kristianjensen/Documents/danish-dynaword
|
| 4 |
configfile: pyproject.toml
|
| 5 |
-
collected
|
| 6 |
|
| 7 |
src/tests/test_dataset_schema.py ....................................... [ 12%]
|
| 8 |
-
|
| 9 |
src/tests/test_datasheets.py ........................................... [ 35%]
|
| 10 |
-
........................................................................ [
|
| 11 |
-
|
| 12 |
src/tests/test_load.py .. [ 77%]
|
| 13 |
-
src/tests/test_quality/test_duplicates.py .............................. [
|
| 14 |
-
|
| 15 |
-
src/tests/test_quality/test_short_texts.py ............................. [
|
| 16 |
-
|
| 17 |
src/tests/test_unique_ids.py . [100%]
|
| 18 |
|
| 19 |
=============================== warnings summary ===============================
|
| 20 |
-
src/tests/test_quality/test_short_texts.py:
|
| 21 |
/Users/kristianjensen/Documents/danish-dynaword/.venv/lib/python3.12/site-packages/datasets/utils/_dill.py:385: DeprecationWarning: co_lnotab is deprecated, use co_lines instead.
|
| 22 |
|
| 23 |
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
|
| 24 |
-
=================
|
|
|
|
| 2 |
platform darwin -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0
|
| 3 |
rootdir: /Users/kristianjensen/Documents/danish-dynaword
|
| 4 |
configfile: pyproject.toml
|
| 5 |
+
collected 319 items
|
| 6 |
|
| 7 |
src/tests/test_dataset_schema.py ....................................... [ 12%]
|
| 8 |
+
............................... [ 21%]
|
| 9 |
src/tests/test_datasheets.py ........................................... [ 35%]
|
| 10 |
+
........................................................................ [ 57%]
|
| 11 |
+
............................................................ [ 76%]
|
| 12 |
src/tests/test_load.py .. [ 77%]
|
| 13 |
+
src/tests/test_quality/test_duplicates.py .............................. [ 86%]
|
| 14 |
+
.....s [ 88%]
|
| 15 |
+
src/tests/test_quality/test_short_texts.py ............................. [ 97%]
|
| 16 |
+
...... [ 99%]
|
| 17 |
src/tests/test_unique_ids.py . [100%]
|
| 18 |
|
| 19 |
=============================== warnings summary ===============================
|
| 20 |
+
src/tests/test_quality/test_short_texts.py: 35 warnings
|
| 21 |
/Users/kristianjensen/Documents/danish-dynaword/.venv/lib/python3.12/site-packages/datasets/utils/_dill.py:385: DeprecationWarning: co_lnotab is deprecated, use co_lines instead.
|
| 22 |
|
| 23 |
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
|
| 24 |
+
================= 318 passed, 1 skipped, 35 warnings in 27.88s =================
|
uv.lock
CHANGED
|
@@ -257,7 +257,7 @@ wheels = [
|
|
| 257 |
|
| 258 |
[[package]]
|
| 259 |
name = "dynaword"
|
| 260 |
-
version = "1.2.
|
| 261 |
source = { editable = "." }
|
| 262 |
dependencies = [
|
| 263 |
{ name = "datasets" },
|
|
|
|
| 257 |
|
| 258 |
[[package]]
|
| 259 |
name = "dynaword"
|
| 260 |
+
version = "1.2.2"
|
| 261 |
source = { editable = "." }
|
| 262 |
dependencies = [
|
| 263 |
{ name = "datasets" },
|