Got error (attached). Any advice?

1 Like

From what I understand the ‘and’ word its not part of the english_vecs dictionary! You probably have not built that dictionary correctly!

Before the exercise, there is ‘and’ shown in en_fr_train.

1 Like

But look more carefully at the logic there: it is not en_fr_train that is used as the input for that statement, right? It is the English embeddings dictionary. Your logic needs to handle that case. My guess is that you have ignored some of the comments in the template code and they also mention this point in the instructions for this function.

Just because the word is in the translation dictionary does not guarantee that it has an embedding on both sides of the translation.


Hi @pongyuenlam

This output doesn’t signifies if you have recalled correctly the embedding subsets

your error shows you to check code lines for

  1. check that the french word has an embedding and that the english word has an embedding
    This code required you to check if french word in french_set and english word in english_set Embedding were recalled correctly.

  2. if point 1 was recalled as per above, then check
    loop through all english, french word pairs in the english French dictionary
    if for loop included English word, French word in English_french.items()

  3. if point 1 and 2 were recalled as mentioned, then check if
    get the english words (the keys in the dictionary) and store in a set()
    where you use set function to the English_vecs.keys( )

  4. But I feel your issue is mostly from the below code
    store the french words that are part of the english-french dictionary (these are the values of the dictionary)
    WHERE YOU REQUIRED TO USE set to the en_fr.values() to store the French words that are part of the English-french dictionary.



Thank you all! I have passed this exercise.