Add one new backtranslation profile for Danish legal summarization using dennlinger/eur-lex-sum.
The task shape is:
- input: Danish legal text
- target: Danish summary
- prompt: a fixed Danish instruction asking for a formal legal summary
The current backtranslation pack already does the core thing we need:
- take a finished target
- ask a model to infer a prompt that would have produced it
For EUR-Lex summarization, the final prompt must include a source document in addition to the instruction.
The important difference is that this profile should not use an LLM prompt generator.
The EUR-Lex documents are long enough that sending the full source text to another model just to synthesize an instruction would be unnecessarily expensive.
So this profile should be template-backed, not model-backed.
Keep this in the same pack, but generalize the internal normalized example shape.
Introduce a normalized record with fields like:
source_idtask_profileinput_texttarget_texttitlemeta
Then add one small profile layer:
wikipedia_article_dalegal_summary_da
Profile name:
legal_summary_da
Dataset source:
dennlinger/eur-lex-sum
Preferred output style:
- short
- formal
- neutral
- Danish
- focused on purpose, scope, key provisions, and affected parties
Example instruction shape:
Skriv en kort, saglig opsummering på dansk af nedenstående EU-retsakt. Fremhæv formål, anvendelsesområde, centrale bestemmelser og berørte aktører. Hold stilen neutral og officiel.
This should come from a fixed template or a very small hand-written variant set.
No LLM generation step is needed for the instruction itself.
Length should be a first-class concern for this profile.
Before choosing final thresholds, we should scan the dataset and measure:
- input character lengths
- input token lengths
- summary character lengths
- summary token lengths
- compression ratio between source and summary
Then filter explicitly instead of guessing.
Likely controls:
min_input_charsmax_input_charsmin_target_charsmax_target_chars- optional token-based equivalents if we want model-specific context control
The first implementation should also record length metadata on each row so we can tighten filters later without rerunning the analysis step.
For this profile:
- fixed instruction becomes the first part of
prompt - the legal text is appended after the instruction
- the gold summary becomes
target
Conceptually:
prompt = <fixed instruction> + "\\n\\nTekst:\\n" + <input_text>target = <target_text>
Add a separate config file instead of mixing this into the Wikipedia config.
Example:
pack: backtranslation
source:
dataset: dennlinger/eur-lex-sum
config_name: da
task:
profile: legal_summary_da
generation:
min_input_chars: 1000
min_target_chars: 200
max_input_chars: 12000
train_fraction: 0.9- Add a generic example shape in the backtranslation pack that supports
input_textandtarget_text. - Add a
legal_summary_daprofile that loads EUR-Lex source-summary pairs directly. - Add a fixed Danish instruction template for the profile instead of using an LLM.
- Add a small stats step or helper to inspect source and summary length distributions.
- Add explicit min/max length filtering for both input and target.
- Build final prompts by combining the fixed instruction with the legal source text.
- Add one dedicated config file for EUR-Lex.
- Add a focused test that uses a tiny fake EUR-Lex-style source example.
Not part of the first version:
- LLM-based prompt generation
- translation backtranslation
- multilingual alignment logic
- using Dynaword as the EUR-Lex source
- multiple legal prompt styles
Those can be added later once the single Danish summarization profile works cleanly.