
16
■
2
章 整理データを使ったセンチメント分析
す。センチメント分析のアプローチはこれだけではありませんが、これはよく使わ
れるアプローチであり、整理ツールエコシステムの利点を自然に利用できるアプ
ローチでもあります。
2.1
センチメントデータセット
章の冒頭で触れたように、テキストに含まれる意見や感情を評価するための方
法や辞書にはさまざまなものがあります。
tidytext
パッケージの
sentiments
データ
セットには、複数のセンチメント辞書(
lexicon
)が含まれています。
library(tidytext)
sentiments
## # A tibble: 27,314
×
4
## word sentiment lexicon score
## <chr> <chr> <chr> <int>
## 1 abacus trust nrc NA
## 2
abandon fear nrc NA
## 3 abandon negative nrc NA
## 4 abandon sadness nrc NA
## 5 abandoned anger nrc NA
## 6 abandoned fear nrc NA
## 7 abandoned negative nrc NA
## 8 abandoned sadness nrc NA
## 9 abandonment anger nrc NA
## 10 abandonment fear nrc NA
## # ... with 27,304 more ...