Bing tidy polarity: Call me Ishmael (ggplot2 के साथ)!
Bing lexicon का यह आख़िरी अभ्यास है! इस अभ्यास में आप pipe ऑपरेटर (%>%) का उपयोग करके उपन्यास Moby Dick के sentiment की टाइमलाइन बनाएँगे.
अंत में आप नीचे दिए गए कोड स्ट्रक्चर को फॉलो करते हुए एक सरल visualization भी बनाएँगे. अगले चैप्टर में visuals पर और गहराई से चर्चा होगी.
ggplot(pivoted_data, aes(index_column, polarity_column)) +
geom_smooth(se = FALSE)
यह अभ्यास पाठ्यक्रम का हिस्सा है
R में Sentiment Analysis
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
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,]