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 implement doc2vec

How to implement doc2vec - Python Tutorial

From the course: Advanced NLP with Python for Machine Learning

Start my 1-month free trial

How to implement doc2vec

- [Instructor] Now that we've learned a little bit about doc2vec and document vectors in general, let's learn how to actually implement doc2vec. This should be quite similar to word2vec. Before we dive in, recall with word2vec, we had two options. Pre-trained vectors or vectors trained directly on our data. We have the same option for doc2vec, but there aren't quite as many options for pre-trained vectors and they are as easy to access. So include a note with some links at the end of this notebook, but we're going to focus on training a doc2vec model on our own data. So let's read in our data, clean it up and split it into training and test sets. Now, one of the differences between word2vec and doc2vec is that doc2vec requires you to create tagged documents. This tagged document, expects a list of words and a tag for each document. And then the doc2vec model trains on top of those tagged documents. This tag is useful if…

Contents