syuzhet package - extracting words evaluated by sentiment score

我们两清 提交于 2019-12-12 04:29:35

问题


I'm using syuzhet package for sentiment analysis. It is very simple for usage but I cannot find method/function where it could return all the evaluated words from sentence. It is returning only data frame with count of values correspond to eg. anger, anticipation, surprise, ..., negative, positive. But how can I get back particular words which are considered e.g. as a positive or negative...

text <- c("I love it. It's awesome!", 'Im positively surprised.', 'very bad alrighty then.', 'something is not good.')
pander::pandoc.table(syuzhet::get_nrc_sentiment(syuzhet::get_sentences(text))[,9:10])

回答1:


Download https://github.com/mjockers/syuzhet/blob/master/R/sysdata.rda

and open it in R or RStudio.

Once that's loaded, do:

View(nrc) to see all the words and what emotion they are considered, or the other dataframes for the +/- valence



来源:https://stackoverflow.com/questions/40175803/syuzhet-package-extracting-words-evaluated-by-sentiment-score

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!