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 ROUGE1 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
kurenai-0.0.1.tar.gz
(3.8 kB
view details)
Built Distribution
File details
Details for the file kurenai-0.0.1.tar.gz
.
File metadata
- Download URL: kurenai-0.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22f05cc2c1836451160b666a87880144f62b6f2c3a9f741ffdd4de96d39fceea |
|
MD5 | add080a05183e981cbf6237ad43b7ab0 |
|
BLAKE2b-256 | d16acb6e0a828c9449b49c808c752cbd035ad78b1dd30deddbbac5ea70586b9a |
File details
Details for the file kurenai-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: kurenai-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3cf230c1635ad51de43b48cbd3db4ed8ad04e45f7686cf3a1e19054e370785f |
|
MD5 | 280278ac4e995f53979be46c898e3bab |
|
BLAKE2b-256 | 783e48dfcebe25b42cf43d0329d6b6753d5da0a08fddff593d71d7ee9da12305 |