Got error (attached). Any advice?
From what I understand the ‘and’ word its not part of the english_vecs dictionary! You probably have not built that dictionary correctly!
@gent.spah
Before the exercise, there is ‘and’ shown in en_fr_train.
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
-
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. -
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() -
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( ) -
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.
Regards
DP
Thank you all! I have passed this exercise.