赞
踩
pip install pyrouge
如报错:
Cannot open exception db file for reading: data/WordNet-2.0.exc.db
则执行以下命令:
cd /home/yzhao/soft/ROUGE-1.5.5/RELEASE-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
- from pyrouge import Rouge155
-
- r = Rouge155('/home/yzhao/soft/ROUGE-1.5.5/RELEASE-1.5.5')
- r.system_dir = '/mnt/hgfs/NLP/document summarization/MyProject/docs/system'
- r.model_dir = '/mnt/hgfs/NLP/document summarization/MyProject/docs/gold'
- r.system_filename_pattern = 'system.(\d+).txt'
- r.model_filename_pattern = 'gold.[A-Z].#ID#.txt'
-
- output = r.convert_and_evaluate()
- print(output)
- out
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。