Skip to main content

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.

Metadata

Release files for rougek 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rougek 0.1.5
File Size Uploaded
rougek-0.1.5.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rougek 0.1.5
File Interpreter ABI Platform
rougek-0.1.5-cp311-cp311-macosx_10_7_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.7+ x86-64 Details

Total release size: 197.8 kB

Release files / rougek-0.1.5.tar.gz

Download URL rougek-0.1.5.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
33341dd61bc0180fce21100ae42ded449189bc83ac8eafdc2781062a6c54d8f3
BLAKE2b-256 checksum
How to use checksums
ff99eac516f0d61b06b60f0097361254b6e55fd2f8b47a2505cf286848c16df2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / rougek-0.1.5-cp311-cp311-macosx_10_7_x86_64.whl

Download URL rougek-0.1.5-cp311-cp311-macosx_10_7_x86_64.whl
Size 190.1 kB
Tags CPython 3.11 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
c57095a0516d138ea631a493f1eb75546799929aaa2d3c8d4ca4917a0c4a9930
BLAKE2b-256 checksum
How to use checksums
7a1f48ec5dd1a66c42321a986c796f03861d535d8791b97c0cc1cd46a0cd358e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page