def unannotate_tree(cls, annotated_tree): """ Remove intermediate nodes (labels beginning with "@") Remove all material on node labels which follow their base symbol (cuts at the leftmost -, ^, or : character) Examples: a node with label @NP->DT_JJ will be spliced out, and a node with label NP^S will be reduced to NP """ debinarized_tree = Trees.splice_nodes(annotated_tree, TreeAnnotations.at_filter) unannotated_tree = Trees.FunctionNodeStripper.transform_tree(debinarized_tree) return unannotated_tree
def unannotate_tree(cls, annotated_tree): """ Remove intermediate nodes (labels beginning with "@") Remove all material on node labels which follow their base symbol (cuts at the leftmost -, ^, or : character) Examples: a node with label @NP->DT_JJ will be spliced out, and a node with label NP^S will be reduced to NP """ debinarized_tree = Trees.splice_nodes(annotated_tree, TreeAnnotations.at_filter) unannotated_tree = Trees.FunctionNodeStripper.transform_tree( debinarized_tree) return unannotated_tree
def unbinarize_tree(cls, tree): """ Remove intermediate nodes (labels beginning with "@") Example: a node with label @NP->DT_JJ will be spliced out, """ return Trees.splice_nodes(tree, TreeBinarization.at_filter)
def unannotate_tree(cls, annotated_tree): debinarized_tree = Trees.splice_nodes(annotated_tree, TreeAnnotations.at_filter) unannotated_tree = Trees.FunctionNodeStripper.transform_tree(debinarized_tree) return unannotated_tree