Bing tidy polarity: Bana İsmail de (ggplot2 ile)!
Son Bing sözlük egzersizi! Bu egzersizde, boru operatörünü (%>%) kullanarak Moby Dick metnindeki duygunun zaman çizelgesini oluşturacaksın.
Sonunda aşağıdaki kod yapısını izleyerek basit bir görselleştirme de yapacaksın. Bir sonraki bölüm görselleştirmeler konusunda daha derine inecek.
ggplot(pivoted_data, aes(index_column, polarity_column)) +
geom_smooth(se = FALSE)
Bu egzersiz, kursun bir parçasıdır
R ile Duygu Analizi
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
moby_polarity <- moby %>%
# Inner join to lexicon
___(bing, by = c("___" = "___")) %>%
# Count the sentiment scores
___(___, ___) %>%
# Pivot the sentiment into positive and negative columns
___(names_from = ___, values_from = ___, values_fill = ___) %>%
# Add polarity column
mutate(___ = ___ - __) %>% arrange(index)
# Examine a portion
moby_polarity[190:195,]