import sklearn
sklearn.metrics.pairwise.cosine_similarity(word1_embed, word2_embed)
报错
经过查阅https://blog.csdn.net/fanyingkk/article/details/105577244,发现改成
from sklearn import metrics
metrics.pairwise.cosine_similarity(word1_embed, word2_embed)
才行,具体原因不太清楚厚