We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, how to calculate the BLEU score for the German-English translation model developed in the article?
The text was updated successfully, but these errors were encountered:
Hi, you can use the library torchmetrics and its BLEUscore
torchmetrics
install the package
pip install torchmetrics
load the function
from torchmetrics.functional import bleu_score
and then add the following lines at the end of the check_outputs function
check_outputs
target = [" ".join(tgt_tokens).replace("\n", "")] preds = [model_txt.replace("\n", "")] print("BLEU score:", bleu_score(preds, target))
to display the BLEUscore on the examples.
Sorry, something went wrong.
No branches or pull requests
Hi, how to calculate the BLEU score for the German-English translation model developed in the article?
The text was updated successfully, but these errors were encountered: