最初安装pyrouge:
pip install 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 /home/eric/Documents/text_summarization/pyrouge/tools/ROUGE-1.5.5
自己找到pyrouge的tools目录下的ROUGE-1.5.5就行了
WordNet-2.0.exc.db
还可能出现下面的问题:
Cannot open exception db file for reading: yourpath/rouge/tools/ROUGE-1.5.5/data/WordNet-2.0.exc.db
下面的方法可以解决测试:
pyrouge/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
参考文献
[1].How to Install pyrouge. https://nomoto-eriko.hatenablog.com/
[2].pyrouge. https://github.com/andersjo/pyrouge
[3].Error when running testing 'FileNotFoundError: [Errno 2] No such file or directory: '/root/.pyrouge/settings.ini'' . https://github.com/nlpyang/BertSum/issues/63