Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not reproduce the rouge score. #44

Open
SefaZeng opened this issue Jul 20, 2023 · 0 comments
Open

Can not reproduce the rouge score. #44

SefaZeng opened this issue Jul 20, 2023 · 0 comments

Comments

@SefaZeng
Copy link

I try to reproduce the rouge results in model_annotations.aligned.scored.jsonl, and here is my script:

#coding:utf-8
import sys
import json
import argparse
from summ_eval.rouge_metric import RougeMetric

def get_rouge():
    rouge = RougeMetric()

    pred = [
        "paul merson was brought on with only seven minutes remaining in his team 's 0-0 draw with burnley . andros townsend scored the tottenham midfielder in the 89th minute . paul merson had another dig at andros townsend after his appearance . the midfielder had been brought on to the england squad last week . click here for all the latest arsenal news news .",
        "paul merson has restarted his row with andros townsend . the tottenham midfielder was brought on with only seven minutes remaining in his team 's 0-0 draw with burnley . andros townsend scores england 's equaliser in their 1-1 friendly draw with italy in turin ."
    ]

    refs = [
        ["Andros Townsend an 83rd minute sub in Tottenham's draw with Burnley. He was unable to find a winner as the game ended without a goal. Townsend had clashed with Paul Merson last week over England call-up. "],
        ["Andros Townsend an 83rd minute sub in Tottenham's draw with Burnley. He was unable to find a winner as the game ended without a goal. Townsend had clashed with Paul Merson last week over England call-up. "]
    ]
    for i in range(2):
        rouge_dict = rouge.evaluate_example(pred[i], refs[i])
        #print(rouge_dict)

        data = rouge_dict["rouge"]["rouge_1_f_score"]
        print(data)

def main():
    get_rouge()

if __name__ == "__main__":
    main()

And preds and refs are from model_annotations.aligned.scored.jsonl which are the first two results. And the result from this script are:

0.40404
0.36145

But the rouge_1_f_score in model_annotations.aligned.scored.jsonl is

0.40404
0.38554

So, the first sentence get the same result and the second one is not. The other results are also some the same and some different. How can I reproduce the result?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant