C5W2 Exercise 3 - neutralize


if anyone can help on it? why the second result is wrong?

Where is ‘w’ defined?

sorry i changed w to below still wrong,
e = word_to_vec_map[w]
e = word_to_vec_map[word]
e = word_to_vec_map[“word”]

should i define w? or what you mean?

What I’m saying is:

  1. Please don’t post your code on the forum unless you’re asked to.
  2. The code comment instruction tells you what variable name to use.
  3. Look up the definitions of the numpy multiply and dot functions, and see which one should be used in this computation.

sorry TMosh,
after hours trying, i still can’t find the correct parameter to pass to. could you pls suggest? thanks

[word] is the correct parameter.

But that isn’t the biggest problem with your code.

You’re using np.multiply() where is is the wrong function to use. This gives you an incorrect result for the similarity after neutralizing.

thanks so much, it passed