Saving in nltk_tree format

10 views
Skip to first unread message

Dimitrios Bogiatzoules

unread,
Jun 5, 2017, 8:53:02 PM6/5/17
to Pattern
Hi all!

I'm trying to parse a text using the command line interface but I only managed to save my results in XML or as a text file. Is there a way to save it in the NLTK tree format?

I get something like this

I/PRP/I-NP/O/NP-SBJ-1/O/i/person eat/VBP/I-VP/O/VP-1/O/eat/action
pizza/NN/I-NP/O/NP-OBJ-1/O/pizza/food

but I need this

(S
  (NP (PRP I))
  (VP (VBP eat) (PNP (PP (IN with)) (NP (DT a) (NN fork))))
  (NP (NN pizza)))

Has anyone done this before or can anyone point me where to search? I'm obviously not a programmer but I'm willing to learn!

Kind regards

Taki

Reply all
Reply to author
Forward
0 new messages