parse-tree

How do I retrieve phrases from a NLTK.tree using custom node labels?

How do I retrieve phrases from a NLTK.tree using custom node labels? Question: Given a NLTK tree produced using the code below, how do I retrieve the leaf values (phrases) that potentially match all of the node labels assigned using the nltk.RegexParser (e.g. those phrases which match the Present_Indefinite or Present_Perfect tense)? from nltk import …

Total answers: 1

How can I easily draw a parse tree from Stanford parsing data in python?

How can I easily draw a parse tree from Stanford parsing data in python? Question: So I have this Stanford-style parsing of an english sentence: “There is a tree behind a car” Parse: [S [NP There_EX NP] [VP is_VBZ [NP [NP a_DT tree_NN NP] [PP behind_IN [NP a_DT car_NN NP] PP] NP] VP] S] I …

Total answers: 3