fix bugs, add caching to lda_cossim