Skip to main content

No project description provided

Project description

ROUGE-K

Run extraction

Give an input file contains summarization data samples and a path to save extracted keywords.

Input data needs to be in jsonline format, each line is a dictionaly containing one data sample.

Each sample in input files need three information, (1) source (List[str]): List of sentences in source document, (2) target (List[str]): List of reference summaries, it can be a list with just one element (one sentence) if there is only one reference summary in your dataset, (3) title (str): title of the source documents.

There is a sample data in ./tests/sample.jsonl

rougek extract sample.jsonl output.jsonl

Resulting data (output.jsonl in the example above) is also a jsonline file, each line contains a list of keywords (List[str]) for one data sample.

Run evaluation

From python

You can evaluate your summaries by ROUGE-K in your python scripts as follows:

from rougek import RougeK

rk = RougeK()
hypo = "This is a generated summary."
kws = ["summary"]

result = rk(hypo, kws)
print(f"ROUGE-K: {result}.")

From CLI

Of course, this package gives you an option as a CLI command so that you don't need to touch any python scripts.

By running the following command, you get an avg of ROUGE-K scores for your summaries.

> rougek evaluate /path/to/target.hypo /path/to/kws.jsonl

You can also evaluate multiple .hypo files in a directory by following,

> rougek evaluate_dir /dir/with/hypofiles /path/to/kws.jsonl

target hypo files need to have an extension of .hypo to be considered.

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

rougek-0.1.5.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

rougek-0.1.5-cp311-cp311-macosx_10_7_x86_64.whl (190.1 kB view details)

Uploaded CPython 3.11 macOS 10.7+ x86-64

File details

Details for the file rougek-0.1.5.tar.gz.

File metadata

  • Download URL: rougek-0.1.5.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.4.0

File hashes

Hashes for rougek-0.1.5.tar.gz
Algorithm Hash digest
SHA256 33341dd61bc0180fce21100ae42ded449189bc83ac8eafdc2781062a6c54d8f3
MD5 f803b9fcf6ca43b256ec81bd1e4fadda
BLAKE2b-256 ff99eac516f0d61b06b60f0097361254b6e55fd2f8b47a2505cf286848c16df2

See more details on using hashes here.

File details

Details for the file rougek-0.1.5-cp311-cp311-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for rougek-0.1.5-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 c57095a0516d138ea631a493f1eb75546799929aaa2d3c8d4ca4917a0c4a9930
MD5 6be547e8e4cc43723e13759357cc44ee
BLAKE2b-256 7a1f48ec5dd1a66c42321a986c796f03861d535d8791b97c0cc1cd46a0cd358e

See more details on using hashes here.

Supported by

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