About 2-hop node extraction function: According to code, I think it just extract 1hop nodes. Is there other code to change it?
Chienwang5 opened this issue · 1 comments
In these code
GreaseLM/preprocess_utils/graph.py
Line 315 in 65d7ac8
It extract 2-hop nodes from KG, but it just extract 1-hop nodes from kg actually.
I think it is indeed a 2-hop path: cid_1 - extra_node - cid_2
, where cid_1
and cid_2
may be question and answer nodes that come from the qa_nodes
of a statement.
Recall that in the code, the extra_nodes
are the intersection of the neighbouring nodes of the each qid and aid.
GreaseLM/preprocess_utils/graph.py
Line 322 in 65d7ac8
So I think your conclusion
but it just extract 1-hop nodes from kg actually.
is correct, in the sense that the extra_nodes
are just a 1-hop neighbour of qid
and aid
. However, by taking the intersection, the extra_nodes
are the nodes that bridges qid
and aid
such that together they form a 2-hop path.
Please correct me if my interpretations were wrong:)