Problem finding vector for word "and"

in “C1_W4_Assignment” when trying to solve #UNQ_C1, I need the value for the vector of the word “and” in order to be able to get matrix. but “en_embeddings_subset” fails to provide me with that value and I get a “key error”. has anyone faced this problem?

Hey @Aynaz_Abdollahzadeh,
Welcome to the community. You are not supposed to use any global variables in your implementation unless stated otherwise. If you think you need them, then you are likely to be thinking in the wrong direction. For implementation of this function, all you need are the dictionaries that are passed in the function as arguments. I hope this helps.

Cheers,
Elemento

Hello.
I don’t think i illustrated my problem correctly. When implementing the function “get_matrices”, i need the “english embedding” to carry the english word vectors of the words in the “en_fr” dicts, which ‘and’ happens to be one. Sadly i get an error here because “english_vecs” does not seem to carry this vector.

Hopefully i was able to state my problem better this time. Thanks for your time.

Hey @Aynaz_Abdollahzadeh,
Yes, to avoid that error, you are supposed to check first whether the English and the French words from the en_fr dictionary are present in the english_set and french_set dictionaries respectively or not. If not, then you can simply skip that pair, otherwise, you can go ahead, get their vectors and store them in their respective lists.

Cheers,
Elemento

thank you so much this helps!!