Remove empty documents from DocumentTermMatrix in R topicmodels?

后端 未结 6 2053
鱼传尺愫
鱼传尺愫 2020-11-30 22:44

I am doing topic modelling using the topicmodels package in R. I am creating a Corpus object, doing some basic preprocessing, and then creating a DocumentTermMatrix:

<
6条回答
  •  清歌不尽
    2020-11-30 23:46

    Just remove the sparse terms from the DTM and all will work well.

    dtm <- DocumentTermMatrix(crude, sparse=TRUE)
    

提交回复
热议问题