Cosine distance of vector to matrix
Below worked for me, have to provide correct signature

from scipy.spatial.distance import cosine

def cosine_distances(embedding_matrix, extracted_embedding):
  return cosine(embedding_matrix, extracted_embedding)
cosine_distances = np.vectorize(cosine_distances, signature='(m),(d)->()')

cosine_distances(corpus_embeddings, extracted_embedding)

In my case 
corpus_embeddings is a (10000,128) matrix
extracted_embedding is a 128-dimensional vector
In python, is there a vectorized efficient way to calculate the cosine distance of a sparse array u to a sparse matrix v, resulting in an array of elements [1, 2, ..., n] corresponding to cosine(u,v[0]), cosine(u,v[1]), ..., cosine(u, v[n])?