Searching Natural Language Sentence Structure

前端 未结 3 715
广开言路
广开言路 2021-02-04 19:54

What\'s the best way to store and search a database of natural language sentence structure trees?

Using OpenNLP\'s English Treebank Parser, I can get fairly reliable se

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-04 20:27

    This is not a complete answer, but if you want to perform linguistically sophisticated queries on your trees, the best bet is to pre-process your parser output and search it with tgrep2:

    http://www.stanford.edu/dept/linguistics/corpora/cas-tut-tgrep.html

    Trgrep/tgrep2 are, as far as I know, the most flexible and full-featured packages for searching parse trees. This is not a MySQL-based solution as you requested, but I thought you might be interested to know about this option.

    Tgrep2 allows you to ask questions about parents, descendants and siblings, whereas other solutions would not retain the full tree structure of the parse or allows such sophisticated queries.

提交回复
热议问题