How Do I Use OpenNLP To Convert English Sentences To SQL Queries?

My experience says that OpenNLP doesn’t have any inbuilt functionality for converting English sentences to SQL queries. But you can go for developing a dedicated module by efficiently utilizing the existing OpenNLP modules. For example, named entity extraction, chunking, and parsing, etc. using these can help you in succeeding without any hassle. There are many approaches like “Natural Language Interfaces to databases” you can follow to get the answer to your question. But, if you are open to Python, this can be done through it. You can also try to write a new DSL for this.

Generally, a common question answering system like NLIDB has two key components, i.e. the question analysis and the answer retrieval.

When you give input through putting any question or query, few key terms are produced by the question analysis component, question category or class as well as the input question’s structure. While taking out the output of the question during the question analysis of the component as input, the answer retrieval component will first generate a concrete query expression. This will be done in the database query language, just like the SQL query.

Later, the solid SQL query is used for finding an appropriate answer in a particular target database. During this process using the semantic lexicons, like "WordNet" can be beneficial for mapping the extracted key terms like relations, or concepts to the database concepts like columns or even table names.

Views: 181

Reply to This

Our Sponsors

Would you like to reach over 90,000 + Risk Professionals? 



Current Partners Include:


Join GRC Inner Circle - Get Top Risk Resources, Member Support PLUS become our patron

Business Exchange

If your organization delivers products and services that bring value to our members, you are welcome to join our partnership program.

Companies are welcome to setup a business profile page in our Multimedia Business Directory. You will get full control of the page and can include cutting edge possibilities – videos, adverts, presentations, white papers, job offers, Press Releases, product information, company blog, news feeds and more.


Our Knowledge Partners

Request our MEDIA KIT

Our Twitter feed

© 2020   Created by Boris Agranovich.   Powered by

Badges  |  Report an Issue  |  Terms of Service