Stanford NLP parse tree format

后端 未结 2 1706
一生所求
一生所求 2020-12-15 02:05

This may be a silly question, but how does one iterate through a parse tree as an output of an NLP parser (like Stanford NLP)? It\'s all nested brackets, which is neither an

2条回答
  •  心在旅途
    2020-12-15 02:43

    Note that if you're interested in specific nodes in the tree, identified by regex-like rules, you can use this very, very hand class to extract all such nodes using a regex-like matcher:

    http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/trees/tregex/TregexPattern.html

提交回复
热议问题