更多使用DocumentTermMatrix()的停止词
目前,我正在R中使用函数更多使用DocumentTermMatrix()的停止词,r,tm,R,Tm,目前,我正在R中使用函数DocumentTermMatrix(),以适应LDA模型。除了默认的停止词外,我还想添加我自己应该删除的词 library(tm) myStopwords <- c("aa", "bb") dtm <- DocumentTermMatrix(myCorpus, control = list( tolower =
DocumentTermMatrix()
,以适应LDA模型。除了默认的停止词外,我还想添加我自己应该删除的词
library(tm)
myStopwords <- c("aa", "bb")
dtm <- DocumentTermMatrix(myCorpus,
control = list(
tolower = TRUE,
removePunctuation = TRUE,
removeNumbers= TRUE,
stemming = FALSE,
stopwords = TRUE,
minWordLength = 2))
library(tm)
myStopwords您可以通过在DocumentTermMatrix
函数中添加removeWords=c(“aa”、“bb”)
来添加自己的停止词
library(tm)
myStopwords <- c("aa", "bb")
dtm <- DocumentTermMatrix(myCorpus,
control = list(
tolower = TRUE,
removePunctuation = TRUE,
removeNumbers= TRUE,
stemming = FALSE,
stopwords = TRUE,
removeWords = c("aa","bb"),
minWordLength = 2))
))
library(tm)
myStopwords您可以通过在DocumentTermMatrix
函数中添加removeWords=c(“aa”、“bb”)
来添加自己的停止词
library(tm)
myStopwords <- c("aa", "bb")
dtm <- DocumentTermMatrix(myCorpus,
control = list(
tolower = TRUE,
removePunctuation = TRUE,
removeNumbers= TRUE,
stemming = FALSE,
stopwords = TRUE,
removeWords = c("aa","bb"),
minWordLength = 2))
))
library(tm)
myStopwords