How to import the HeteroData from .csv file containing triplet? #7349
-
Dear PyG community, Greetings, I have questions about the knowledge graph embedding(KGE) using pytorch geometric. When I have a knowledge graph with a .csv file containing triplet as below, how can I import it as HeteroData format? Note that there were any initial feature vectors for entities and relations. In this case, how can features be initialized? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Pyg doesn't have an inbuilt functions to generate
Now since you don't have node features, you could
|
Beta Was this translation helpful? Give feedback.
Pyg doesn't have an inbuilt functions to generate
HeteroData
object from the kind of data you shared. You'll have to write your own functions which does something likehead_label
andtail_label
pair construct anedge_index
, and add it toHeteroData
object.Now since you don't have node features, you could
degree
,centrality
etc