1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Natural Language Processing in R

Exercise

Assigning topics to documents

Creating LDA models are useless unless you can interpret and use the results. You have been given the results of running an LDA model, sentence_lda on a set of sentences, pig_sentences. You need to explore both the beta, top words by topic, and the gamma, top topics per document, matrices to fully understand the results of any LDA analysis.

Given what you know about these two matrices, extract the results for a specific topic and see if the output matches expectations.

Instructions

100 XP
  • Create a tibble for both the beta and gamma matrices.
  • Explore topic 5 by looking at the top words for topic 5 while arranging the results decreasing beta values.
  • Explore topic 5 by seeing which sentences most align with topic 5 while arranging the results by decreasing gamma values.