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

Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF #696

Merged
merged 11 commits into from
Jan 4, 2022

Conversation

ashutoshml
Copy link
Contributor

@ashutoshml ashutoshml commented Dec 28, 2021

What does this PR do?

Fixes #686

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃
Yes.

@ashutoshml ashutoshml changed the title Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF [WIP] Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF Dec 28, 2021
@codecov
Copy link

codecov bot commented Dec 28, 2021

Codecov Report

Merging #696 (1711a17) into master (df4d3c8) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #696   +/-   ##
=====================================
  Coverage      95%    95%           
=====================================
  Files         166    166           
  Lines        6413   6421    +8     
=====================================
+ Hits         6105   6114    +9     
+ Misses        308    307    -1     

@ashutoshml ashutoshml marked this pull request as ready for review December 28, 2021 14:57
@ashutoshml ashutoshml changed the title [WIP] Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF Dec 28, 2021
@ashutoshml ashutoshml marked this pull request as draft December 28, 2021 17:51
@ashutoshml ashutoshml changed the title Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF [WIP] Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF Dec 28, 2021
@Borda Borda added API / design enhancement New feature or request labels Dec 28, 2021
@Borda Borda added this to the v0.7 milestone Dec 28, 2021
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

lets use everywhere preds and targets

tests/text/test_bleu.py Outdated Show resolved Hide resolved
tests/text/test_bleu.py Outdated Show resolved Hide resolved
@Borda
Copy link
Member

Borda commented Jan 3, 2022

@ashutoshml how is it going here, what is missing?
@stancld could you assist to get it to merge quickly...

@stancld
Copy link
Contributor

stancld commented Jan 3, 2022

@ashutoshml how is it going here, what is missing? @stancld could you assist to get it to merge quickly...

@Borda I think we were not fully sure with the naming. But @ashutoshml, it's preds, target everywhere for sure, so ping me whenever this PR is ready for review :] Sorry for some confusion

@Borda
Copy link
Member

Borda commented Jan 3, 2022

Let's keep it moving, can we limit this PR just to switching the order as it is stated in the PR title and do the rename package-wide in another PR as it will require another deprecation/compatibility edits 🐰 @stancld @ashutoshml
cc: @justusschock @SkafteNicki

@ashutoshml
Copy link
Contributor Author

Let's keep it moving, can we limit this PR just to switching the order as it is stated in the PR title and do the rename package-wide in another PR as it will require another deprecation/compatibility edits 🐰 @stancld @ashutoshml cc: @justusschock @SkafteNicki

If the naming convention is not an issue, then the PR is ready for review. The order issue has been fixed.

@ashutoshml ashutoshml marked this pull request as ready for review January 3, 2022 09:14
@ashutoshml ashutoshml changed the title [WIP] Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF Jan 3, 2022
@Borda
Copy link
Member

Borda commented Jan 3, 2022

If the naming convention is not an issue, then the PR is ready for review. The order issue has been fixed.

yes, but in such a case pls ever all name changes or you need to also include all deprecation for argument's name changes... :]

@ashutoshml
Copy link
Contributor Author

If the naming convention is not an issue, then the PR is ready for review. The order issue has been fixed.

yes, but in such a case pls ever all name changes or you need to also include all deprecation for argument's name changes... :]

I see. I'll revert all naming to previous ones then, and only modify the order. I will make the changes latest by tomorrow.

@ashutoshml ashutoshml marked this pull request as draft January 3, 2022 10:04
@ashutoshml ashutoshml changed the title Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF [WIP] Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF Jan 3, 2022
@ashutoshml ashutoshml changed the title [WIP] Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF Unify the input order for text (NLG) metrics - BLEU, SacreBLEU, TER, CHRF Jan 3, 2022
@ashutoshml ashutoshml marked this pull request as ready for review January 3, 2022 14:03
@ashutoshml
Copy link
Contributor Author

@Borda @stancld Please have a look

torchmetrics/functional/text/bleu.py Outdated Show resolved Hide resolved
torchmetrics/functional/text/sacre_bleu.py Outdated Show resolved Hide resolved
torchmetrics/text/bleu.py Outdated Show resolved Hide resolved
@Borda Borda requested a review from stancld January 3, 2022 14:54
@Borda Borda enabled auto-merge (squash) January 3, 2022 14:55
@Borda
Copy link
Member

Borda commented Jan 3, 2022

@Borda @stancld Please have a look

cool, @ashutoshml do you want to prepare the next one with rename arguments to be TM-wide consistent or @stancld?

Copy link
Contributor

@stancld stancld left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work, thanks a lot @ashutoshml

@ashutoshml
Copy link
Contributor Author

@Borda @stancld Please have a look

cool, @ashutoshml do you want to prepare the next one with rename arguments to be TM-wide consistent or @stancld?

That might need changing all the files. Would it be ok to split the metrics into multiple PRs? 4-4-4 or 6-6 since there are 12 text metrics.

@Borda
Copy link
Member

Borda commented Jan 3, 2022

That might need changing all the files. Would it be ok to split the metrics into multiple PRs? 4-4-4 or 6-6 since there are 12 text metrics.

sure, that sounds good to me... if you split it 6-6 you can also divide work so 6 for @ashutoshml and 6 for @stancld? 🐰

@stancld
Copy link
Contributor

stancld commented Jan 3, 2022

That might need changing all the files. Would it be ok to split the metrics into multiple PRs? 4-4-4 or 6-6 since there are 12 text metrics.

sure, that sounds good to me... if you split it 6-6 you can also divide work so 6 for @ashutoshml and 6 for @stancld? 🐰

@ashutoshml Just let me know which metrics you are taking and I'll handle the remaining ones :]

@stancld
Copy link
Contributor

stancld commented Jan 3, 2022

@Borda @SkafteNicki

Those failing tests seem to be unrelated to this PR:

ERROR torchmetrics/audio/pesq.py - ValueError: numpy.ndarray size changed, ma...
ERROR torchmetrics/functional/audio/pesq.py - ValueError: numpy.ndarray size ...
ERROR tests/audio/test_pesq.py - ValueError: numpy.ndarray size changed, may ...
ERROR tests/audio/test_pesq.py - ValueError: numpy.ndarray size changed, may ...

Can it be merged then? :]

@Borda
Copy link
Member

Borda commented Jan 3, 2022

Those failing tests seem to be unrelated to this PR:

do they fail also on master? :]

@stancld
Copy link
Contributor

stancld commented Jan 3, 2022

Those failing tests seem to be unrelated to this PR:

do they fail also on master? :]

With the most recent commit #705, these tests are currently failing on the master too. I can have a look at them

@ashutoshml
Copy link
Contributor Author

That might need changing all the files. Would it be ok to split the metrics into multiple PRs? 4-4-4 or 6-6 since there are 12 text metrics.

sure, that sounds good to me... if you split it 6-6 you can also divide work so 6 for @ashutoshml and 6 for @stancld? 🐰

@ashutoshml Just let me know which metrics you are taking and I'll handle the remaining ones :]

@stancld I'll take cer, ter, wer, sacrebleu, rouge, squad. Kindly let me know when you create an issue and assign it to me.

@Borda Borda disabled auto-merge January 4, 2022 19:16
@Borda Borda merged commit a66ee8a into Lightning-AI:master Jan 4, 2022
@ashutoshml ashutoshml deleted the standardization branch January 4, 2022 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify the input order for text (NLG) metrics
4 participants