Description Usage Arguments Value Author(s) References See Also Examples
View source: R/sentiment.keyword.R
Extract key words
1 | cnsr.keyword(data, topn = 10)
|
data |
data.frame |
topn |
Number of word. |
return positive and negative key word.
Shao Dan Lee [aut, cre]
URL: https://github.com/leeshuheng/cnSentimentR
cnsr.predict,cnsr.train,cnsr.prepare,cnsr.topic.word
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.