使用pyrouge踩过的坑

FileNotFoundError: [Errno 2] No such file or directory: ‘yourpath/.pyrouge/settings.ini’

解决方法

git clone https://github.com/andersjo/pyrouge.git 
pyrouge_set_rouge_path /your/absolute/path/to/pyrouge/tools/ROUGE-1.5.5

Exception: Cannot set data directory because the path /absolute/path/to/ROUGE-1.5.5/directory/data does not exist.

解决方法

git clone https://github.com/andersjo/pyrouge.git 
pyrouge_set_rouge_path /your/absolute/path/to/pyrouge/tools/ROUGE-1.5.5

Can’t locate XML/Parser.pm in @INC

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):
........

解决方法

sudo apt-get install libxml-parser-perl

Cannot open exception db file for reading: yourpath/rouge/tools/ROUGE-1.5.5/data/WordNet-2.0.exc.db

cd data/WordNet-2.0-Exceptions/
rm WordNet-2.0.exc.db # only if exist
./buildExeptionDB.pl . exc WordNet-2.0.exc.db

cd ../
rm WordNet-2.0.exc.db # only if exist
ln -s WordNet-2.0-Exceptions/WordNet-2.0.exc.db WordNet-2.0.exc.db

参考资料:

  1. https://stackoverflow.com/questions/45894212/installing-pyrouge-gets-error-in-ubuntu
  2. https://github.com/masters-info-nantes/ter-resume-auto/blob/master/README.md
  3. https://blog.csdn.net/w5688414/article/details/103799320
  4. https://pypi.org/project/pyrouge/0.1.0/
  5. https://github.com/bheinzerling/pyrouge/issues/27
  6. https://ireneli.eu/2018/01/11/working-with-rouge-1-5-5-evaluation-metric-in-python/
  7. https://github.com/masters-info-nantes/ter-resume-auto/blob/master/README.md

你可能感兴趣的:(踩坑记录,文本摘要,评估,linux,python,自然语言处理,机器学习,perl)