如何制作主题建模?

时间:2018-01-12 13:30:59

标签: r topicmodels

我第一次尝试主题建模。尝试运行插图代码但得到以下错误;

library(pacman)
p_load("tm", "SnowballCC", "RColorBrewer", "ggplot2", "wordcloud", "biclust", 
       "cluster", "igraph", "fpc", "Rcampdf")
p_load("topicmodels", "devtools", "ldatuning")
data("AssociatedPress", package="topicmodels")
dtm <- AssociatedPress[1:10, ]
result <- FindTopicsNumber(
  dtm,
  topics = seq(from = 2, to = 15, by = 1),
  metrics = c("Griffiths2004", "CaoJuan2009", "Arun2010", "Deveaud2014"),
  method = "Gibbs",
  control = list(seed = 77),
  mc.cores = 2L,
  verbose = TRUE
)

knitr::kable(result)
Error in subset.default(values, select = 2:ncol(values)) : 
  argument "subset" is missing, with no default

FindTopicsNumber_plot(result)
Error in seq_len(m) : argument must be coercible to non-negative integer
In addition: Warning messages:
1: In rep(digits, length.out = m) :
  first element used of 'length.out' argument
2: In seq_len(m) : first element used of 'length.out' argument

需要帮助解决错误。谢谢。

0 个答案:

没有答案
相关问题