Searching Natural Language Sentence Structure

前端 未结 3 702
广开言路
广开言路 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:23

    Relational databases cannot store knowledge in a natural way, what you actually need is a knowledge base or ontology (though it may be constructed on top of relational database). It holds data in triplets , so your phrase will be stored as . There's a lot of tools and methods to search inside such KBs (for example, Prolog is a language that was designed to do it). So, all you have to do is to translate sentences from natural language to KB triplets/ontology graph, translate user query to incomplete triplets (your question will look like ) or conjunctive queries and then search on your KB. OpenNLP will help you with translating, and the rest depends on concrete technique and technologies you decide to use.

提交回复
热议问题