I am getting an error in the sentence_to_avg function. Can anyone please let me know the mistake in my code.

This is the error message:

you are looking up a word (words[0], in this case the word ‘love’) that’s not in the word_to_vec_map

I got it. Thanks for the help.

I’m also running into this problem. Any advice on how to get around ‘love’ not being in word_to_vec_map?

1 Like

some hint on how to skip not existing words please?

You have make use of “any_word” given in the code

1 Like

Isn’t any_word a string?Where do I use it?

hello. how can I use the any_word?
avg = np.zeros(word_to_vec_map[any_word]) ??
It doesn not work. Please help me more.

Hi @c15163 ,

You have to use the shape of any_word to create an array of that shape. Please see the comment explaining the input args.

To call it:


thank you. your comment is helpful.