Downloads · 30 days
21
16% of all-time downloads
Rahvusarhiiv/lv_summariser
lv_summariser is a summarization model from Rahvusarhiiv. Use it when you need a shorter version of a longer text. It is set up for transformers. The card lists the license as other.
Rahvusarhiiv/lvsummariser is an experimental Latvian summarization model fine-tuned from facebook/mbart-large-50-many-to-many-mmt.
Downloads · 30 days
21
16% of all-time downloads
All-time downloads
130
Public
Parameters
611M
4.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.4 GB · 99%
From the Hugging Face model README
Rahvusarhiiv/lv_summariser is an experimental Latvian summarization model fine-tuned from facebook/mbart-large-50-many-to-many-mmt.
The default branch contains revision 2, published in July 2026. The previously released checkpoint is preserved under the v1 tag. Revision 2 improves supported-news and recent-news summarization, source grounding, and removal of learned EU legal boilerplate, while producing shorter encyclopedic summaries.
This is a research release. It is not claimed to be state of the art; evaluate it on the target domain before production use.
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
repo_id = "Rahvusarhiiv/lv_summariser"
language_code = "lv_LV"
text = "Latvijas pētnieki paziņoja par jaunu projektu, kura mērķis ir uzlabot digitālo arhīvu pieejamību. Projekts paredz sadarboties ar bibliotēkām, universitātēm un valsts institūcijām."
tokenizer = AutoTokenizer.from_pretrained(repo_id, src_lang=language_code)
model = AutoModelForSeq2SeqLM.from_pretrained(repo_id)
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=768)
language_token_id = tokenizer.convert_tokens_to_ids(language_code)
summary_ids = model.generate(
**inputs,
forced_bos_token_id=language_token_id,
max_new_tokens=512,
num_beams=4,
no_repeat_ngram_size=3,
)
print(tokenizer.batch_decode(summary_ids, skip_special_tokens=True)[0])
convert_tokens_to_ids is used deliberately. Current Transformers releases may load the tokenizer as TokenizersBackend, which does not expose the older tokenizer-specific lang_code_to_id attribute.
max_input_tokens: 768max_new_tokens: 512num_beams: 4length_penalty: 1.0no_repeat_ngram_size: 3These are the settings used for the revision-2 comparison evaluation.
Revision 2 was trained on 30,000 balanced examples after protected-benchmark exclusion:
| family | training rows | share |
|---|---|---|
| Latvian news | 27,180 | 90.6% |
| EU legal | 2,412 | 8.0% |
| Academic/thesis | 408 | 1.4% |
The sources include:
dennlinger/eur-lex-sum examples. FMISummarization/FMI_Summarization was used to recover supporting source acts and select evidence; it was not added as duplicate sampling mass.Legal targets underwent more aggressive summary-section extraction and boilerplate filtering. Long inputs use source-span evidence selection. The build excluded protected Wiki4, GDELT, and supported-news benchmark overlap using IDs, normalized URLs, exact source/summary/pair hashes, and shared token shingles.
Training metadata:
facebook/mbart-large-50-many-to-many-mmt30,00070876838420260713Automatic evaluation used 100 examples per benchmark with the same decoding settings for revision 1 and revision 2.
| benchmark | ROUGE-L | ROUGE-1 | ROUGE-2 | ref coverage | src precision | words | repeat 4g | legalese | max hit |
|---|---|---|---|---|---|---|---|---|---|
| Strict Wiki4 | 0.313 | 0.347 | 0.251 | 0.291 | 0.864 | 28.7 | 0.000 | 0.000 | 0.000 |
| Recent GDELT news | 0.202 | 0.240 | 0.104 | 0.217 | 0.813 | 21.0 | 0.000 | 0.000 | 0.000 |
| Held-out supported news | 0.284 | 0.331 | 0.176 | 0.284 | 0.816 | 24.4 | 0.000 | 0.000 | 0.000 |
| benchmark | v1 ROUGE-L | v2 ROUGE-L | v1 src precision | v2 src precision |
|---|---|---|---|---|
| Strict Wiki4 | 0.387 | 0.313 | 0.787 | 0.864 |
| Recent GDELT news | 0.160 | 0.202 | 0.798 | 0.813 |
| Held-out supported news | 0.154 | 0.284 | 0.779 | 0.816 |
A local gemma4:31b Ollama judge evaluated five paired random examples per benchmark. This small comparative sample is not an absolute quality estimate.
| benchmark | v1 factuality | v2 factuality | v1 coverage | v2 coverage | v1 overall | v2 overall |
|---|---|---|---|---|---|---|
| Strict Wiki4 | 3.20 | 3.80 | 2.20 | 2.20 | 2.60 | 2.60 |
| Recent GDELT news | 3.00 | 2.80 | 1.80 | 2.80 | 2.00 | 2.40 |
| Held-out supported news | 2.20 | 3.20 | 1.80 | 2.40 | 1.60 | 2.60 |
Revision 2 was selected because it improved both automatic and judge results on the two news benchmarks, increased source precision in all three domains, and removed detected legalese artifacts. Wiki4 ROUGE and reference coverage declined because the new model produces shorter encyclopedic summaries; this is a known tradeoff rather than a universal improvement.
0.09 in this evaluation.The model reflects the distributions and editorial choices of its source corpora. Its revision-2 mix is heavily weighted toward Latvian public-broadcaster news, so its style and topic distribution are not representative of all Latvian writing. It may reproduce biases present in news, legal, and academic sources. Human review is recommended for public-facing summaries and high-impact decisions.
Training emissions were not instrumented with CodeCarbon or an equivalent tracker. No numeric CO2 estimate is reported. Training was local fine-tuning of an mBART-50 checkpoint rather than pretraining from scratch.
facebook/mbart-large-50-many-to-many-mmtv1The model card uses license: other because the training mix contains multiple upstream data sources with different terms. Treat this as a research-use release and verify upstream data/license constraints before redistribution or commercial use.