CoolFace
Datasetpublic

UppsalaNLP/swedish-text-complexity

Swedish Text Complexity Dataset A corpus of Swedish texts annotated with readability and linguistic complexity metrics, created by the Department of Linguistics and Philology at Uppsala University. Dataset Description This dataset contains Swedish text passages annotated with multiple complexity metrics, designed to support research in: Controllable text generation - Train LLMs to generate text at specific reading levels Educational NLP - Match texts to student… See the full description on the dataset page: https://huggingface.co/datasets/UppsalaNLP/swedish-text-complexity.

sourceHugging Facecc-by-sa-4.0updated 8mo agoView on Hugging Face
0likes23downloads
Dataset Card

Swedish Text Complexity Dataset

A corpus of Swedish texts annotated with readability and linguistic complexity metrics, created by the Department of Linguistics and Philology at Uppsala University.

Dataset Description

This dataset contains Swedish text passages annotated with multiple complexity metrics, designed to support research in:

  • Controllable text generation - Train LLMs to generate text at specific reading levels
  • Educational NLP - Match texts to student reading proficiency
  • Text simplification - Develop automatic simplification systems
  • Accessibility research - Create tools for readers with different needs
  • Readability research - Study linguistic factors affecting comprehension

Metrics Included

MetricDescriptionRange
LIXLäsbarhetsindex (Swedish readability index)~20-70+
OVIXOrdvariationsindex (lexical variation)Higher = more varied vocabulary
Nominal RatioNoun/verb density ratioHigher = more nominal style
ASLAverage Sentence Lengthwords per sentence
AWLAverage Word Lengthcharacters per word
LW%Long Word Percentage% of words >6 characters
TTRType-Token Ratio0-1 (lexical diversity)

LIX Score Interpretation

ScoreCategoryTypical Examples
< 25Very EasyChildren's books
25-30EasyYoung adult fiction
30-40MediumNewspapers, popular fiction
40-50DifficultOfficial documents, non-fiction
50-60Very DifficultAcademic texts
> 60Extremely DifficultLegal, specialized academic

Dataset Structure

python
{
    "id": "wikipedia_sv-a1b2c3d4",
    "text": "Stockholms tunnelbana öppnades 1950...",
    "source": "wikipedia_sv",
    "genre": "encyclopedia",
    "year": null,
    "author": "Wikipedia contributors",
    "license": "CC-BY-SA-4.0",
    "metrics_num_sentences": 5,
    "metrics_num_words": 87,
    "metrics_num_characters": 523,
    "metrics_num_long_words": 24,
    "metrics_num_unique_words": 71,
    "metrics_lix": 42.6,
    "metrics_lix_category": "difficult",
    "metrics_ovix": 78.3,
    "metrics_nominal_ratio": 1.45,
    "metrics_avg_sentence_length": 17.4,
    "metrics_avg_word_length": 6.01,
    "metrics_long_word_pct": 27.6,
    "metrics_type_token_ratio": 0.816
}

Usage

Loading the Dataset

python
from datasets import load_dataset

dataset = load_dataset("LingFilUU/swedish-text-complexity")

Filtering by Complexity

python
# Get only easy texts (LIX < 30)
easy_texts = dataset.filter(lambda x: x["metrics_lix"] < 30)

# Get difficult academic-style texts
difficult = dataset.filter(
    lambda x: x["metrics_lix"] > 50 and x["metrics_nominal_ratio"] > 1.5
)

Training for Controllable Generation

python
# Add complexity labels for conditional generation
def add_complexity_token(example):
    lix = example["metrics_lix"]
    if lix < 30:
        prefix = "<easy>"
    elif lix < 45:
        prefix = "<medium>"
    else:
        prefix = "<difficult>"
    example["text_with_prefix"] = f"{prefix} {example['text']}"
    return example

dataset = dataset.map(add_complexity_token)

Data Sources

Texts in this dataset are sourced from openly-licensed Swedish corpora:

  • Swedish Wikipedia (CC-BY-SA-4.0)
  • Språkbanken resources (various open licenses)
  • Project Runeberg (public domain)

Methodology

LIX Calculation

The LIX (Läsbarhetsindex) formula, developed by Carl-Hugo Björnsson (1968):

LIX = (words / sentences) + (long_words × 100 / words)

Where long_words = words with more than 6 characters.

OVIX Calculation

The OVIX (Ordvariationsindex) formula:

OVIX = log(tokens) / log(2 - log(types) / log(tokens))

Nominal Ratio

Calculated using spaCy's Swedish POS tagger:

NR = (nouns + prepositions + participles) / (verbs + adverbs + pronouns)

Citation

If you use this dataset, please cite:

bibtex
@dataset{lingfiluu_swedish_text_complexity,
  author = {Department of Linguistics and Philology, Uppsala University},
  title = {Swedish Text Complexity Dataset},
  year = {2025},
  publisher = {Hugging Face},
  url = {https://huggingface.co/datasets/LingFilUU/swedish-text-complexity}
}

References

  • Björnsson, C.H. (1968). Läsbarhet. Stockholm: Liber.
  • Hultman, T.G., & Westman, M. (1977). Gymnasistsvenska. Lund: Liber Läromedel.
  • Språkbanken Text

License

The dataset compilation is released under CC-BY-SA-4.0. Individual texts retain their original licenses as noted in the license field.

Contact

Department of Linguistics and Philology Uppsala University https://www.uu.se/en/department/linguistics-and-philology