Data Science, Machine Learning.
a.multiply(b.transpose()) which is more or less what cosine_similatiry does. # Pseudocode... a_mat = tfidf_vect.fit_transform([..., ..., ...]) b_mat = tfidf_vect.fit_transform([..., ..., ...]) a_block_mat = create_block_matrix(a) b_block_mat_tr = create_block_matrix(b.transpose()) cosimilarities =