Skip to content

multimeric/doc2vec_agg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doc2vec_agg

Installation

pip install git+https://github.com/TMiguelT/doc2vec_agg.git

Usage

from word2vec_agg.word2vec import docvector

# Generate the document vector
doc_vector = docvector(
    word2vec='./GoogleNews-vectors-negative300.bin', # Path to pretrained doc2vec embeddings, in binary format
    text=['passenger', 'terminal', 'building'], # Array of preprocessed tokens, representing the document
    max=True, # True if you want the maximum of each dimension in the final output
    mean=True, # True if you want the mean of each dimension in the final output
    min=True # True if you want the minimum of each dimension in the final output
)

# Do operations with the vector
from scipy.spatial import distance

return distance.cosine(doc_vector_1, doc_vector_2)

About

Generates simple document vectors from word2vec embeddings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages