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?
All the steps to follow (only for Linux):
pip
)git clone https://github.com/bheinzerling/pyrouge
cd pyrouge
pip install -e .
git clone https://github.com/andersjo/pyrouge.git rouge
pyrouge_set_rouge_path ~/pyrouge/rouge/tools/ROUGE-1.5.5/
The path given to pyrouge should be absolute path !
As mentioned in this issue, you need to install libxml parser :
sudo apt-get install libxml-parser-perl
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
python -m pyrouge.test
You should see :
Ran 11 tests in 6.322s
OK
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With