当前位置:   article > 正文

pyrouge在Ubuntu下的使用_rouge-1.5.5参数

rouge-1.5.5参数
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
  1. from pyrouge import Rouge155
  2. r = Rouge155('/home/yzhao/soft/ROUGE-1.5.5/RELEASE-1.5.5')
  3. r.system_dir = '/mnt/hgfs/NLP/document summarization/MyProject/docs/system'
  4. r.model_dir = '/mnt/hgfs/NLP/document summarization/MyProject/docs/gold'
  5. r.system_filename_pattern = 'system.(\d+).txt'
  6. r.model_filename_pattern = 'gold.[A-Z].#ID#.txt'
  7. output = r.convert_and_evaluate()
  8. print(output)
  9. out
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/865955
推荐阅读
相关标签
  

闽ICP备14008679号