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

feat: implement transforms for summarization accuracy metrics #211

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

danielezhu
Copy link
Contributor

Description of changes:
This PR implements Transforms for the three existing summarization accuracy metrics supported by fmeval: Meteor, Rouge, and Bert.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines +70 to +73
require(
set(input_keys) == {target_output_key, model_output_key},
f"input_keys to MeteorScore should be {target_output_key, model_output_key}.",
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why are target_output_key and model_output_key being passed as additional parameters, if input_keys should already contain these?

Is there a way we can remove the need to pass in repeated parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, so the reason I added them as additional parameters is that we need to be able to distinguish between the two. We could rely on a convention where input_keys[0] is always interpreted to be the target output key for example, but we both know that relying on conventions that aren't explicitly enforced by the code is a recipe for disaster.

Right now, the Transform ABC implementation coupled with the way we create copies of transforms in execute pretty much forces all transforms to have input_keys and output_keys as their first two arguments. So even though in this case, we'd ideally just not pass input_keys, under the current structure, we have to.

I'd like to make a follow up PR where I change things so that this is no longer the case, as I agree that it results in ugly, redundant code.

@danielezhu danielezhu merged commit e98d590 into aws:main Mar 11, 2024
3 checks passed
@danielezhu danielezhu deleted the summ_acc_metrics branch March 11, 2024 20:58
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

Successfully merging this pull request may close these issues.

3 participants