開始使用免費開始

計算 NRC 情緒

tidytext 套件內建的第四個字典是 nrc 字典。先從計算情緒詞數開始探索吧。

本練習屬於課程

R 文字分析入門

檢視課程

練習說明

  • 這一步通常我會先幫你做好,不過這次請先載入 tidyversetidytext 套件。
  • 計算 nrc 中各種情緒所對應的詞彙數量。
  • 將計數結果依照遞減排序。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Load the tidyverse and tidytext packages
___(___)
___(___)

# Count the number of words associated with each sentiment in nrc
___(___) %>% 
  ___(___) %>% 
  # Arrange the counts in descending order
  ___(___)
編輯並執行程式碼