multi_lingual translation output makes no sense
So I finished training using multi_lingual translation, the inference process however makes no sense ... I don't understand the output at all. At first I thought something wrong was with the model, but then I tried to predict the training file, and still I got this output.
''' loading model(s) from /checkpoints/checkpoint50.pt | Type the input sentence and press return: S-0 Tell me what the notes are for South Australia H-0 -1.7617563009262085 ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] P-0 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -3.1305 S-1 What is the current series where the new series began? H-1 -1.7617563009262085 ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] P-1 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -3.1305 S-2 What is the format for South Australia? H-2 -1.7617563009262085 ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] P-2 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -1.7549 -3.1305
''' And here is my command: '' fairseq-interactive /raw-data/data-bin --task multilingual_translation --source-lang en --target-lang de --path /checkpoints/checkpoint50.pt --input /raw-data/train.en --beam 5 ''
Another question: is there a command argument to output the predictions into a file? I tried to look for it as well. Would appreciate your help.
Store the output in a file and use this
grep ^H out.txt | cut -f3 > pretty_out.txt
as given here https://github.com/pytorch/fairseq/tree/master/examples/translation#multilingual-translation in the last command that outputs bleu score. It's used as input to sacrebleu
@AyaNsar, sorry for the late reply.
Re: bad output translation Based on your example output, it looks like the model is not learned well. I would first check if we get low training loss after training. I can help to look into that if you are still having the problem. If that's the case, I will need the training log to debug.
Re: output the predictions into a file What @madaanpulkit provides is the good way to do it.