Help! Emoji_v3a exercise 2 model function

Average the word vectors of the words from the i’th training example

avg = sentence_to_avg(X(i), word_to_vec_map)

i’m having trouble in coding avg. i have no idea what to put instead of X(i)

TypeError: ‘numpy.ndarray’ object is not callable

I’m aware that when using sentence_to_avg(sentence, word_to_vec_map), sentence should be string and X is vector of (m, ). But i in range m, i think X(i) or similar stuffs like X(i, ), X[i], X[i, :] X(i, :slight_smile: should work but it doesn’t. Plz give me some advice, and little comment of difference between X() and X

A numpy array can be indexed via []. There’s a difference between __call__ and indexing