Pasul 3: Organizarea textului

Text Mining cu Bag-of-Words în R

Ted Kwartler

Instructor

Organizarea textului cu qdap

# qdap cleaning function
qdap_clean <- function(x) {
  x <- replace_abbreviation(x)
  x <- replace_contraction(x)
  x <- replace_number(x)
  x <- replace_ordinal(x)
  x <- replace_symbol(x)
  x <- tolower(x)
  return(x)
}
Text Mining cu Bag-of-Words în R

Organizarea textului cu tm

# tm cleaning function
tm_clean <- function(corpus) {
  tm_clean <- tm_map(corpus, removePunctuation)
  corpus <- tm_map(corpus, stripWhitespace)
  corpus <- tm_map(corpus, removeWords,
              c(stopwords("en"), "Google", "Amazon", "company"))
  return(corpus)
}
Text Mining cu Bag-of-Words în R

Curățarea corpusurilor

 

clean_corpora.png

Text Mining cu Bag-of-Words în R

Să exersăm!

Text Mining cu Bag-of-Words în R

Preparing Video For Download...