1. Learn
  2. /
  3. Courses
  4. /
  5. Machine Translation with Keras

Exercise

Training the model

Did you know that in 2017, Google translate served more than 500 million users daily?

Here, you will train your first Teacher Forced model. Teacher Forcing is commonly used in sequence to sequence models like your neural machine translator to achieve better performance.

You will be provided with the sents2seqs() function, English sentences en_text and French sentences fr_text.

Instructions

100 XP
  • Get the decoder input which contains the onehot encoded sequences of French words (except for the last word in every sequence).
  • Get the decoder output which contains the onehot encoded sequences of French words (except for the first word in every sequence).
  • Train the model on a single batch of data.
  • Obtain the evaluation metrics (loss and accuracy) for training data en_x, de_x and de_y.