I want to pass my trained gensim word2vec model as an embedding model to FAISS.from_documents()
. Thereby I get an error
AttributeError: 'Word2Vec' object has no attribute 'embed_documents'
My code:
w2v_model = Word2Vec(sentences=list_pre_word2vec)
# # #
# # # some training magic for Word2Vec
# # #
from langchain.vectorstores import FAISS
# storing embeddings in the vector store
vectorstore = FAISS.from_documents(clean, w2v_model)
clean
is list of langchain documents.
How can I pass my word2vec model as an embedding model to FAISS.from_documents()
, how can I use the model in langchain? Is this an recommended approach or is there a better (easier, more efficient) way?
Thanks in forward.