如果我们有一组 M 个单词,并且提前知道每对单词含义的相似度(有一个 M x M 相似度矩阵),我们可以使用哪种算法为每个单词生成一个 k 维位向量,这样每对单词就可以通过比较它们的向量来比较(例如获得向量的绝对差)?
我不知道这个特殊问题如何称呼。如果我知道的话,在一堆具有相似描述、做其他事情的算法中找到它就会容易得多。
附加观察:
我认为该算法必须会产生一种副作用,在这种情况下是需要的。如果从矩阵来看,单词 A 与单词 B 相似,B 与 C 相似,但检测到的 [A,C] 相似度较低,则计算出的结果向量差值也应产生较高的 [A,C] 相似度。因此,我们将填补矩阵中先前的空白 - 以某种方式平滑该算法的相似性。但除了这种平滑之外,目标是使结果尽可能接近矩阵中的原始数字。
If we have a set of M words, and know the similarity of the meaning of each pair of words in advance (have a M x M matrix of similarities), which algorithm can we use to make one k-dimensional bit vector for each word, so that each pair of words can be compared just by comparing their vectors (e.g. getting the absolute difference of vectors)?
I don't know how this particular problem is called. If I knew, it would be much easier to find among a bunch of algorithms with similar descriptions, which do something else.
Additional observation:
I think this algorithm would have to produce one, in this case wanted, side effect. If, from the matrix, word A is similar to word B and B is similar to C, but there is low [A, C] similarity detected, the calculated result vectors difference should produce high [A, C] similarity as well. So, we would fill in the previous gaps in the matrix - smoothen the similarities with this algorithm somehow. But besides this smoothing, the goal is to have results as close as possible to the original numbers that we had in a matrix.
发布评论
评论(2)
您可以进行截断奇异值分解 (SVD) 来找到最佳 k 秩近似矩阵。这个想法是将矩阵分解为三个矩阵:U、sigma 和 V,其中 U 和 V 是正交矩阵,sigma 是对角矩阵。
通过截断不重要的奇异值,您可以获得
O(k*m)
存储空间。You could do a truncated singular value decomposition (SVD) to find the best k-rank approximation to the matrix. The idea is the decompose the matrix into three matrices: U, sigma, and V such that U and V are orthonormal and sigma is diagonal.
By truncating off unimportant singular values, you can achieve
O(k*m)
storage space.如果您只对第一个特征向量 + 特征值感兴趣,则幂迭代可能会很有用。我曾经用它从文本文档中提取关键字。 (基于句子内的词间距离,但相似性也可能有效)
If you are only interested in the first eigenvector + eigenvalue, the power-iteration will probably be useful. I once used it to extract keywords from text documents. (based on inter-word distance within the sentences, but similarity will probably work, too)