Skip to main content

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

Project details


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.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kurenai-0.0.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file kurenai-0.0.3.tar.gz.

File metadata

  • Download URL: kurenai-0.0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kurenai-0.0.3.tar.gz
Algorithm Hash digest
SHA256 61b925f5b69e5d728f15f9f4637fe15c6adbd9215e5870de8ff541b978fd41f2
MD5 246064470d7c200d59fe33e7c17bcc30
BLAKE2b-256 f7efbb293361264b16cacdcc7d075bb143dfcca0684e85c6674037e53b33a106

See more details on using hashes here.

Provenance

The following attestation bundles were made for kurenai-0.0.3.tar.gz:

Publisher: publish.yml on ftnext/kurenai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kurenai-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: kurenai-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kurenai-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 20a0edbccdd04c8751855b4bcc86f29083ffe906989a7e1e16961fb793080fbb
MD5 e52af35dc8477e4d1aba1ba6d86dddb0
BLAKE2b-256 43aedd4b520f3175ed2d74c9819ddbf0f3ab551a90407453fd395fb9180407f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for kurenai-0.0.3-py3-none-any.whl:

Publisher: publish.yml on ftnext/kurenai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page