From the course: Advanced NLP with Python for Machine Learning
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
How to prep word vectors for modeling - Python Tutorial
From the course: Advanced NLP with Python for Machine Learning
How to prep word vectors for modeling
- [Instructor] Now that we can generate word vectors for any given set of words, we need to learn how to prep these word vectors in order to use them for a machine learning problem. Let's start by very quickly just running through the code we wrote in the last video to clean our data and train a Word2Vec model. Now that we have a trained Word2Vec model, let's start by viewing all of the words in the corpus by calling the stored model, calling word vectors, and then calling the index two word attribute. So what this represents is it represents all of the words that our Word2Vec model learned a vector for. Or put another way, it's all of the words that appeared in the training data at least twice. So you can explore these words if you'd like. Now, the code for this next step gets a little bit tricky. So I'm going to walk through it in steps. So first, we're using lists comprehension to cycle through each text message in the…
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.