Chris-lab / utils /metric.py
kz209
update
143b62d
raw
history blame
191 Bytes
from rouge_score import rouge_scorer
scorer = rouge_scorer.RougeScorer(['rougeL'], use_stemmer=True)
def metric_rouge_score(pred, ref):
return scorer.score(pred, ref)['rougeL'].fmeasure