|
@@ -2,7 +2,7 @@ library(readr)
|
|
|
library(dplyr)
|
|
library(dplyr)
|
|
|
library(stringr)
|
|
library(stringr)
|
|
|
library(parallel)
|
|
library(parallel)
|
|
|
-
|
|
|
|
|
|
|
+source("threaded.R")
|
|
|
SENSITIVITY <- 4
|
|
SENSITIVITY <- 4
|
|
|
|
|
|
|
|
#MAX <- nrow(DATA1)
|
|
#MAX <- nrow(DATA1)
|
|
@@ -11,6 +11,13 @@ MAX <- 500
|
|
|
LEARNED.POSITIVE <- paste(getwd(), "learned_positive.csv", sep = "/")
|
|
LEARNED.POSITIVE <- paste(getwd(), "learned_positive.csv", sep = "/")
|
|
|
LEARNED.NEGATIVE <- paste(getwd(), "learned_negative.csv", sep = "/")
|
|
LEARNED.NEGATIVE <- paste(getwd(), "learned_negative.csv", sep = "/")
|
|
|
|
|
|
|
|
|
|
+cat("Hey there! My name is Naiba. Nice to meet you.\n")
|
|
|
|
|
+cat("Thanks to the magic of multi-threading I have", PROCESSES, "brains (CPU). But this only works under a UNIX environment (e.g. MacOS).\n")
|
|
|
|
|
+cat("Don't you even dare to call the *.threaded functions in a windwows environment.\n")
|
|
|
|
|
+cat("If you have any question about me, just go to:\n")
|
|
|
|
|
+cat("https://github.com/DebenOldert/Big-Data-Review-Analysis/blob/master/README.md\n")
|
|
|
|
|
+cat("But that's enough trashtalk. Let's do this!")
|
|
|
|
|
+
|
|
|
sentiment.train <- function(str, sen){
|
|
sentiment.train <- function(str, sen){
|
|
|
env <- .GlobalEnv
|
|
env <- .GlobalEnv
|
|
|
spl <- sentiment.split(toupper(str))
|
|
spl <- sentiment.split(toupper(str))
|
|
@@ -283,4 +290,4 @@ learn.teach <- function(){
|
|
|
cat("If you want me to analyse a review just call:\n\n")
|
|
cat("If you want me to analyse a review just call:\n\n")
|
|
|
cat("sentiment.calc(<any text>)\n\n")
|
|
cat("sentiment.calc(<any text>)\n\n")
|
|
|
cat("Now let's get started!\n")
|
|
cat("Now let's get started!\n")
|
|
|
-}
|
|
|
|
|
|
|
+}
|