bheinzerling / pyrouge

A Python wrapper for the ROUGE summarization evaluation package
MIT License
250 stars 71 forks source link

Summary length restriction n_bytes or n_words #21

Open sriram-ramanathan opened 6 years ago

sriram-ramanathan commented 6 years ago

How to restrict summary length in pyrouge ?

The original ROUGE supports this feature [-b n-bytes|-l n-words]

Usage: ROUGE-1.5.4.pl [-a (evaluate all systems)] [-c cf] [-d (print per evaluation scores)] [-e ROUGE_EVAL_HOME] [-h (usage)] [-b n-bytes|-l n-words] [-m (use Porter stemmer)] [-n max-ngram] [-s (remove stopwords)] [-r number-of-samples (for resampling)] [-2 max-gap-length (if < 0 then no gap length limit)] [-3 <H|HM|HMR|HM1|HMR1|HMR2>] [-u (include unigram in skip-bigram) default no)] [-U (same as -u but also compute regular skip-bigram)] [-w weight (weighting factor for WLCS)] [-v (verbose)] [-x (do not calculate ROUGE-L)] [-f A|B (scoring formula)] [-p alpha (0 <= alpha <=1)] [-t 0|1|2 (count by token instead of sentence)] [-z <SEE|SPL|ISI|SIMPLE>]

[] -b: Only use the first n bytes in the system/peer summary for the evaluation. -l: Only use the first n words in the system/peer summary for the evaluation.
uhauha2929 commented 6 years ago

maybe it can be like this. output = r.convert_and_evaluate(rouge_args='-e /home/yzhao/soft/RELEASE-1.5.5/data -a -c 95 -U -n 2 -w 1.2 -b 75')