2 out of 4 tests for C4_W1 UNQ_C10 mbr_decode not passing

Hi there,

I have worked my way through C4_W1 assignment to the last exercise.

Everything seems fine and I am overall pretty happy with the result (as a German native speaker). However the unit test does not concur. It seemingly would prefer “Ich iss Suppe.”, whereas my model (correctly) outputs “Ich esse Suppe.”:

Samples: [‘Ich iss Suppe.’, ‘Ich iss Suppe.’, ‘Ich esse Schweine.’, ‘Ich esse Suppe.’]
Prob: [-0.0003108978271484375, -0.0003108978271484375, -0.000225067138671875, -0.000110626220703125]
max_score_key: 3
max value: -0.000110626220703125
Result: Ich esse Suppe.

What can I do to “fix” this so that the unit tests for the final example all pass? For now it is just 3 out of 4 that pass with the “soup” test failing. I saw someone else having the same problem (link) and I applied their fix (using the score_fn method) but it did not help me.

My notebook ID is HfmMq.

Thanks a lot &
Best,

Nevermind. I figured out my problem.

  1. I used log_probs instead of scores
  2. I did not see initially that “scores” is a dictionary, not a list
  3. Accordingly I did not know the right syntax to get the correct key for the largest value in python.
1 Like

Hey @Wolf_Fischer,
Welcome to the community. Thanks for informing us that your issue has been rectified.

Cheers,
Elemento