【问题标题】:Plot more than 3 words per topic for STM?为 STM 绘制每个主题超过 3 个单词?
【发布时间】:2021-09-08 05:23:59
【问题描述】:

是否可以使用 STM 包为每个主题绘制 3 个以上的单词?

topic.count <- 10
model.stm <- stm(stm_1$documents, stm_1$vocab, K = topic.count, data = stm_1$meta, 
init.type = "Spectral") 

使用“plot, type = “summary”,我在一个情节中每个主题得到 3 个单词

plot(model.stm, type = "summary", text.cex = 1)

使用“labelTopics”,我在“最高概率”下的每个主题得到 7 个单词作为列表

labelTopics(model.stm)

有没有办法绘制 4 或 5 个单词而不是像下面的代码那样使用默认的 3 个单词?

plot(model.stm, type = "summary", text.cex = 1)

【问题讨论】:

    标签: r plot nlp


    【解决方案1】:

    是的 - 通过设置 n。示例:

    library("stm")
    ## stm v1.3.6 successfully loaded. See ?stm for help. 
    ##  Papers, resources, and other materials at structuraltopicmodel.com
    
    plot(gadarianFit, type = "summary", text.cex = 0.9, n = 5)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多