def leaves(tree):
    """Finds NP (nounphrase) leaf nodes of a chunk tree."""
for subtree in tree.subtrees(filter=lambda t: t.node == 'NP'):
    yield subtree.leaves()
SyntaxNet creating tree to root verb