Fit the Latent Semantic Analysis scaling model to a dfm, which may be weighted (for instance using dfm_tfidf).

textmodel_lsa(x, nd = 10, margin = c("both", "documents", "features"))

## Arguments

x the dfm on which the model will be fit the number of dimensions to be included in output margin to be smoothed by the SVD

## Details

svds in the RSpectra package is applied to enable the fast computation of the SVD.

## Note

The number of dimensions nd retained in LSA is an empirical issue. While a reduction in $$k$$ can remove much of the noise, keeping too few dimensions or factors may lose important information.

## References

Rosario, Barbara. 2000. "Latent Semantic Indexing: An Overview". Technical report INFOSYS 240 Spring Paper, University of California, Berkeley.

Deerwester, Scott, Susan T. Dumais, George W. Furnas, Thomas K. Landauer, and Richard Harshman. 1990. "Indexing by Latent Semantic Analysis". Journal of the American Society for Information Science 41(6): 391.

head(ie_lsa$docs) #> [,1] [,2] [,3] [,4] [,5] #> Lenihan, Brian (FF) -0.5132082 0.6611990 0.5010158 0.03718041 -0.18932417 #> Bruton, Richard (FG) -0.2774006 -0.3444475 0.1538104 0.84969109 0.13605925 #> Burton, Joan (LAB) -0.3840362 -0.3455358 -0.1080534 -0.22254097 -0.62996056 #> Morgan, Arthur (SF) -0.4381501 -0.2675310 0.1958565 -0.42928912 0.65830177 #> Cowen, Brian (FF) -0.3932116 0.3587097 -0.7698150 0.14403049 0.19068539 #> Kenny, Enda (FG) -0.2611641 -0.1547760 -0.1003581 -0.12282063 0.05878167 #> [,6] [,7] [,8] [,9] #> Lenihan, Brian (FF) 0.024642794 -0.04354314 0.03511621 -0.02558590 #> Bruton, Richard (FG) -0.009346201 0.11169768 0.12502463 -0.10974219 #> Burton, Joan (LAB) 0.022839615 0.51620557 0.04871506 -0.02433495 #> Morgan, Arthur (SF) -0.206942503 0.15992742 0.10149400 0.01181985 #> Cowen, Brian (FF) -0.097840896 0.08922500 -0.19256676 0.01576936 #> Kenny, Enda (FG) 0.813209501 -0.37318871 0.08277396 -0.23320209 #> [,10] #> Lenihan, Brian (FF) 0.082457683 #> Bruton, Richard (FG) 0.004679789 #> Burton, Joan (LAB) -0.071523773 #> Morgan, Arthur (SF) 0.039985771 #> Cowen, Brian (FF) -0.110120661 #> Kenny, Enda (FG) -0.131952742 # matrix in low_rank LSA space ie_lsa$matrix_low_rank[,1:5]