Now we create a word cloud to highlight the most representative words within the negative and positive sentiments, for each book:
The Dhammapada:
filtered_books_words %>%
filter(book == "Dhammapada") %>%
inner_join(bing, by = "word") %>%
count(word, sentiment, sort = TRUE) %>%
acast(word ~ sentiment, value.var = "n", fill = 0) %>%
comparison.cloud(colors = c("#cf0a00","#1a954d"),
random.order = FALSE,
rot.per = 0,
max.words = 50)
The Book of Mormon:
filtered_books_words %>%
filter(book == "The Book of Mormon") %>%
inner_join(bing, by = "word") %>%
count(word, sentiment, sort = TRUE) %>%
acast(word ~ sentiment, value.var = "n", fill = 0) %>%
comparison.cloud(colors = c("#cf0a00","#1a954d"),
random.order = FALSE,
rot.per = 0,
max.words = 50)