Repository navigation
rougers 0.2.0
Opt-in tokenizers for languages other than English. rouge-score keeps only [a-z0-9], so Russian, Arabic, Hindi or Chinese text scores zero; the default tokenizer and its scores stay exactly as before.
from rouge_score_rs import rouge_scorer, tokenizers
scorer = rouge_scorer.RougeScorer(["rouge1", "rougeL"], tokenizer=tokenizers.UnicodeTokenizer())
chinese = rouge_scorer.RougeScorer(["rouge1", "rougeL"], tokenizer=tokenizers.CharacterTokenizer())UnicodeTokenizer(profileunicode-v1): Unicode word boundaries after NFKC and full
case folding, for languages in any script.CharacterTokenizer(profilecharacter-v1): one token per grapheme cluster after the
same normalization, for character-level ROUGE such as in Chinese.- Both profiles use pinned Unicode 17.0 data, so tokens do not depend on the platform or
the Rust version. - Both run natively, including in parallel
score_batch. The default tokenizer is
unchanged. - Rust:
Tokenizer::unicode,Tokenizer::characterandTokenizer::profile.
Minimum Rust version 1.88.
This release also replaces the synthetic benchmark with measurements on CNN/DailyMail, XSum and PubMed.
pip install -U rouge-score-rs