Graph-Convolution-on-Structured-Documents icon indicating copy to clipboard operation
Graph-Convolution-on-Structured-Documents copied to clipboard

graph_dict object wont preserve both neighbours of node (right side and below)

Open ramicetty opened this issue 4 years ago • 1 comments

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']]

ramicetty avatar Sep 02 '20 11:09 ramicetty

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

brahim-lamnaouar avatar Mar 23 '21 17:03 brahim-lamnaouar