【发布时间】:2021-04-18 03:26:48
【问题描述】:
我尝试使用 [此处][1] 报告的一致性度量计算。
我使用 quanteda,所以我有一个 dfm
但是在链接中使用 dtm: #创建 DTM
dtm <- CreateDtm(tokens$text,
doc_names = tokens$ID,
ngram_window = c(1, 2))
#explore the basic frequency
tf <- TermDocFreq(dtm = dtm)
original_tf <- tf %>% select(term, term_freq,doc_freq)
rownames(original_tf) <- 1:nrow(original_tf)
# Eliminate words appearing less than 2 times or in more than half of the
# documents
vocabulary <- tf$term[ tf$term_freq > 1 & tf$doc_freq < nrow(dtm) / 2 ]
dtm = dtm
如何在这个计算中使用 dfm 而不是 dtm 的选项
更具体地说,如何使用 dfm 和 dtm 选项创建词汇表? [1]:https://towardsdatascience.com/beginners-guide-to-lda-topic-modelling-with-r-e57a5a8e7a25
【问题讨论】: