Repository navigation
rougers 0.1.0
First release.
rougers is a Rust implementation of ROUGE whose scores are bit-for-bit identical to Google's rouge-score, including its tokenizer, NLTK's Porter stemmer and the summary-level rougeLsum.
Install
pip install rouge-score-rsfrom rouge_score_rs import rouge_scorer # was: from rouge_score import rouge_scorerRust: rougers = "0.1" (crates.io).
Highlights
rouge1–rouge9,rougeLandrougeLsum, with the samerouge_scorer,scoring,tokenizeandtokenizersmodules asrouge-score.score_batchscores many pairs on all CPU cores without holding the GIL.- No required Python dependencies; NumPy and NLTK are optional extras for bootstrap aggregation and
split_summaries. - Wheels for Linux (x86_64, aarch64, glibc and musl), macOS (Intel and Apple Silicon) and Windows, for Python 3.9 and newer.
Performance
10,000 English text pairs, about 60 words each, rouge1, rouge2, rougeL, rougeLsum with stemming, Apple M1 Pro:
| pairs per second | speedup | |
|---|---|---|
rouge-score 0.1.2 |
590 | 1× |
score() |
17,078 | 29× |
score_batch(), 8 threads |
83,957 | 142× |
See the README for how compatibility is tested and the few known differences.