Thin wrapper of google-research's rouge-score; supports non-ascii by default
Project description
紅 (kurenai)
紅 (kurenai) is a thin wrapper of rouge-score.
rouge-score remove non-ascii characters by default, so ROUGE of Japanese text becomes 0.
>>> from rouge_score.rouge_scorer import RougeScorer
>>> scorer = RougeScorer(["rouge1"])
>>> scorer.score('いぬ ねこ', 'いぬ ねこ')
{'rouge1': Score(precision=0.0, recall=0.0, fmeasure=0.0)}
紅 (kurenai) resolves this, it supports ascii and non-ascii
Currently, It is at a developing status:
- Supports ROUGE-N and ROUGE-L only
Usage
紅 (kurenai) has the same interface as rouge-score.
>>> from kurenai.rouge_scorer import RougeScorer
>>> scorer = RougeScorer(["rouge1"])
>>> scorer.score('いぬ ねこ', 'いぬ ねこ')
{'rouge1': Score(precision=1.0, recall=1.0, fmeasure=1.0)}
>> scorer.score('The quick brown fox jumps over the lazy dog', 'The quick brown dog jumps on the log.')
{'rouge1': Score(precision=0.75, recall=0.6666666666666666, fmeasure=0.7058823529411765)}
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 kurenai-0.0.2.tar.gz.
File metadata
- Download URL: kurenai-0.0.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b66cffef42bae8f877d476c271b6effb8f3a75caa041d4b1e54628dc07df533d
|
|
| MD5 |
3ad374cd897c86d2e7ef339701584cd5
|
|
| BLAKE2b-256 |
9efbdfd933d16757fd761e03888151b38640a86bdddee8e594773f912e5aeb86
|
File details
Details for the file kurenai-0.0.2-py3-none-any.whl.
File metadata
- Download URL: kurenai-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dbd5a3683453994ce36c4da9bd8fb391b9d07eeb47549efc4348d296cb2337b
|
|
| MD5 |
916661e7562f7697f0a2ce1a2b6ea167
|
|
| BLAKE2b-256 |
c0b5752dc7223a1c7fa5b4ad047853dad318ecb881739bcbbc67dbaaa3733b8a
|