find all pairs of adjacent subtrees (rooted in specific nonterminal) of a parse tree

26 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Tatiana Gaponova

belum dibaca,
24 Apr 2015, 14.30.4024/04/15
kepadanltk-...@googlegroups.com

How can I efficiently list all pairs of subtrees (rooted in specific nonterminal) of a parse tree? For example, I have the following tree:

(S (S (S (S (X (PRO pro))) (X (V v))) (X (ADJ adj))) (X (N n)))

You can see the image on this link.

I want to list all adjacent instances of the symbol X expanding to other symbols, i. e.:

  1. (X (PRO pro)) and (X (V v))
  2. (X (V v)) and (X (ADJ adj))
  3. (X (ADJ adj)) and (X (N n))

Raúl Speroni

belum dibaca,
4 Mei 2015, 17.02.1404/05/15
kepadanltk-...@googlegroups.com
Hi, could yo solve this? im facing a similar problem. 

thanks!

Steven Bird

belum dibaca,
13 Mei 2015, 06.57.2613/05/15
kepadanltk-...@googlegroups.com

I recommend using the new tgrep module recently added to NLTK (install the latest version from GitHub), and once you've identified the nodes of interest, generate all pairs of subtrees using nested iteration.


--
You received this message because you are subscribed to the Google Groups "nltk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nltk-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Balas ke semua
Balas ke penulis
Teruskan
0 pesan baru