Description Usage Arguments Details Value Author(s) References See Also Examples
Calculate sentiment of a Chinese sentence
1 | cnsr.predict(fit, text)
|
fit |
Reture from cnsr.train |
text |
A data.frame, return from cnsr.prepare |
Calculate sentiment of a Chinese sentence
Return a data.frame.
Shao Dan Lee [aut, cre]
URL: https://github.com/leeshuheng/cnSentimentR
cnsr.train,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.