Usage Arguments Author(s) References See Also Examples
1 | cnsr.train(data, control = list(cost = 100, cross = 0, tolerance = 0.001))
|
data |
A data.frame,result of cnsr.prepare. It must contain column 'sentiment', This column is the label of context, '0' is negative, '1' is positive. |
control |
Some parameters of svm. |
Shao Dan Lee [aut, cre]
URL: https://github.com/leeshuheng/cnSentimentR
cnsr.predict,cnsr.prepare,cnsr.topic.word,cnsr.keyword
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | devtools::install_github("leeshuheng/cnSentimentR")
train.set <- read.csv("./train_set.csv", header = T, sep = ",", stringsAsFactors = F)
train.set <- train.set[,c("sentiment", "content")]
library(cnSentimentR)
train.set <- cnsr.prepare(train.set)
fit <- cnsr.train(train.set)
# test.set <- read.csv("./test_set.csv", header = T, sep = ",", stringsAsFactors = F)
# test.set <- cnsr.prepare(test.set)
test.set <- train.set[sample(1:nrow(train.set), 100, replace = F),]
test.set <- cnsr.predict(fit, test.set)
cnsr.topic.word(test.set)
cnsr.keyword(test.set)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.