Skip to content

Instantly share code, notes, and snippets.

@andrea-dagostino
Created October 3, 2022 09:05
Show Gist options
  • Select an option

  • Save andrea-dagostino/05669b58aae368c8163f2e486c18afaf to your computer and use it in GitHub Desktop.

Select an option

Save andrea-dagostino/05669b58aae368c8163f2e486c18afaf to your computer and use it in GitHub Desktop.
text_sim_tfidf
M = np.zeros((posts.shape[0], posts.shape[0])) # creiamo una matrice 30x30 per contenere i risultati di testo_i con testo_j
for i, row in tqdm(posts.iterrows(), total=posts.shape[0], desc='1st level'): # definiamo i
for j, next_row in posts.iterrows(): # definiamo j
M[i, j] = compute_similarity(row.article, next_row.article) # popoliamo la matrice con i risultati
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment