【发布时间】:2014-12-07 23:53:44
【问题描述】:
我目前正在开发一个程序来根据其语义(含义)比较两段文本。我知道有一些库,例如 lingpipe,它们提供了比较字符串距离的有用方法,但是我听说 LSA 是测量文本相似度的最佳方法。
我只是对使用 LSA 来测量文本相似度感到困惑。我知道这个过程是,使用 LSA,
1.Two passages are represented as two matrices X and Y.
2.Using SVD, the matrices each are reduced to 3 different matrices
3.And then the cosine distance is measured between the two matrices
4. The cosine distance determines how similar they are
我只是想知道...
A.在 SVD 中,矩阵被缩减为 3 个更小的矩阵。那么这些较小的矩阵中的哪一个用于余弦距离测量?
B.余弦距离通常应用于向量。因此,在将它们应用于矩阵的情况下,我假设迭代矩阵并在每 2 个向量之间测量余弦距离。然后假设所有这些距离的平均值是这两个矩阵之间的最终余弦距离?
我知道这是一个非常小众的话题,但我希望对这两个问题有所了解。谢谢
【问题讨论】:
标签: nlp similarity cosine-similarity lingpipe latent-semantic-analysis