替三個主題命名
一起比較兩種可能的主題模型解法,並嘗試替主題命名。先從名為 lda_topics2 的 3 主題模型開始。
本練習屬於課程
R 文字分析入門
練習說明
- 依主題選出前 15 個詞彙,並重新排序詞彙。
- 繪製
word_probs2,依主題設定顏色並分面呈現。 - 你會如何替這三個主題命名?
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Select the top 15 terms by topic and reorder term
word_probs2 <- ___ %>%
___(___) %>%
___(___) %>%
___() %>%
mutate(term2 = ___)
# Plot word_probs2, color and facet based on topic
ggplot(
___,
___(___)
) +
geom_col(show.legend = FALSE) +
___(___, scales = "free") +
coord_flip()