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

Reproducing bertscore #1

Closed
moussaKam opened this issue Feb 1, 2022 · 2 comments
Closed

Reproducing bertscore #1

moussaKam opened this issue Feb 1, 2022 · 2 comments

Comments

@moussaKam
Copy link

Hello,

Thank you for the great work,

I am trying to reproduce BertScore for Table 2, block 2 in you paper. Where you evaluate different metrics against one reference.
I assume that you are using the first reference in the list of references that you provide in the processed files.

So my code looks like that for example:

with open('data/processed/processed.summarization.cnndm') as f:
    data = json.load(f)
candidates = [data[el]['hypothesis'] for el in data]
references = [data[el]['references'][0] for el in data]

Then I'm running bertscore after saving the references and the candidates in files using:

bert-score -r references.txt -c candidates.txt -s --lang en -m bert-base-uncased --idf > bert_score.txt

I trained with\without --idfand with both bert-base-uncased and roberta-large.

In all cases I'm obtaining values different than those in the json file that I load as follows:

bertscore = [data[el]['ref_1']['bertscore_f1'] for el in data]

Can you tell me please what are the exact options that you use to compute bertscore?

@moussaKam moussaKam changed the title Reprducing bertscore Reproducing bertscore Feb 1, 2022
@ThomasScialom
Copy link
Owner

Hi,

I used the default configuration in my metric reporter, see in beametrics/metrics/metrics_hugging_face.py.

You can see that the model_type is set to 'bert-base-multilingual-cased', allowing the use of the same exact model for all the (multilingual) datasets.

Hope it can help.

Thom

@moussaKam
Copy link
Author

Great! Thank you!

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

2 participants