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 hashes)