nlp - how to use stemDocument in R? -
nlp - how to use stemDocument in R? -
update:
thanks help. check comments. because of bundle version, delete tolower , works. need find way create lower.
============ doing basic txt mining in list of document, goes on fine till seek utilize stemmdocument.
the tm_map done next library(tm)
fbvec<-vectorsource(data[,1]) fbcorpus<-corpus(fb.vec) fbcorpus <- tm_map(fbcorpus, tolower) fbcorpus <- tm_map(fbcorpus, removepunctuation) fbcorpus <- tm_map(fbcorpus, removenumbers) fbcorpus <- tm_map(fbcorpus, removewords, stopwords("english")) fbcorpus <- tm_map(fbcorpus, removewords, "pr") fbcorpus <- tm_map(fbcorpus, stripwhitespace) the results following
[[1]] [1] easy post position search resumes improvement searching resumes [[2]] [1] easy utilize candidiates improvement allow multiple emails sent [[3]] [1] applicants young kids absolutely sales experience waste time looking improvement applicants apply experience looking dont need kids high school [[4]] [1] abundance resumes then tried stem
library(snowballc) fbcorpus <- tm_map(fbcorpus, stemdocument) but results not image, looks deal lastly word in sentence, result following:
[[1]] [1] easy post position search resumes improvement searching resum [[2]] [1] easy utilize candidiates improvement allow multiple emails sent [[3]] [1] applicants young kids absolutely sales experience waste time looking improvement applicants apply experience looking dont need kids high school [[4]] [1] abundance resum is there can help?
this problem appears in tm 0.6 , has using functions not in list of gettransformation() tm. problem tolower returns character vector, , not "plaintextdocument" tm_map like. tm packages provides content_transformer function take care of managing plaintextdocument
fbcorpus <- tm_map(fbcorpus, content_transformer(tolower)) r nlp
Comments
Post a Comment