From word to document embeddings