Session Ready
Exercise

Predict the second character

In the previous exercise, you used the encoder and the decoder inference models to generate the first character from the start token. You provided the English sentence to the encoder inference model and got the states. The decoder inference model uses the encoder states along with the seed character to generate the first character of the translated sequence.

In this exercise, you'll use the seed character and the generated first character to generate the second character in the translated sentence. The decoder input states in this time-step will be set to the decoder output states while generating the first character.

This process can be repeated to generate the translated sentence character by character until the end token (\n) is encountered.

Instructions
100 XP
  • Get decoder output for the second character.
  • Map the decoder output to the French character.
  • Print the generated character.