def draw_features_and_similarity(mm, words_of_interest):
rows, cols, xlabels = mm.filter_submatrix(words_of_interest, 25)
ax = plt.subplot(1, 2, 1)
plot_heat(ax, cols, xlabels, words_of_interest)
# plot_heat(ax,abs(m),numbered)
ax = plt.subplot(1, 2, 2)
t = 1 - pairwise_distances(rows, metric="cosine")
np.fill_diagonal(t, 0)
plot_heat(ax, t, words_of_interest, words_of_interest)
# plt.savefig("m1.pdf")
评论列表
文章目录