-
Notifications
You must be signed in to change notification settings - Fork 0
/
sentida.R
26 lines (19 loc) · 892 Bytes
/
sentida.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#if(!require("devtools")) install.packages("devtools")
#install.packages("glue")
#devtools::install_github("Guscode/Sentida")
library(Sentida)
library(openxlsx)
library(svMisc)
setwd("C:\\Users\\August\\OneDrive - Københavns Universitet\\Documents\\Uni\\Kandidat i Statskundskab\\4. semester kandidat\\Projekt\\FT-project")
Sentida::sentida("Abort er mord", output = "mean")
sentida("Abort er mord", output = "total")
sentida("Abort er mord", output = "mean")
df <- read.csv("short_comment_df.csv", encoding = "UTF-8")
df$sentiment_mean = Sentida::sentida(df$tale,output = "mean")
df$sentiment_total = Sentida::sentida(df$tale,output = "total")
for( i in 1:nrow(df)){
progress(i,nrow(df))
df$sentiment_mean[i] <- Sentida::sentida(df$tale[i],output = "mean")
df$sentiment_total[i] <- Sentida::sentida(df$tale[i],output = "total")
}
write.csv(df,"df_sentiment_short_comment.csv")