dmcc / PyStanfordDependencies

Python interface for converting Penn Treebank trees to Stanford Dependencies and Universal Depenencies
https://pypi.python.org/pypi/PyStanfordDependencies
68 stars 17 forks source link

Conversion of NLTK tree to PTB format #11

Closed anirudh708 closed 9 years ago

anirudh708 commented 9 years ago

The convert_tree() function is not able to form dependencies for a nltk tree and an alternate conversion from nltk to ptb doesnt work

[via http://stackoverflow.com/a/29614388/1118542]

dmcc commented 9 years ago

Thanks for the report. convert_tree() isn't designed to take NLTK Tree objects as arguments -- only strings of Penn Treebank trees (though it's easy to convert a Tree to this type of string with str()).

If you're using the Subprocess backend, there's a debug=True flag that you can pass to convert_tree() which may provide additional information.

If this doesn't help, please provide more details (ideally the whole sequence of PyStanfordDependencies related commands including which backend, version of SD, the string of the tree you want to convert, etc.).