udapi.block.transform.proj module

Block Proj for (pseudo-)projectivization of trees à la Nivre & Nilsson (2005).

See http://www.aclweb.org/anthology/P/P05/P05-1013.pdf. This block tries to replicate Malt parser’s projectivization: http://www.maltparser.org/userguide.html#singlemalt_proj http://www.maltparser.org/optiondesc.html#pproj-marking_strategy

TODO: implement also path and head+path strategies.

TODO: Sometimes it would be better (intuitively) to lower the gap-node (if its whole subtree is in the gap and if this does not cause more non-projectivities) rather than to lift several nodes whose parent-edge crosses this gap. We would need another label value (usually the lowering is of depth 1), but the advantage is that reconstruction of lowered edges during deprojectivization is simple and needs no heuristics.

class udapi.block.transform.proj.Proj(strategy='head', lifting_order='deepest', label='misc', **kwargs)[source]

Bases: Block

Projectivize the trees à la Nivre & Nilsson (2005).

lift(node)[source]
mark(node, label)[source]
nonproj_info(node)[source]
process_tree(tree)[source]

Process a UD tree