Closed STALINFIGUEROAALAVA closed 1 year ago
Euhm... Sure by saving the embeddings in
embeddings, literals = transformer.fit_transform(knowledge_graph, entities)
To a file using standard python functionality... (With open(...), Pickle dump, or whatever you want to use..)
Hi Bram. With the following code, I can read the pickle file and load it into an object. Before, how do I convert the embeddings file to a pickle file? Next, how would you read the embeds from the downloaded pickle file. Please. Do you have an example in python code? to see how to do it. Thank you very much Bram.
import pickle
import pprint
obj = pickle.load(open("sample_data.pickle", "rb"))
with open("out.txt", "a") as f:
pprint.pprint(obj, stream=f)
❓ Question
Very Dear Guilles and Bram, please help me with the following query: You could save or export to a file the embeddings made with pyRDF2Vec in a wikidata knowledge graph, to later work with that file, and not be doing the embeddings again.