Hello,
How are you enforcing the -inf condition if the two words are not in the same branch ?
In the code you are setting both the places as 1, bit shouldn't it be 0 and -inf ?
Calculate Visible Matrix
visible_matrix = np.zeros((token_num,token_num))
for item in abs_idx_tree:
src_ids = item[0]
for id in src_ids:
visible_abs_idx = abs_idx_src + [idx for ent in item[1] for idx in ent]
#print(visible_abs_idx)
visible_matrix[id,visible_abs_idx] = 1
for ent in item[1]:
for id in ent:
visible_abs_idx = ent + src_ids
visible_matrix[id,visible_abs_idx] = 1
Hello, How are you enforcing the -inf condition if the two words are not in the same branch ? In the code you are setting both the places as 1, bit shouldn't it be 0 and -inf ?
Calculate Visible Matrix