fenchri / edge-oriented-graph

Source code for the EMNLP 2019 paper: "Connecting the Dots: Document-level Relation Extraction with Edge-oriented Graphs"
Other
146 stars 17 forks source link

Question about edge representation #8

Closed light8lee closed 4 years ago

light8lee commented 4 years ago

Firstly, you can really code, thank you for openning source. The question is that in your implementation, when connecting nodes of different types, the edge's representation depends on the direction, because you just concat first node's representation and second node's representation and ignore their types, for example, x_ms=[n_m;n_s] != x_sm=[n_s;n_m]. It seems to be more like arc, not edge, though I think it's not really matter.

fenchri commented 4 years ago

Hi and thanks for your comment!

Indeed in this particular type of edge (MS), the initial edge representation is created using only the information from the nodes (the type of the node: M, E or S is included here). Initially the representation is just the reverse and then this is passed from a linear layer for dimensionality reduction. The linear layer will give different representations for each edge direction. Also, after the walk-based layer, each direction (MS and SM) will also end-up having different representation.

If by arc, you mean directed edges then you can say that we do have different representations based on the directionality, hence direction is encoded inside the edge representations.

Since 'edges' are a more common terminology for graphs, I used that :) The non-directional graph you might see in the paper, simply means that we connect both MS and SM, rather than only one of them, when constructing the adjacency matrix.

light8lee commented 4 years ago

Thank you, it's really helpful.