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的