KNU Korean Sentiment Dictionary Sentiment Analysis
get_polarity.Rd
군산대학교 한국어 감성 사전을 활용하여 문서의 감성분석 결과를 반환
Value
data.frame 감성분석 결과를 담은 data.frame
n_match: numeric. 감성사전에 매치된 토큰 개수
n_negative: numeric. 감성사전의 부정 단어와 매치된 토큰 개수
n_positive: numeric. 감성사전의 긍정 단어와 매치된 토큰 개수
n_neutral: numeric. 감성사전의 중립 단어와 매치된 토큰 개수
negative: numeric. 감성사전의 부정 단어와 매치된 토큰의 점수의 합
positive: character. 감성사전의 긍정 단어와 매치된 토큰의 점수의 합
polarity: numeric. 감성의 극성. (positive - negative) / (positive + negative).
Examples
# \donttest{
get_polarity(buzz$CONTENT[1])
#> n_match n_negative n_positive n_neutral negative positive polarity
#> 1 3 2 1 0 4 1 -0.6
# 개별 문서들의 감성분석
get_polarity(buzz$CONTENT[1:5])
#> n_match n_negative n_positive n_neutral negative positive polarity
#> 1 3 2 1 0 4 1 -0.6000000
#> 2 0 0 0 0 0 0 NaN
#> 3 3 2 1 0 2 1 -0.3333333
#> 4 21 17 2 2 31 2 -0.8787879
#> 5 11 6 5 0 12 5 -0.4117647
# 전체 문서를 통합한 감성분석
get_polarity(buzz$CONTENT[1:5], indiv = FALSE)
#> n_match n_negative n_positive n_neutral negative positive polarity
#> 1 38 27 9 2 49 9 -0.6896552
# }