installing pyrouge gets error in ubuntu
Asked Answered
A

3

6

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?

Astonishing answered 26/8, 2017 at 10:4 Comment(0)
A
7

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.

Astonishing answered 27/8, 2017 at 13:50 Comment(3)
A bit strange. I get the same error even by installing the latest version. Did you get past that error? Did you do anything more than these you mentioned?Automatism
This. This answer is the perfect tutorial on how to get pyrouge working. I met a problem : pkg_resources.ResolutionError: Script 'scripts/pyrouge_set_rouge_path' not found when setting the rouge path. To fix it, I removed my old pyrouge (installed with pip) : pip uninstall pyrouge And change the cmd python setup.py install into pip install -e .Macronucleus
For completion, you might still have some issue following the steps of this answer. Here is the links to refer : github.com/bheinzerling/pyrouge/issues/27 github.com/bheinzerling/pyrouge/issues/8Macronucleus
M
18

All the steps to follow (only for Linux):

Step 1 : Install Pyrouge from source (not from pip)

git clone https://github.com/bheinzerling/pyrouge
cd pyrouge
pip install -e .

Step 2 : Install official ROUGE script

git clone https://github.com/andersjo/pyrouge.git rouge

Step 3 : Point Pyrouge to official rouge script

pyrouge_set_rouge_path ~/pyrouge/rouge/tools/ROUGE-1.5.5/

The path given to pyrouge should be absolute path !

Step 4 : Install libxml parser

As mentioned in this issue, you need to install libxml parser :

sudo apt-get install libxml-parser-perl

Step 5 : Regenerate the Exceptions DB

As mentioned in this issue, you need to regenerate the Exceptions DB :

cd rouge/tools/ROUGE-1.5.5/data
rm WordNet-2.0.exc.db
./WordNet-2.0-Exceptions/buildExeptionDB.pl ./WordNet-2.0-Exceptions ./smart_common_words.txt ./WordNet-2.0.exc.db

Step 6 : Run the tests

python -m pyrouge.test

You should see :

Ran 11 tests in 6.322s
OK

Macronucleus answered 28/8, 2019 at 6:16 Comment(1)
Thank you very much @Astariul. Problem solved thanks to your kind explanatory stepsFormyl
A
7

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.

Astonishing answered 27/8, 2017 at 13:50 Comment(3)
A bit strange. I get the same error even by installing the latest version. Did you get past that error? Did you do anything more than these you mentioned?Automatism
This. This answer is the perfect tutorial on how to get pyrouge working. I met a problem : pkg_resources.ResolutionError: Script 'scripts/pyrouge_set_rouge_path' not found when setting the rouge path. To fix it, I removed my old pyrouge (installed with pip) : pip uninstall pyrouge And change the cmd python setup.py install into pip install -e .Macronucleus
For completion, you might still have some issue following the steps of this answer. Here is the links to refer : github.com/bheinzerling/pyrouge/issues/27 github.com/bheinzerling/pyrouge/issues/8Macronucleus
U
0

you need the following packages in CentOS:

sudo yum install "perl(XML::LibXML)"

yum install perl-DB_File

Underground answered 26/9, 2021 at 5:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.