KLAR / README.md
nicofirst1's picture
docs: wording/style fixes from review (boss feedback)
be2ea00 verified
|
Raw
History Blame Contribute Delete
5.01 kB
---
license: cc-by-4.0
language:
- de
pretty_name: "KLAR - German Simplicity Score (Reproducibility Bundle)"
tags:
- readability
- text-simplification
- plain-language
- leichte-sprache
- german
- reproducibility
size_categories:
- 1K<n<10K
viewer: false
---
# KLAR - reproducibility bundle
Data and code to reproduce the paper **[Alles klar? A Rule-Based Simplicity Score for German Text Simplification](https://klar-text.github.io/acceptedpapers/)** (KlarText workshop; proceedings link to follow). KLAR is a reference-free, rule-based readability score for German plain language. This repository reproduces the paper's tables and reported statistics.
The bundle ships **text-free per-document scores** (numeric features only, no source or simplified text) plus the analysis code used to produce the paper's results. The scoring engine is a closed product and is not included: you can re-run the statistics on the released scores, but you cannot recalculate the scores themselves.
Some of the underlying corpora are license-restricted, so their texts are not redistributed here. If you hold a license and want to see the text behind a score, [`docs/DATASETS.md`](docs/DATASETS.md) explains how to rebuild each corpus into `data/`.
## Quickstart
```bash
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python -m experiments.rq1_validate --scores scores/deplain_web.jsonl
python -m experiments.rq2_convergent --scores-dir scores
python -m experiments.rq3_graded --scores scores/apa_lha.jsonl
python -m experiments.rq4_competitors
python -m experiments.rq4_tost
```
Each script writes its results JSON (and, for RQ2, a scatter figure) to `results/` and prints a report to stdout. See [`docs/REPRODUCE.md`](docs/REPRODUCE.md) for the full command set across all four corpora and the mapping from each script to its research question.
## Layout
- `scores/`: The released text-free per-document score bundles (JSONL), one file per corpus.
- `experiments/`: The analysis scripts. They read only the scores; the scorer is not included.
- `data/`: Empty. License holders rebuild corpora here (see `docs/DATASETS.md`).
- `docs/DATASETS.md`: How to obtain and rebuild each corpus.
- `docs/REPRODUCE.md`: Full reproduction walkthrough.
## Dataset structure
Each file in `scores/` is JSONL, one row per document. Every evaluated pair (an original document and its simplified counterpart) contributes **two rows**, linked by `pair_idx` and classified by `side` (`orig` / `simp`). Rows contain numbers and opaque metadata only: no source or simplified text is present anywhere in the bundle.
Fields (see `experiments/scores_bundle.py::make_row`, the source of truth):
- `schema`: Bundle schema version (currently `1`).
- `item_id`: `"<dataset>:<pair_idx>:<side>"`, e.g. `"apa_lha:0:orig"`.
- `dataset`: Corpus name (matches the file, e.g. `"apa_lha"`).
- `pair_idx`: Index of the orig/simp pair within the corpus.
- `side`: `"orig"` or `"simp"`.
- `sub`: Source sub-corpus label (feeds corpus filtering and per-subcorpus stats).
- `register`: Source register label, or `null`.
- `per_rule`: `{rule: {raw, scaled, w}}` for the 20 calibrated readability rules (e.g. `rule_simple_words`, `rule_short_sentences`). `raw` is the unscaled rule score, `scaled` maps it onto a common 0-1 scale, `w` is the rule's calibrated weight.
- `composite`: `{raw, scaled, scaled_conf}`. `scaled_conf` is the metric reported in the paper.
- `readability`: `{flesch, lix, wiener_sachtextformel}`, the standard readability formulas computed on the source text, sign-corrected so that higher always means simpler.
- `n_words`: Word count of the (unreleased) source text.
- `meta`: Non-text scalar fields carried through from the source corpus (e.g. `level`, `article_id`); never free text.
Example row (fabricated numbers):
```json
{
"schema": 1,
"item_id": "apa_lha:0:orig",
"dataset": "apa_lha",
"pair_idx": 0,
"side": "orig",
"sub": "apa_lha_a2",
"register": null,
"per_rule": {
"rule_simple_words": { "raw": 0.71, "scaled": 0.64, "w": 0.61 }
},
"composite": { "raw": 0.77, "scaled": 0.47, "scaled_conf": 0.38 },
"readability": { "flesch": 55.9, "lix": -58.2, "wiener_sachtextformel": -10.0 },
"n_words": 288,
"meta": { "level": "A2", "article_id": "0_2019" }
}
```
`scores/competitors.jsonl` is a second, differently-shaped bundle for the RQ4 competitor comparison: one row per (dataset, item, **system**) instead of per (dataset, item, side). `system` is one of `source` / `human` / `KLAR` or a competitor model (e.g. `German4all`, `erlesen-leo-7b`, `erlesen-leo-13b`, `elgepa-8b`). Fields: `composite.scaled_conf`, `readability.flesch`, `n_words`, `sub`; no per-rule breakdown, no text. Read by `experiments/rq4_competitors.py` and `rq4_tost.py`.
## Citation
TODO: add the BibTeX once the proceedings are out. Until then, cite the paper by title: _Alles klar? A Rule-Based Simplicity Score for German Text Simplification_ (KlarText workshop).