tensorflow / nmt

TensorFlow Neural Machine Translation Tutorial
Apache License 2.0
6.36k stars 1.96k forks source link

Bleu always 0.0 on my own training results. #351

Closed SiZuo closed 6 years ago

SiZuo commented 6 years ago

I tried to used the bleu.py for my translation result but the score always 0.0. Even I test on same sentences like

reference = [['this','is','a','test'], ['this','is','a','test']] translation = [['this','is','a','test'],['this','is','a','test']]

The score still zero. And I am quite confused about this part, why the reference_length and translation_length are calculated in different way?

for (references, translation) in zip(reference_corpus, translation_corpus): reference_length += min(len(r) for r in references) translation_length += len(translation)