Skip to content

Commit

Permalink
Positional argument instead of flags --summ & --ref
Browse files Browse the repository at this point in the history
  • Loading branch information
pltrdy committed Jan 24, 2017
1 parent b04afd7 commit ed035fa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions files2rouge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -182,17 +182,17 @@ 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')

parser.set_defaults(verbose=True)

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()
Expand Down

0 comments on commit ed035fa

Please sign in to comment.