jhlau / doc2vec

Python scripts for training/testing paragraph vectors
Apache License 2.0
640 stars 191 forks source link

model loading #34

Closed ShrikanthSingh closed 2 years ago

ShrikanthSingh commented 4 years ago

I have been using google colab for my project with python version 3.6. The pretrained model "English Wikipedia" loads perfectly and even works fine for my downstream task. But I want to know if it will load in the same way without any problem in future too.

vishaal27 commented 4 years ago

Hi, could you share the gensim version that you are using for loading the pretrained English Wikipedia model. I am unable to load the pretrained model when using gensim version 3.8.1 on python 3.5.2.

ShrikanthSingh commented 4 years ago

Hi, could you share the gensim version that you are using for loading the pretrained English Wikipedia model. I am unable to load the pretrained model when using gensim version 3.8.1 on python 3.5.2.

image

vishaal27 commented 4 years ago

Thanks, could you also please share the python script that you used to infer the vectors from the pretrained (English Wikipedia) Doc2Vec model.

ShrikanthSingh commented 4 years ago

Thanks, could you also please share the python script that you used to infer the vectors from the pretrained (English Wikipedia) Doc2Vec model.

image

vishaal27 commented 4 years ago

Thanks, but I was asking about the model loading. If you could, please share the code used for defining and using the pre-trained weights for the model variable m in your script above.

ShrikanthSingh commented 4 years ago

Thanks, but I was asking about the model loading. If you could, please share the code used for defining and using the pre-trained weights for the model variable m in your script above.

model="/content/drive/My Drive/Doc2vec Pre-trained/doc2vec.bin"

load model

m = g.Doc2Vec.load(model)

seriiix commented 4 years ago

@ShrikanthSingh Can you provide the full code you wrote to use this pre-trained model? Sorry I'm very new to python.

ShrikanthSingh commented 4 years ago

@ShrikanthSingh Can you provide the full code you wrote to use this pre-trained model? Sorry I'm very new to python.

I didn't do anything new, just implemented the code from InferTest.py from this repository in addition I saw an example from the website https://ai.intelligentonlinetools.com/ml/page/2/

vishaal27 commented 4 years ago

Thanks, but I was asking about the model loading. If you could, please share the code used for defining and using the pre-trained weights for the model variable m in your script above.

model="/content/drive/My Drive/Doc2vec Pre-trained/doc2vec.bin"

load model

m = g.Doc2Vec.load(model)

Could you please share the pre-trained model file that you use doc2vec.bin over Google drive? It seems as though I am not able to load the file given in the link in this repository.

parshin76 commented 2 years ago

m this repository in addition I saw an example from the @ShrikanthSingh Thanks a lot! I also tried the codes with gensim 3.6.0 instead of the provided forked gensim by this repo and the inference vectors were created very smoothly.