Search code examples
pythonubuntusummarizationrouge

installing pyrouge gets error in ubuntu


i wants to install pyrouge in Ubuntu for the purpose of text summarization evaluation. i use the instructions in this.

first i wrote pip install pyrouge then i must write this command: pyrouge_set_rouge_path /absolute/path/to/ROUGE-1.5.5/directory.

In my system i wrote:

pyrouge_set_rouge_path /home/afsharizadeh/anaconda3/lib/python3.6/site-packages/pyrouge

and get this:

Exception: Cannot set data directory because the path /home/afsharizadeh/anaconda3/lib/python3.6/site-packages/pyrouge/data does not exist.

and also

pyrouge_set_rouge_path /home/afsharizadeh/pyrouge-0.1.0/pyrouge

and get this:

Exception: Cannot set data directory because the path /home/afsharizadeh/pyrouge-0.1.0/pyrouge/data does not exist.

and also

pyrouge_set_rouge_path /home/afsharizadeh/pyrouge-0.1.0/pyrouge/test

and get this:

Exception: ROUGE binary not found at /home/afsharizadeh/pyrouge-0.1.0/pyrouge/test/ROUGE-1.5.5.pl. Please set the correct path by running pyrouge_set_rouge_path /path/to/rouge/home.

i know that similar questions about this problem, was asked in stack overflow but i cant solve my problem because i don't know at all what is meant by this expression "ROUGE path". what is meant by "path to ROUGE-1.5.5"?

i know i have two directories about pyrouge. one of them is this path: ~/anaconda3/lib/python3.6/site-packages/pyrouge and the other is the directory that i was downloaded it from site. this path is: ~/pyrouge-0.1.0. this directory has three other directories whit names: bin, pyrouge, pyrouge.egg-info.

based on this page i wrote in this format:

set pyrouge_set_rouge_path=/home/afsharizadeh/anaconda3/lib/python3.6/site-packages/pyroug

after this kind of format,no errors appear but when after that i type:

python -m pyrouge.test 

i get this error:

Exception: Cannot set data directory because the path /home/afsharizadeh/anaconda3/lib/python3.6/site-packages/pyroug/data does not exist.

---------------------------------------------------------------------- Ran 11 tests in 0.592s

FAILED (errors=9)

what should i do?


Solution

  • Using the latest version of pyrouge on Github repo, the issue was solved. For this purpose, I replaced the following commands:

    pip install pyrouge
    pyrouge_set_rouge_path /absolute/path/to/ROUGE-1.5.5/directory
    python -m pyrouge.test
    

    with these commands:

    git clone https://github.com/bheinzerling/pyrouge
    cd pyrouge
    python setup.py install
    pyrouge_set_rouge_path /absolute/path/to/ROUGE-1.5.5/directory
    python -m pyrouge.test
    

    After doing this, Everything goes Okay and I get this successful message of testing:

    Ran 11 tests in 6.322s
    OK
    

    UPDATE: Note that you need to install the official version of ROUGE metric to get pyrouge working.