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

Add script for n_best parameter in topp/topk #2509

Merged
merged 3 commits into from
Nov 12, 2023

Conversation

PC91
Copy link
Contributor

@PC91 PC91 commented Nov 9, 2023

Implementation of this feature:

  • Sort the score of all hypotheses when there are more than 1.
  • Choose n_best results
  • Update unittest

@vince62s
Copy link
Member

vince62s commented Nov 9, 2023

Looks good thank you, have you tried to use it with this: https://github.com/OpenNMT/OpenNMT-py/blob/master/tools/mbr_bleu.py ?

@PC91
Copy link
Contributor Author

PC91 commented Nov 9, 2023

Looks good thank you, have you tried to use it with this: https://github.com/OpenNMT/OpenNMT-py/blob/master/tools/mbr_bleu.py ?

I did not see this tool. Will try it with the new feature

@PC91
Copy link
Contributor Author

PC91 commented Nov 10, 2023

Looks good thank you, have you tried to use it with this: https://github.com/OpenNMT/OpenNMT-py/blob/master/tools/mbr_bleu.py ?

@vince62s I tested on some configurations and that works well. Could you tell me how to test with this tool ? I understand that it outputs the hypothesis that has the maximum average BLEU score when comparing to others. But I'm not sure how it is related to the goodness of each hypothesis generated from topp/topk sampling. Thank you.

@vince62s
Copy link
Member

You can read this paper: https://arxiv.org/pdf/2111.09388.pdf
also in tools there are two others script oracle_bleu and oracle_comet
based on oracle_comet and mbr_bleu you could add mbr_comet (as in the paper).
The principle is simple just compare all hypothesis between each other and select the one giving the best bleu (resp Comet) vs all others. It should give some improvement over beam search best score.

@vince62s vince62s merged commit f3059a5 into OpenNMT:master Nov 12, 2023
2 checks passed
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.

2 participants