Created
October 3, 2022 22:52
-
-
Save andrea-dagostino/f2f579e68604f14f327b1d338bc7d8d7 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
| top = similarity_df[similarity_df > 0.4] # change this | |
| mask = np.triu(np.ones_like(top)) | |
| # let's create the viz | |
| plt.figure(figsize=(12, 12)) | |
| sns.heatmap( | |
| top, | |
| square=True, | |
| annot=True, | |
| robust=True, | |
| fmt='.2f', | |
| annot_kws={'size': 7, 'fontweight': 'bold'}, | |
| yticklabels=top.columns | |
| xticklabels=top.columns, | |
| cmap="YlGnBu", | |
| mask=mask | |
| ) | |
| plt.title('Similarity heatmap', fontdict={'fontsize': 24}) | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment