从他们的开始定义自己的停用词

时间:2018-04-30 15:28:29

标签: corpus topic-modeling stop-words topicmodels

我正在寻找一个代码,它允许我从textcorpus中删除自己的停用词,但只能通过开头定义它们

示例:在我的语料库中包含报纸文章,还有其他htpps ....包括互联网链接,我不需要我的主题建模。

我现在要删除以“https ...”开头的所有“单词”

我有什么方法可以做到这一点?

我正在使用tm包进行文本转换,直到这一点也使用了一些自己的停用词。

nzz <- SimpleCorpus(DirSource("private"), control = list(language="de"))

nzz <- tm_map(nzz, removePunctuation)
nzz <- tm_map(nzz, removeNumbers)
nzz <- tm_map(nzz, stripWhitespace)
**myStopwords <- c("beispiel","bemerkbar","docs","par",**
                 **"ipar","neue","zuercher","zeitung","http")**

**nzz <- tm_map(nzz, removeWords, c(stopwords("german"), myStopwords))****

0 个答案:

没有答案