Trực quan hóa cảm xúc
Hãy tạo một tập dữ liệu word_counts và khám phá những từ nào gắn với từng cảm xúc trong dữ liệu Twitter của chúng ta.
Bài tập này là một phần của khóa học
Nhập môn Phân tích Văn bản bằng R
Bài tập tương tác thực hành trực tiếp
Hãy thử làm bài tập này bằng cách hoàn thành đoạn mã mẫu này.
word_counts <- tidy_twitter %>%
# Append the NRC dictionary and filter for positive, fear, and trust
___(___) %>%
___(___) %>%
# Count by word and sentiment and keep the top 10 of each
___(___) %>%
group_by(___) %>%
___(___) %>%
ungroup() %>%
# Create a factor called word2 that has each word ordered by the count
mutate(___)