๐Ÿ“ฆ ftnext / kurenai

็ด… - non-ascii character support ROUGE score calculator

โ˜… 1 stars โ‘‚ 0 forks ๐Ÿ‘ 1 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/ftnext/kurenai.git
HTTPS git clone https://github.com/ftnext/kurenai.git
SSH git clone git@github.com:ftnext/kurenai.git
CLI gh repo clone ftnext/kurenai
ftnext ftnext [chore] Bump up 0.0.3 96a279e 2 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ src
๐Ÿ“ tests
๐Ÿ“„ .gitignore
๐Ÿ“„ LICENSE
๐Ÿ“„ pyproject.toml
๐Ÿ“„ README.md
๐Ÿ“„ setup.py
๐Ÿ“„ README.md

็ด… (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 (1, 2, ..., 9) and ROUGE-L
  • TODO: ROUGE-Lsum
  • Supports both RougeScorer.score() and RougeScorer.score_multi()

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