sklearn.metrics报错

import sklearn
sklearn.metrics.pairwise.cosine_similarity(word1_embed, word2_embed)

报错
sklearn.metrics报错_第1张图片经过查阅https://blog.csdn.net/fanyingkk/article/details/105577244,发现改成

from sklearn import metrics
metrics.pairwise.cosine_similarity(word1_embed, word2_embed)

才行,具体原因不太清楚厚

你可能感兴趣的:(python,sklearn,python)