在 R 中使用 NLP 进行词干提取时,有什么方法可以获取基本词而不是词根?
代码:
> #Loading libraries
> library(tm)
> library(slam)
>
> #Vector
> Vec=c("happyness happies happys","sky skies")
>
> #Creating Corpus
> Txt=Corpus(VectorSource(Vec))
>
> #Stemming
> Txt=tm_map(Txt, stemDocument)
>
> #Checking result
> inspect(Txt)
A corpus with 2 text documents
The metadata consists of 2 tag-value pairs and a data frame
Available tags are:
create_date creator
Available variables in the data frame are:
MetaID
[[1]]
happi happi happi
[[2]]
sky sky
>
我可以使用 R 获得“happyness happies happys”的基本词“happy”(基本词)而不是“happi”(词根)吗?