1. Learn
  2. /
  3. Courses
  4. /
  5. Text Mining with Bag-of-Words in R

Connected

Exercise

Cage match, part 2! Negative reviews

In both organizations, people mentioned "culture" and "smart people", so there are some similar positive aspects between the two companies. However, with the pyramid plot, you can start to infer degrees of positive features of the work environments.

You now decide to turn your attention to negative reviews and make the same visual. This time you already have the common_words data frame in your workspace. However, the common bigrams in this exercise come from negative employee reviews.

Instructions

100 XP
  • Using slice_max() on common_words, obtain the top 5 bigrams referring to the diff column. The results of the new object will print to your console.
  • Create a pyramid.plot(). Pass in top5_df$AmazonNeg, top5_df$GoogleNeg, and labels = top5_df$terms. For better labeling, set
    • gap to 12.
    • top.labels to c("Amzn", "Neg Words", "Goog")

The main and unit arguments are set for you.