From the course: Data Science Foundations: Data Mining in R
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Visualizing Word pairs
From the course: Data Science Foundations: Data Mining in R
Visualizing Word pairs
- [Instructor] Our final demonstration of text mining is actually going to look at a visualization of the association between words, and in this case, word pairs. To do this I'm going to begin by loading a few packages including ggraph, which allows us to visualize networks. That's going to be important for what we do here. So I going to load those packages. I'll set a random seed 'cause that can affect the graphs. And then we're going to use "The Iliad" the same data we've used before. We'll bring it in from the data folder, save it as a tibble and we'll look at the first few rows. We've seen this several times, it's the same. And then we'll prepare the data. We're going to tokenize the data by unnesting it, and except this time we're going to save it into something called wordpairs, not word, but wordpairs. We're going to start with the text and we're going to split it into ngrams. An ngram is a word that means this many…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.