Hello,
I think there is an error in the way the LSA is computed in textmodel_lsa.R. After the svd decomposition, the v singular vectors are usually weighed with the k remaining singular values. However, at line 80 the matrix v is multiplied column-wise with d instead of row-wise. See :
|
result$matrix_low_rank <- t(dec$v * dec$d) |
If I'm not wrong, the correct way to weight the v singular vectors should be v %*% diag(d) ?
This is how the weighing is calculated in the text2vec package. See:
https://github.com/dselivanov/text2vec/blob/e3b9865057ba8dae713badbf71ca5160b7a6efa6/R/model_LSA.R#L76
Thanks!