When I ran the final unit test on UNQ10:
# UNIT TEST
# test mbr_decode
w1_unittest.test_mbr_decode(target=mbr_decode, score_fn=average_overlap, similarity_fn=rouge1_similarity)
I got the following result:
Expected output does not match
3 Tests passed
1 Tests failed
So, I added various print stmts to my code in order to better understand where the problem lay. The results I got were as follows:
+++++++++++++++++++++++++++++++++++++++++++++++
sentence I eat soup.
n_samples 4
temperature 0.6
---> 0 -0.0003108978271484375 0.999689150496573 Ich iss Suppe.
---> 1 -0.0003108978271484375 0.999689150496573 Ich iss Suppe.
---> 2 -0.000225067138671875 0.9997749581870365 Ich esse Schweine.
---> 3 -0.000110626220703125 0.9998893798981516 Ich esse Suppe.
3 -0.000110626220703125
translated_sentence Ich esse Suppe. 0.9998893798981516
+++++++++++++++++++++++++++++++++++++++++++++++
Expected output does not match
+++++++++++++++++++++++++++++++++++++++++++++++
sentence I am hungry
n_samples 4
temperature 0.6
---> 0 -1.2909164428710938 0.27501862870316235 Ich bin hungrig da
---> 1 -2.09808349609375e-05 0.9999790193851352 Ich bin hungrig.
---> 2 -2.09808349609375e-05 0.9999790193851352 Ich bin hungrig.
---> 3 -2.09808349609375e-05 0.9999790193851352 Ich bin hungrig.
3 -2.09808349609375e-05
translated_sentence Ich bin hungrig. 0.9999790193851352
+++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++
sentence Congratulations!
n_samples 4
temperature 0.6
---> 0 -3.814697265625e-06 0.9999961853100103 Herzlichen GlĂźckwunsch!
---> 1 -3.814697265625e-06 0.9999961853100103 Herzlichen GlĂźckwunsch!
---> 2 -3.814697265625e-05 0.9999618537549303 Ich gratuliere Ihnen!
---> 3 -3.814697265625e-06 0.9999961853100103 Herzlichen GlĂźckwunsch!
3 -3.814697265625e-06
translated_sentence Herzlichen GlĂźckwunsch! 0.9999961853100103
+++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++
sentence You have completed the assignment!
n_samples 4
temperature 0.6
---> 0 -0.000232696533203125 0.9997673305385353 Sie haben die Aufgabe erfĂźllt!
---> 1 -4.9591064453125e-05 0.9999504101651634 Sie haben die Abmeldung abgeschlossen!
---> 2 -2.47955322265625e-05 0.9999752047751801 Sie haben die Abtretung abgeschlossen!
---> 3 -2.47955322265625e-05 0.9999752047751801 Sie haben die Abtretung abgeschlossen!
3 -2.47955322265625e-05
translated_sentence Sie haben die Abtretung abgeschlossen! 0.9999752047751801
+++++++++++++++++++++++++++++++++++++++++++++++
3 Tests passed
1 Tests failed
The error seems to lie in choosing âIch esse Suppeâ, instead of (I assume) âIch iss Suppeâ.
However, when I type either sentence into Google Translate, I get the English translation âI eat soupâ.
When I look at various web pages that describe the conjugation of the German verb âto eatâ by Googling âGerman verb eatâ (e.g. Essen German Conjugation | Study.com or Conjugation of essen (to eat) in German | coLanguage), I find that âesseâ tends to go with âIâ and âissâ (or âisstâ) tends to go with âyouâ or âhe/she/itâ.
So, now Iâm left wondering both how to debug(?) in order to favor one valid translation over another and if thereâs more stochasticity in NMTâs other than in the logsoftmax sampling function. Or, is there some other reason that explains why my code chose âesseâ over âissâ.
If anyone (who can) wants to see my code, the Lab ID is mjhlxfqb. I realize Iâm getting hung up on what is probably a minor point, but I have to admit itâs really bugging me.