monarch-initiative / monarch-semantic-similarity-profiles

MIT License
2 stars 0 forks source link

Add a method for generating ontology embeddings to makefile #6

Open matentzn opened 1 year ago

matentzn commented 1 year ago

From @caufieldjh:

To get graph embeddings (note this is just with grape - NEAT may be used to automate the process, but this is what runs): Install grape: pip install grape

from grape.datasets.kghub import KGPhenio
from grape.embedders import FirstOrderLINEEnsmallen
graph = KGPhenio()
embedding = FirstOrderLINEEnsmallen().fit_transform(graph)

By default, embedding will be a pandas df, or if you run `.fit_transform(graph, return_dataframe=False) then it will be a numpy array. So the final step is to save accordingly, e.g. with embedding.to_csv('embedding.tsv', sep="\t")

matentzn commented 1 year ago

@souzadevinicius This is of moderate but relatively high priority, because I expect hiccups :D