Session Ready
Exercise

Complete text reversing model

You will now implement the decoder part of the text reversing model, which will convert the context vector from the encoder to reversed words.

You will be defining two functions onehot2words() and decoder(). The onehot2words() function takes in a list of ids and a dictionary index2word and converts an array of one-hot vectors to a list of words. The decoder() function takes in the context vector (i.e., list of word ids) and converts it to the reversed list of words.

For this exercise, the index2word dictionary, the context vector context, the encoder() function and the words2onehot() functions will be provided.

Instructions 1/3
undefined XP
  • 1
  • 2
  • 3
  • Define the onehot2words() function, which obtains word IDs from one-hot vectors and then convert the IDs to words.