Compute cosine similarity between each row in A and each row in B
(A, B)
| 310 | |
| 311 | |
| 312 | def cosine_sim_matrix(A, B): |
| 313 | """Compute cosine similarity between each row in A and each row in B""" |
| 314 | A = normalize(A, norm='l2', axis=1) |
| 315 | B = normalize(B, norm='l2', axis=1) |
| 316 | return np.dot(A, B.T) |
| 317 | |
| 318 | |
| 319 | def generate_brute_force_results(dataset_name, quick_test=False): |
nothing calls this directly
no outgoing calls
no test coverage detected