Jul-04-2021, 05:02 PM
I have to apologise, I did not read your code well enough. The truth is I am not sure what the solution is. You say the file with the models is:
But beware: "models/word2vec.model" is a relative path. Perhaps the program executes a chdir() to the right directory (the directory that contains the models subdirectory) but it may also be dependent of your current directory when you start the program. If you get "FileNotFoundError" then try to fill in the absolute path.
path = "models/word2vec.model"You do not say where in the program you have put this line. But perhaps line 2 of method loadModel() should be:
self.path = "models/word2vec.model" # Word2Vec model path( now with quotes again.)
But beware: "models/word2vec.model" is a relative path. Perhaps the program executes a chdir() to the right directory (the directory that contains the models subdirectory) but it may also be dependent of your current directory when you start the program. If you get "FileNotFoundError" then try to fill in the absolute path.