sgnlp.models.rst_pointer.data_prep.parse_discourse_tree

parse_discourse_tree(discourse_tree_nodes)[source]
Parses the tree and returns 3 lists containing

the splits in a pre-order traversal form (i.e. Root->left recursive->right recursive), the span’s parent’s representation (i.e. parent_index), the span’s left-sibling’s representation (i.e. sibling_index).

The parent and left-sibling representations are the edu span end index.

e.g. if the parent/left-sibling spans from 2:4, the representative index is 4