1
tfvect = TfidfVectorizer(use_idf=True, stop_words = 'english')
wholeword = df_all['search_term']+" "+df_all['product_title']
vocab = tfvect.fit_transform(wholeword)
st = tfvect.transform(df_all['search_term'])
pt = tfvect.transform(df_all['product_title'])
我想ST的每一行和PT之间的余弦相似性,并将其存储在df_all [“相似”。如何计算两列之间的余弦相似度? - Python的