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 regard measurement #271

Merged
merged 26 commits into from
Sep 19, 2022
Merged

Adding regard measurement #271

merged 26 commits into from
Sep 19, 2022

Conversation

sashavor
Copy link
Contributor

This code is pretty clunky, so I would love thoughts about how to get the list comprehension to work better, @mathemakitten !

Also, one of the initial use cases for regard was to compare the values for several populations (e.g. men and women, for instance), so would it make sense to have either the default or optional behavior to be something like:

results = regard.compute(group1 = ['he is a soldier', 'the men are violent', 'George is a gangster'], group2= ['she is a nice girl', 'the women are housewives', 'Kelly is an actress'])

and then the result would be the difference in regard between the two groups?

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 22, 2022

The documentation is not available anymore as the PR was closed or merged.

measurements/regard/regard.py Outdated Show resolved Hide resolved
measurements/regard/regard.py Outdated Show resolved Hide resolved
measurements/regard/regard.py Outdated Show resolved Hide resolved
measurements/regard/README.md Outdated Show resolved Hide resolved
Sasha Luccioni and others added 4 commits August 25, 2022 15:44
Co-authored-by: helen <31600291+mathemakitten@users.noreply.github.com>
Co-authored-by: helen <31600291+mathemakitten@users.noreply.github.com>
Co-authored-by: helen <31600291+mathemakitten@users.noreply.github.com>
Copy link
Contributor

@mathemakitten mathemakitten left a comment

Choose a reason for hiding this comment

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

I like the comparison between groups! Once the example TODOs and the README/formatting get updated I think it should be pretty much good to go, pinging @lvwerra for any further thoughts

measurements/regard/regard.py Outdated Show resolved Hide resolved
Copy link
Member

@lvwerra lvwerra left a comment

Choose a reason for hiding this comment

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

Thanks for adding this! Looks good overall! Two comments:

  • If we want to keep this a measurement (which are primarily applied to datasets) I suggest switching prediction -> data to comply with the other measurements.
  • I left a few suggestions to simplify a few things with list comprehensions.

measurements/regard/regard.py Outdated Show resolved Hide resolved
measurements/regard/requirements.txt Outdated Show resolved Hide resolved
measurements/regard/regard.py Outdated Show resolved Hide resolved
measurements/regard/regard.py Outdated Show resolved Hide resolved
Sasha Luccioni and others added 5 commits August 30, 2022 13:21
changing `predictions` to `data`
changing predictions to data
Co-authored-by: Leandro von Werra <lvwerra@users.noreply.github.com>
Co-authored-by: Leandro von Werra <lvwerra@users.noreply.github.com>
@sashavor
Copy link
Contributor Author

Changed predictions to data and integrated your other suggestions! Thanks @lvwerra 🤗

@sashavor sashavor changed the title Initial commit of regard measurement Adding regard measurement Sep 2, 2022
Copy link
Contributor

@mathemakitten mathemakitten left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Member

@lvwerra lvwerra left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

Just a minor request to check the config name.


@evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
class Regard(evaluate.Measurement):
def _info(self):
Copy link
Member

Choose a reason for hiding this comment

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

I would do a check if the config name is either compare or default. checkout the glue metrics for an example of how to do this.

Copy link
Member

Choose a reason for hiding this comment

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

otherwise if you mistype compare you will silently get the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

like this? (line 121)

Sasha Luccioni and others added 2 commits September 6, 2022 19:49
@sashavor sashavor merged commit 283a1f0 into main Sep 19, 2022
@sashavor sashavor deleted the regard-measurement branch September 19, 2022 15:55
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.

None yet

4 participants