GraphWriter icon indicating copy to clipboard operation
GraphWriter copied to clipboard

MkGraphs Code in lastDataset.py

Open anthorax1234 opened this issue 5 years ago • 4 comments

Hi, I am going over the input data code, particularly the mkGraphs function. I'm a bit confused on the rel matrix, where rel is the list. What exactly is this rel list? Why does it start with [2] and is further extended with ([y[1]+3,y[1]+3+self.REL.size]). Thanks!

anthorax1234 avatar Jul 21 '20 08:07 anthorax1234

[2] marks the edge to Global Node,y1+3 marks the orgin type edge, and y1+3+self.real.size marks the inversed type edge, they are just numbers and represent the directed edge with different type you can read the paper to know more about the Graph LEVI transfrom

wutaiqiang avatar Jul 21 '20 08:07 wutaiqiang

maybe you can print the rel to see what it is exactly

wutaiqiang avatar Jul 21 '20 08:07 wutaiqiang

Thanks!

Edit: I understood that they represent the directed edge with different type and have printed it before, so were the [2] and "+3" are just chosen arbitrarily?

p.s. Although the paper doesn't explicitly mention anything LEVI Graph transforms, the transform is implicitly one.

anthorax1234 avatar Jul 21 '20 18:07 anthorax1234

I understood that they represent the directed edge with different type and have printed it before, so were the [2] and "+3" are just chosen arbitrarily?

The rel root is specified in the REL vocab. See that line self.REL.special = ['<pad>','<unk>','ROOT'] in lastDataset and hence [2] is the index to that root in the REL.special list.

ahhussein avatar Jul 24 '20 15:07 ahhussein