
100
■
5
章 未整理形式へ(から)の変換
こ の 辞 書 は、 単 語 の 感 情 を「
positive
」、「
negative
」、「
litigious
」( 訴 訟 含 み )、
「
uncertain
」(不確実)、「
constraining
」(抑制的)、「
superfluous
」(過剰)の
6
種類に分
類しています。まず、感情ごとにこのデータセットにおける最頻出語を調べてみま
しょう(図5-7 参照)。
stock_tokens %>%
count(word) %>%
inner_join(get_sentiments("loughran"), by = "word") %>%
group_by(sentiment) %>%
top_n(5, n) %>%
ungroup() %>%
mutate(word = reorder(word, n)) %>%
ggplot(aes(word, n)) +
geom_col() +
coord_flip() +
facet_wrap(~ sentiment, scales = "free") +
ylab("Frequency of this word in the recent financial articles")
図5-7 Loughran and McDonald辞書の6種類の感情を表す単語の中で最近のIT株記事で頻
出しているもの
*1
。
*
1
訳注:
6
種類のうち
superfluous
(過剰)に該当する単語は見つかりませんでした。