Souza, M.; Vieira, R. Sentiment Analysis on Twitter Data for Portuguese Language. 10th International Conference Computational Processing of the Portuguese Language, 2012. [pdf] [bib]
Souza, M.; Vieira, R.; Busetti, D.; Chishman, R. e Alves, I. M. Construction of a Portuguese Opinion Lexicon from multiple resources. 8th Brazilian Symposium in Information and Human Language Technology, 2011. [pdf] [bib]
In [1]:
library(readr)
library(dplyr)
library(stringr)
library(wordcloud)
library(tidytext)
library(tidyRSS)
In [2]:
oplexicon <- read_csv('oplexicon_v3.0/lexico_v3.0.txt', col_names = c('word', 'type', 'weight', 'other'), col_types =
cols(
word = col_character(),
type = col_character(),
weight = col_integer(),
other = col_character()
))
head(oplexicon)
In [3]:
stopwords <- read_csv('portuguese-stopwords.txt', col_names = 'word')
In [4]:
feed <- tidyfeed("https://oglobo.globo.com/rss.xml?completo=true")
In [5]:
rss_t <- feed %>%
unnest_tokens(word,item_title) %>%
anti_join(stopwords,by="word")
In [6]:
sentimentoFeed <- rss_t %>%
inner_join(oplexicon) %>%
group_by(item_link) %>%
summarize(peso = sum(weight, na.rm = TRUE))
sentimentoFeed
In [ ]: