Graph-Convolution-on-Structured-Documents
Graph-Convolution-on-Structured-Documents copied to clipboard
graph_dict object wont preserve both neighbours of node (right side and below)
See here
graph_dict = {}
for src_id, row in df.iterrows():
if row['below_obj_index'] != -1:
graph_dict[src_id] = [row['below_obj_index']]
if row['side_obj_index'] != -1:
graph_dict[src_id] = [row['side_obj_index']]
Great remark @ramicetty I just found this out too and I was able to get passed it with the code below
graph_dict = {}
for src_id, row in df.iterrows():
node_connection_list = []
if row['below_obj_index'] != -1:
node_connection_list.append(row['below_obj_index'])
if row['side_obj_index'] != -1:
node_connection_list.append(row['side_obj_index'])
if node_connection_list:
graph_dict[src_id] = node_connection_list
Hope this helps