Created
October 3, 2022 22:13
-
-
Save andrea-dagostino/234fb9ebb01e3f7fe06dbd1b1e07c9e6 to your computer and use it in GitHub Desktop.
text_sim_tfidf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M = np.zeros((posts.shape[0], posts.shape[0])) # we create a 30x30 matrix to contain the results of article_i with article_j | |
for i, row in tqdm(posts.iterrows(), total=posts.shape[0], desc='1st level'): # we define i | |
for j, next_row in posts.iterrows(): # we define j | |
M[i, j] = compute_similarity(row.article, next_row.article) # we populate the matrix with the results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment