我一直在尝试为文章做主题建模。我清理了包含大量反斜杠和数字的原始数据。即使在删除标点符号、反斜杠和数字之后,我还是得到了反斜杠以及主题 1 中最重要的数字。我用于预处理的代码片段是
articles <- tm::tm_map(articles, content_transformer(tolower))
# Remove numbers
articles<- tm_map(articles, removeNumbers)
# Remove english common stopwords
articles<- tm_map(articles, removeWords, stopwords("english"))
# Remove punctuations
articles<- tm_map(articles, removePunctuation)
# Eliminate extra white spaces
articles <- tm_map(articles, stripWhitespace)
toSpace <- content_transformer(function(x, pattern) gsub(pattern, " ", x))
articles <- tm_map(articles,toSpace, "\\\\" )
即使在尝试清理数据之后,我也得到了主题中最热门的反斜杠和数字,设计
机器人
类
医疗
设备 wkh\003
学生
dcbl
ri\003
课程
主题中的反斜杠和数字完全不合适。请帮我解决问题