赞
踩
from rouge import FilesRouge
files_rouge = FilesRouge()
hyp1_path="name1.txt"
ref_path="name2.txt"
# 按照行计算,每行计算一个rouge
scores = files_rouge.get_scores(hyp1_path, ref_path, avg=False)
#对整个文本的rouge 分数做一个平均
scores = files_rouge.get_scores(hyp1_path, ref_path, avg=True)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。