Czyszczenie i wstępne przetwarzanie tekstu

Eksploracja tekstu metodą Bag-of-Words w R

Ted Kwartler

Instructor

Typowe funkcje przetwarzania wstępnego

Funkcje przetwarzania wstępnego

Eksploracja tekstu metodą Bag-of-Words w R

Przetwarzanie wstępne w praktyce

Przetwarzanie wstępne

# Make a vector source: coffee_source
coffee_source <- VectorSource(coffee_tweets)

# Make a volatile corpus: coffee_corpus coffee_corpus <- VCorpus(coffee_source)
# Apply various preprocessing functions tm_map(coffee_corpus, removeNumbers) tm_map(coffee_corpus, removePunctuation)
tm_map(coffee_corpus, content_transformer(replace_abbreviation))
Eksploracja tekstu metodą Bag-of-Words w R

Kolejny krok przetwarzania: stemmingów

# Stem words
stem_words <- stemDocument(c("complicatedly", "complicated","complication"))
stem_words
"complic" "complic" "complic"
# Complete words using single word dictionary
stemCompletion(stem_words, c("complicate"))
     complic      complic      complic 
"complicate" "complicate" "complicate"
# Complete words using entire corpus
stemCompletion(stem_words, my_corpus)
Eksploracja tekstu metodą Bag-of-Words w R

Czas na ćwiczenia!

Eksploracja tekstu metodą Bag-of-Words w R

Preparing Video For Download...