# NOT RUN {
require(dplyr)
data(obama)
# Top words in the first Obama S.O.T.U., using all tokens
tfidf <- get_tfidf(obama)
vids <- order(tfidf$tfidf[1,], decreasing = TRUE)[1:10]
tfidf$vocab[vids]
# Top words, only using non-proper nouns
tfidf <- get_token(obama) %>%
filter(pos %in% c("NN", "NNS")) %>%
get_tfidf()
vids <- order(tfidf$tfidf[1,], decreasing = TRUE)[1:10]
tfidf$vocab[vids]
# }
Run the code above in your browser using DataLab