Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

da-instruct-dynaword

Danish instruction fine-tuning dataset generated via backtranslation from danish-foundation-models/danish-dynaword, filtered to high-quality samples using danish-foundation-models/dynaword-annotations.

Dataset description

Each row is a (prompt, target) pair where:

  • target is a passage of authentic Danish text drawn from a curated subset of DynaWord
  • prompt is a realistic Danish user instruction that would plausibly elicit that text from a language model

Prompts were generated by Qwen/Qwen3.5-397B-A17B using a backtranslation approach: given a passage and its source context, the model is asked to write the user message that would cause a chatbot to produce a similar text. Domain-specific prompt templates (government, literary, academic, tax guidance, news, speech) ensure that the generated instructions match the register and genre of the source text.

Construction

1 β€” Quality filtering with dynaword-annotations

The dynaword-annotations dataset provides per-sample quality annotations for the full 5.66M-sample DynaWord corpus. The following filter was applied:

Criterion Allowed values
content_integrity complete
content_quality excellent
content_safety safe
pii_presence no_pii

This yields 233,570 candidate IDs (4.1% of the corpus). To balance coverage across domains, a maximum of 2,000 IDs per dynaword subset was sampled, giving 36,352 source IDs across 40 subsets.

2 β€” Passage extraction

Articles shorter than 400 characters were discarded. Longer articles were chunked into passages of up to 2,500 characters using a hybrid scoring approach (paragraph boundary detection with quality scoring). A maximum of 2 passages per article was kept.

Passage-level quality filters reject:

  • OCR noise (inter-word double spaces, ligature splits, high mixed-alphanumeric token ratio)
  • Repetitive content (unique word ratio < 28% or word run β‰₯ 6)
  • Document colophons and mastheads (phone/email/ISSN markers in first 300 chars)
  • YAML/markdown frontmatter

3 β€” Prompt generation

For each passage, Qwen3.5-397B-A17B was prompted with the passage text and source context metadata to generate a Danish user instruction. Six domain-specific system prompts were used:

  • government β€” administrative and public information requests
  • literary β€” prose, fiction, letters and historical texts
  • academic β€” scholarly articles and analytical texts
  • tax_guidance β€” practical citizen queries about tax rules
  • speech β€” parliamentary speeches and public addresses
  • news β€” news articles and encyclopedic texts (default)

Generated prompts were validated with rule-based filters: language detection (must be Danish), user-request detection (must include a question or imperative verb), shouting token check, roleplay pattern rejection, and prompt-target content overlap check.

4 β€” Results

39,847 instruction pairs generated from 36,352 high-quality source IDs across 40 dynaword subsets.

Source coverage

Subset Domain Source type Pairs
Domsdatabasen legal government 3,436
retsinformationdk legal government 3,273
municipality_meetings government government 2,899
wiki encyclopedia news 2,826
tidsskrift-dk journalism/academic academic 2,744
health_hovedstaden health government 2,733
miljoeportalen environment government 1,893
kb_historical_letters historical letters literary 1,871
ncc_maalfrid web/government government 1,850
ai-aktindsigt government government 1,797
skat tax tax_guidance 1,722
enevaeldens_nyheder historical news news 1,684
cellar EU documents government 1,670
retspraksis legal government 1,668
ep EU parliament speech 1,263
ncc_books books literary 1,114
opensubtitles film/TV subtitles literary 870
eur-lex-sum-da EU law government 719
danske-taler speeches speech 682
kb_administrative_publication administrative government 599
wikisource books literary 331
adl literature literary 320
grundtvig literary literary 298
fm-udgivelser government government 296
ft parliament speech 287
ncc_parliament parliament speech 279
memo books literary 251
wikibooks educational news 164
naat web speech 67
gutenberg books literary 63
nordjyllandnews news news 56
relig religious literary 24
wiki_misc wiki comments news 24
nota accessible library literary 18
botxt books literary 16
jvj literature literary 14
tv2r news news 14
depbank linguistic corpus literary 6
ncc_newspaper news news 6
dannet wordnet β€” 0 (entries too short)

Schema

{
    "id": "backtranslation_passages_dynaword-<hash>",
    "prompt": "Danish user instruction (generated)",
    "target": "Danish text passage (from source corpus)",
    "meta": {
        "passage_idx": 0,                # passage index within the source article
        "source_config_name": "skat",    # HuggingFace config name
        "source_dataset": "danish-foundation-models/danish-dynaword",
        "source_id": "skat::SKM...",     # original article ID
        "source_key": "skat",
        "source_name": "skat",           # dynaword subset name
        "source_record_index": 42,
        "source_split": "train",
        "source_type": "tax_guidance",   # prompt template used
        "target_chars": 1842
    },
    "sources": [
        {"config_name": "skat", "dataset": "danish-foundation-models/danish-dynaword",
         "row_id": "skat::SKM...", "split": "train"}
    ]
}

Usage

from datasets import load_dataset

ds = load_dataset("oliverkinch/da-instruct-dynaword")
# ds["train"], ds["test"]

# Format for SFT
def format_example(row):
    return {
        "messages": [
            {"role": "user",      "content": row["prompt"]},
            {"role": "assistant", "content": row["target"]},
        ]
    }

Licence

This dataset inherits the licences of the constituent DynaWord subsets. Subsets carry a range of open licences (CC0, CC-BY, CC-BY-SA, government open data). See the DynaWord dataset card for per-subset licence details.

The generated prompt column was produced with Qwen/Qwen3.5-397B-A17B and is released under CC-BY 4.0.

Related datasets

Downloads last month
27