I created my own word vectors with fasttext like so:
model = fasttext.train_unsupervised("corp.txt", model = "skipgram") #train model
model.save_model("`my_model.bin`") #save model
I would now like to load a spacy model with my vectors. For this, I would have to run the following command to create a spacy model
python3 -m spacy init-model de model --vectors-loc some_file.vec
and then I should be able to load it like so:
nlp = spacy.load('model')
My problem is, that I need to feed the vectors and not the model into the command (some_file.vec
) but I only have a my_model.bin
file, containing the model.
I know that I can get specific vectors from the model like so
print(model["test"])
and could loop over all words to get all vectors. But
- I dont know how the .vec file should look like and
- I'm sure there has to be a better way to approach this.
ANY help is greatly appreciated