Closed astariul closed 4 years ago
ROUGE-1 and ROUGE-L shouldn't return the same thing. This is weird
For the rouge2 metric you can do
rouge = nlp.load_metric('rouge')
with open("pred.txt") as p, open("ref.txt") as g:
for lp, lg in zip(p, g):
rouge.add(lp, lg)
score = rouge.compute(rouge_types=["rouge2"])
Note that I just did a PR to have both .add
and .add_batch
for metrics, that's why now this is rouge.add(lp, lg)
and not rouge.add([lp], [lg])
Well I just tested with the official script and both rouge1 and rougeL return exactly the same thing for the input you gave, so this is actually fine ^^
I hope it helped :)
I'm trying to use ROUGE metric, but I don't know how to get the ROUGE-2 metric.
I compute scores with :
then : (print only the F-score for readability)
It gives :
How can I get the ROUGE-2 score ?
Also, it's seems weird that ROUGE-1 and ROUGE-L scores are the same. Did I made a mistake ?
@lhoestq