draw tree from s expression by nltk

 >>> import nltk
 >>> from nltk.tree import *
 >>> tree2 = Tree.fromstring('(S (NP I) (VP (V enjoyed) (NP my cookie)))')
 >>> tree2.draw()

タグ:

python nlp
最終更新:2014年12月28日 04:34