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

Adding MoverScore #11

Open
forrestbao opened this issue Dec 4, 2022 · 5 comments
Open

Adding MoverScore #11

forrestbao opened this issue Dec 4, 2022 · 5 comments
Assignees

Comments

@forrestbao
Copy link
Contributor

Like BertScore and BLEURT, MoverScore is another modern transformer-based reference-based summerization metric.

However, we did not include it in our pilot study. Now maybe a good time to add it.

Unfortunately, HF's evaluate library does not included it. But the original author seems to have provided a good package: https://pypi.org/project/moverscore/ And the Github source is here: https://github.com/AIPHES/emnlp19-moverscore

Let's add it. Note to be fair and square (#10), let's use a RoBERTa-large based model. To select a model, see here. The model name is the model name in HuggingFace. So we can simply use RoBERTa-large (generally trained).

@TURX
Copy link
Collaborator

TURX commented Dec 9, 2022

Is this to be included in evalbase or DocAsRef?

@forrestbao
Copy link
Contributor Author

I think DocAsRef.
How do did you run your experiments? I think you should define your metrics, and the import EvalBase's top level functions to evaluate, do you?

@forrestbao
Copy link
Contributor Author

I think MoverScore should be added into DocAsRef. Any metrics developed or benchmarked by us for the ACL 2023 submission should go to DocAsRef.

To evaluate, just go to EvalBase/env.py, import metrics from DocAsRef folder, and then add the imported metrics in the metrics dictionary. Then run EvalBase's experiment files, i.e., {summeval, realsumm, newsroom}.py

@TURX
Copy link
Collaborator

TURX commented Dec 10, 2022

moverscore_v2 runs on CPU. moverscore runs on GPU but unable to change model.

Refs:
https://github.com/AIPHES/emnlp19-moverscore/blob/master/moverscore.py
https://github.com/AIPHES/emnlp19-moverscore/blob/master/moverscore_v2.py

@forrestbao
Copy link
Contributor Author

forrestbao commented Dec 10, 2022

It's because MoverScore_v2 does not move variables to GPU.
Compare all lines in Moverscore that has device=device vs. those in MoverScore_v2 without this kwarg.
Or search for cuda:0 or .to(device in MoverScore code.
Such as the lines below in MoverScore

    padded, lens, mask = padding(arr, pad_token, dtype=torch.long)
    padded_idf, _, _ = padding(idf_weights, pad_token, dtype=torch.float)


    padded = padded.to(device=device)
    mask = mask.to(device=device)
    lens = lens.to(device=device)
    return padded, padded_idf, lens, mask, tokens

vs. the lines below in MoverScore_v2

    padded, lens, mask = padding(arr, pad_token, dtype=torch.long)
    padded_idf, _, _ = padding(idf_weights, pad_token, dtype=torch.float)

    return padded, padded_idf, lens, mask, tokens

Maybe you can give them a PR.

TURX added a commit that referenced this issue Dec 11, 2022
minor: classical metrics, moverscore topk
fix: #6, #7, #11
rm: obsolete achived_experiments
tofix: moverscore truncation & corr, pipeline refactor to automodel
@TURX TURX assigned forrestbao and unassigned TURX Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants