Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sentiment Analysis - using input field
library(tidytext) library(dplyr) library(stringr) sentiment_fool = function(a) { result <- c(a) kenny = data_frame(line = 1:1, text = a) cleanram = kenny %>% unnest_tokens(word, text) santaram = cleanram %>% anti_join(stop_words) fin = santaram %>% inner_join(get_sentiments("bing")) %>% count(word, sentiment, sort = TRUE) %>% ungroup() #if(subset (fin, sentiment == "positive")$n > subset (fin, sentiment == "negative")$n) { #print("It is positive") #} else { #print("It is negative") #} if ((length ((subset (fin, sentiment == "negative")$n)*0) == 0 & length(subset (fin, sentiment == "positive")$n) == 0) ) { clock = " It's neutral" } #} else { if (length(subset (fin, sentiment == "positive")$n) > 0) { clock = "It's positive" } if (length(subset (fin, sentiment == "negative")$n) > 0) { clock = "It's negative" } if(length (subset (fin, sentiment == "negative")$n) == length(subset (fin, sentiment == "positive")$n)) { clock = "You seems diplomatic" } cat (clock) }
run
|
edit
|
history
|
help
0
As1-1
K
ceiling.r
Condição de alinhamento entre três pontos
Análise de Variâncias DIC e teste de Tukey 1
ExEdsonAmanda26-01-2021
R2
Inferences for Two Population Means [Cement Hydration]
28-09-2020Int-poli-inter
Phyllotaxis in R