Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
open-nlp
/
Chris-lab
like
2
Sleeping
App
Files
Files
Community
2
64df9ac
Chris-lab
/
utils
/
metric.py
kz209
update
143b62d
5 months ago
raw
Copy download link
history
blame
Safe
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