mercredi 25 février 2015

How to flatten the parse tree and store in a string for further string operations python nltk

I am trying to get flat tree from the tree structure like the one given below. ![Please see the link for parse tree][http://ift.tt/1aekWgi]


I want to get this whole tree in a string like without Bad tree detected error: ( (S (NP-SBJ (NP (DT The) (JJ high) (JJ seven-day) )(PP (IN of) (NP (DT the) (CD 400) (NNS money) )))(VP (VBD was) (NP-PRD (CD 8.12) (NN %) )(, ,) (ADVP (RB down) (PP (IN from) (NP (CD 8.14) (NN %) ))))(. .) ))


Aucun commentaire:

Enregistrer un commentaire