bheinzerling / pyrouge

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

Can't locate XML/Parser.pm in @INC #27

Open sajastu opened 5 years ago

sajastu commented 5 years ago

Hi,

I get this error when trying to run pyrouge.

Can't locate XML/Parser.pm in @INC (you may need to install the XML::Parser module) (@INC contains: ROUGE-1.5.5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ROUGE-1.5.5/XML/DOM.pm line 41. BEGIN failed--compilation aborted at ROUGE-1.5.5/XML/DOM.pm line 70. Compilation failed in require at ROUGE-1.5.5/ROUGE-1.5.5.pl line 177. BEGIN failed--compilation aborted at ROUGE-1.5.5/ROUGE-1.5.5.pl line 177. Traceback (most recent call last): File "official_rouge.py", line 56, in main() File "official_rouge.py", line 52, in main print_results(evaluate(args.gold, args.pred)) File "official_rouge.py", line 31, in evaluate output = r.convert_and_evaluate() File "/home/sajad/anaconda3/lib/python3.6/site-packages/pyrouge/Rouge155.py", line 361, in convert_and_evaluate rouge_output = self.evaluate(system_id, rouge_args) File "/home/sajad/anaconda3/lib/python3.6/site-packages/pyrouge/Rouge155.py", line 336, in evaluate rouge_output = check_output(command).decode("UTF-8") File "/home/sajad/anaconda3/lib/python3.6/subprocess.py", line 336, in check_output **kwargs).stdout File "/home/sajad/anaconda3/lib/python3.6/subprocess.py", line 418, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['ROUGE-1.5.5/ROUGE-1.5.5.pl', '-e', 'ROUGE-1.5.5/data', '-c', '95', '-2', '-1', '-U', '-r', '1000', '-n', '4', '-w', '1.2', '-a', '-m', '/tmp/tmpub309057/rouge_conf.xml']' returned non-zero exit status 2.

I gotta say that I've installed XML::Parser via cpan XML::Parser.

Any ideas?

Thanks!

coree commented 5 years ago

For me the command sudo apt-get install libxml-parser-perl worked. However, the parser was not installed in my case.