การตีความหัวข้อ

การวิเคราะห์ข้อความเบื้องต้นใน R

Maham Faisal Khan

Senior Data Science Content Developer

สองหัวข้อ

lda_topics <- LDA(
  dtm_review,
  k = 2,
  method = "Gibbs",
  control = list(seed = 42)
) %>% 
  tidy(matrix = "beta")

word_probs <- lda_topics %>% group_by(topic) %>% slice_max(beta, n = 15) %>% ungroup() %>% mutate(term2 = fct_reorder(term, beta))
การวิเคราะห์ข้อความเบื้องต้นใน R

สองหัวข้อ

ggplot(
  word_probs, 
  aes(
    term2, 
    beta, 
    fill = as.factor(topic)
  )
) +
  geom_col(show.legend = FALSE) +
  facet_wrap(~ topic, scales = "free") +
  coord_flip()

การวิเคราะห์ข้อความเบื้องต้นใน R

สามหัวข้อ

lda_topics2 <- LDA(
  dtm_review,
  k = 3,
  method = "Gibbs",
  control = list(seed = 42)
) %>% 
  tidy(matrix = "beta")

word_probs2 <- lda_topics2 %>% group_by(topic) %>% slice_max(beta, n = 15) %>% ungroup() %>% mutate(term2 = fct_reorder(term, beta))
การวิเคราะห์ข้อความเบื้องต้นใน R

สามหัวข้อ

ggplot(
  word_probs2, 
  aes(
    term2, 
    beta, 
    fill = as.factor(topic)
  )
) +
  geom_col(show.legend = FALSE) +
  facet_wrap(~ topic, scales = "free") +
  coord_flip()

การวิเคราะห์ข้อความเบื้องต้นใน R

สี่หัวข้อ

การวิเคราะห์ข้อความเบื้องต้นใน R

ศิลปะของการเลือกโมเดล

  • การเพิ่มหัวข้อที่แตกต่างกันถือเป็นสิ่งที่ดี
  • หากเริ่มมีหัวข้อซ้ำกัน แสดงว่าแบ่งมากเกินไปแล้ว
  • ตั้งชื่อหัวข้อตามคำที่มีความน่าจะเป็นสูงที่ปรากฏร่วมกัน
การวิเคราะห์ข้อความเบื้องต้นใน R

มาฝึกกันเถอะ!

การวิเคราะห์ข้อความเบื้องต้นใน R

Preparing Video For Download...