Fast pure-Python drop-in replacement for rouge-score with a bit-parallel ROUGE-L
Project description
rapidrouge
⚠️⚠️⚠️ This repository was build with AI ⚠️⚠️⚠️
A fast, pure-Python drop-in replacement for rouge-score.
uv add rapidrouge # pure-Python, ZERO runtime deps — installs anywhere
Optional extras: rapidrouge[stemmer] (nltk, for use_stemmer=True),
rapidrouge[aggregate] (numpy, for BootstrapAggregator), or rapidrouge[full].
Same import, same results as rouge_score 0.1.2 — ROUGE-L's
LCS length is computed with the Hyyrö bit-parallel algorithm, so it's far faster
on long documents:
from rapidrouge import rouge_scorer
scorer = rouge_scorer.RougeScorer(["rouge1", "rougeL"], use_stemmer=False)
scorer.score("the quick brown fox", "quick brown the fox")["rougeL"].fmeasure # 0.75
Benchmarks
ROUGE-L is where the bit-parallel kernel pays off, and the win grows with document length. From ~10× on a sentence to ~900× on a 35k-token document (115 ms vs ~104 s), with results identical to rouge_score:
It's a memory win too: the reference fills an O(n·m) DP table (~9.8 GB at 35k tokens), while rapidrouge's LCS is O(n). rouge1/
rouge2 (n-gram counting) and rougeLsum (still a DP table) match the reference in both correctness and speed (~1×), as expected — only ROUGE-L rides the Hyyrö kernel.
License
Apache-2.0. Portions derived from rouge_score (Apache-2.0); see NOTICE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rapidrouge-0.2.0.tar.gz.
File metadata
- Download URL: rapidrouge-0.2.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad429b0edfee200c8f186d2539a0edf6ac68931f12cc90359135be8b508a37a2
|
|
| MD5 |
e346efaea2d3a496ea328139623530d6
|
|
| BLAKE2b-256 |
d5da598bb5bc2bd77077c2983e07c4f7288670bde007d517f6322c61fa8af057
|
Provenance
The following attestation bundles were made for rapidrouge-0.2.0.tar.gz:
Publisher:
release.yml on aisilab/rapidrouge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rapidrouge-0.2.0.tar.gz -
Subject digest:
ad429b0edfee200c8f186d2539a0edf6ac68931f12cc90359135be8b508a37a2 - Sigstore transparency entry: 1858557985
- Sigstore integration time:
-
Permalink:
aisilab/rapidrouge@f2f97750aa52170896bd2af89db70ed2dc73005f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/aisilab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f2f97750aa52170896bd2af89db70ed2dc73005f -
Trigger Event:
push
-
Statement type:
File details
Details for the file rapidrouge-0.2.0-py3-none-any.whl.
File metadata
- Download URL: rapidrouge-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a41860a482d6378a60de18567aa8da449beee26d260cdd5039afad2e745bf9fd
|
|
| MD5 |
13244dc0817163e3700ad65273ebe923
|
|
| BLAKE2b-256 |
79fc6ead02d72039cdeb398ef90a3b3181236876560d6e190bc550b708395055
|
Provenance
The following attestation bundles were made for rapidrouge-0.2.0-py3-none-any.whl:
Publisher:
release.yml on aisilab/rapidrouge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rapidrouge-0.2.0-py3-none-any.whl -
Subject digest:
a41860a482d6378a60de18567aa8da449beee26d260cdd5039afad2e745bf9fd - Sigstore transparency entry: 1858558046
- Sigstore integration time:
-
Permalink:
aisilab/rapidrouge@f2f97750aa52170896bd2af89db70ed2dc73005f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/aisilab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f2f97750aa52170896bd2af89db70ed2dc73005f -
Trigger Event:
push
-
Statement type: