/doc2vec-pytorch

Tutorial: implementing doc2vec (paragraph vectors) from scratch in PyTorch

Primary LanguageJupyter NotebookGNU Affero General Public License v3.0AGPL-3.0

Doc2vec from scratch in PyTorch

This notebook explains how to implement doc2vec using PyTorch. It's aimed at relative beginners, but basic understanding of word embeddings (vectors) and PyTorch are assumed.

The implementation we end up with is hopefully correct but definitely not perfect. There's room for improvement in efficiency and features. Plus I have no intention of maintaining this, so please use a more established implementation for "serious" work. If you would like a PyTorch implementation, I recommend this one, from which this borrows extensively.

Visualization of the notebook model's results for the BBC dataset: