I have been trying to figure out how to do this for awhile. I have an nltk tree that looks like this:
(S (NP (DT the/DT) (AJNN (RBAJ (RB extremely/R