的文檔相似性,我使用TF-IDF與餘弦相似度計算描述 輸入字符串: 3/4x1/2x3/4 blk mi tee
下面是句子其中我需要找到類似的輸入字符串句子 smith-cooper® 33rt1 reducing pipe tee 3/4 x 1/2 x 3/4 in npt 150 lb malleable iron black
smith-cooper®
我正在進行潛在語義分析,我試圖從2個文檔中獲得相似度。我在Python上運行我的潛在語義分析代碼,當我運行它時,我得到: Here are the singular values
[ 0.7376057 0.4596623 0.25422212]
Here are the first 3 columns of the U matrix
[[ 0.98465137 -0.172792 -0.0
我已經下面就本link代碼以找到輸入的X和Y之間的相似性度量: def similarity(X, Y, method):
X = np.mat(X)
Y = np.mat(Y)
N1, M = np.shape(X)
N2, M = np.shape(Y)
method = method[:3].lower()
if method==