From ed035fa33cabe29a6c317697843ba9277394f59b Mon Sep 17 00:00:00 2001 From: pltrdy Date: Tue, 24 Jan 2017 18:07:51 +0100 Subject: [PATCH] Positional argument instead of flags --summ & --ref --- README.md | 18 +++++++++++++++--- files2rouge.py | 10 +++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7d0e772..aae1a96 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Files2ROUGE Multi-threaded ROUGE scoring. It uses [pythonrouge](https://github.com/pltrdy/pythonrouge). +See [ROUGE Official website]() as well as [this paper about ROUGE variants](http://83.212.103.151/~mkalochristianakis/techNotes/ipromo/rougen5.pdf) ## Motivations Computing ROUGE score between an automatically generated summary and a reference file. @@ -11,14 +12,25 @@ Computing ROUGE score between an automatically generated summary and a reference git clone --recursive https://github.com/pltrdy/files2rouge.git cd files2rouge ``` -(If you want to install `pythonrouge` run `cd pythonrouge && sudo pip install .`) +(If you want to install `pythonrouge` run `cd pythonrouge && sudo pip install .`) **2) Run `files2rouge.py`** ```bash -./files2rouge.py --ref references.txt --summ summary.txt --verbose +./files2rouge.py summaries.txt references.txt --verbose ``` +**Outputs:** +When `--verbose` is set, the script prints progress and remaining time on `stderr`. +At the end, metrcis averages are printed: +- ROUGE-1 +- ROUGE-2 +- ROUGE-3 +- ROUGE-L +- ROUGE-S4 + +[More information about ROUGE metric](http://83.212.103.151/~mkalochristianakis/techNotes/ipromo/rougen5.pdf) + ## More informations -* **Use cases:**: +* **Use cases:** * [Text Summarization using OpenNMT](./experiments/openNMT.0.md) * About `files2rouge.py`: run `./files2rouge.py --help` * About ROUGE Metric: [project webpage](http://www.berouge.com/Pages/default.aspx) diff --git a/files2rouge.py b/files2rouge.py index ef11b99..293d85e 100755 --- a/files2rouge.py +++ b/files2rouge.py @@ -9,7 +9,7 @@ - 1 consumer, get current line value, storing it and printing logs Usage - python rouge_files.py [-h] --ref REFERENCES_PATH --summ SUMMARIES_PATH + python rouge_files.py [-h] SUMMARIES_PATH REFERENCES_PATH [--verbose] [--no-verbose] [--avg] [--no-avg] [--progress] [--no-progress] @@ -182,8 +182,8 @@ def main(): parser = argparse.ArgumentParser(description="Multithreaded line by line ROUGE score of two files.") - parser.add_argument('--ref', help="Full ref file", required=True) - parser.add_argument('--summ', help="Summaries", required=True) + parser.add_argument("summary", help="Path of summary files") + parser.add_argument("reference", help="Path of references files") parser.add_argument('--verbose', dest='verbose', action='store_true') parser.add_argument('--no-verbose', dest='verbose', action='store_false') @@ -191,8 +191,8 @@ def main(): args = parser.parse_args() - ref_path = args.ref - summ_path = args.summ + ref_path = args.reference + summ_path = args.summary verbose = args.verbose stime = time()