You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the relation of the node may be wrong because when assigning a relation to a node, the relation of its left or right child may be changed already.
def back_prop(tree, doc):
""" Starting from leaf node, propagating node
information back to root node
:type tree: SpanNode instance
:param tree: an binary RST tree
"""
tree_nodes = RstTree.BFTbin(tree)
tree_nodes.reverse()
for node in tree_nodes:
if (node.lnode is not None) and (node.rnode is not None):
# Non-leaf node
node.edu_span = RstTree.__getspaninfo(node.lnode, node.rnode)
node.text = RstTree.__gettextinfo(doc.edu_dict, node.edu_span)
if node.relation is None:
# If it is a new node created by binarization
if node.prop == 'Root':
pass
else: node.relation = RstTree.__getrelationinfo(node.lnode, node.rnode)
The text was updated successfully, but these errors were encountered:
This only happens for nodes created during binarization though - if left and right child are "real" nodes then their relations wouldn't have changed, and if left or right child are also created during binarization, then they should have received the correct relation from below since we are going bottom up.
the relation of the node may be wrong because when assigning a relation to a node, the relation of its left or right child may be changed already.
def back_prop(tree, doc):
""" Starting from leaf node, propagating node
information back to root node
:type tree: SpanNode instance
:param tree: an binary RST tree
"""
tree_nodes = RstTree.BFTbin(tree)
tree_nodes.reverse()
for node in tree_nodes:
if (node.lnode is not None) and (node.rnode is not None):
# Non-leaf node
node.edu_span = RstTree.__getspaninfo(node.lnode, node.rnode)
node.text = RstTree.__gettextinfo(doc.edu_dict, node.edu_span)
if node.relation is None:
# If it is a new node created by binarization
if node.prop == 'Root':
pass
else:
node.relation = RstTree.__getrelationinfo(node.lnode, node.rnode)
The text was updated successfully, but these errors were encountered: