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?
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.
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.
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
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.
thank you so much this helps!!