Install Rouge and Pyrouge for Python 2.7 (Conda virtual env) on Linux 64__linux

Source: Internet
Author: User

Who to complain the about this terrible package???? Its official website is down, it bugs and exceptions are famous, and its Python wrapper code has errors ... But everyone use it for summarization tasks. Not cool on all.

Can not help but spit, Rouge, a even official website has been closed, pure by inheritance, Super Epic rotten tail project, still so many people with ...

Pyrouge installed after the error actually changed the code to fix, you special do not set up the release can not?


Install Rouge and Pyrouge


Step 1:create A new Conda virtual env

Conda create-n py27env python=2.7 pip

SOURCE Activate Py27env

# use ' source deactivate ' to deactivate the env


Step 2:install Pyrouge by Conda to 3rd party

Conda install-c Auto Pyrouge


Step 3:download ROUGE-1.5.5 from the closed website by using a time machine (ask Einstein or go to Github), then copy ROU GE-1.5.5 to ~/rouge_path

CP RELEASE-1.5.5 ~/rouge/


Step 4:set ROUGE path for Pyrouge

Pyrouge_set_rouge_path ~/rouge/release-1.5.5


Step 5:install plugins for ROUGE-1.5.5

sudo cpan app::cpanminus

sudo cpanm XML::D om


Step 6:deal and Wordnet exceptions for ROUGE-1.5.5 (f**k)

CD ~/rouge/release-1.5.5/data/wordnet-2.0-exceptions/

./buildexeptiondb.pl. EXC wordnet-2.0.exc.db

Cd.. /

Ln-s wordnet-2.0-exceptions/wordnet-2.0.exc.db wordnet-2.0.exc.db


Step 7:deal with the test code errors for Pyrouge (f**k again!)

In rouge155_test.py file, your should modify two lines (refhttps://stackoverflow.com/a/41382391):

VI ~/.anaconda3/envs/py27env/lib/python2.7/site-packages/pyrouge/tests/rouge155_test.py

Modify

"Pyrouge_evaluate_plain_text_files.py-m {}-s {}-SFP"

To

"Pyrouge_evaluate_plain_text_files-m {}-s {}-SFP"

And, modify

"Pyrouge_write_config_file.py-m {m}-s {s}"

To

"Pyrouge_write_config_file-m {m}-s {s}"


Step 8:run test until "OK" appears.

>python-m Pyrouge.test

Ran Tests in 10.583s


Ok

Done.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.