FerreroJeremy / ln2sql

A tool to query a database in natural language
GNU General Public License v3.0
510 stars 200 forks source link

Understanding parser #43

Closed satishjasthi closed 6 years ago

satishjasthi commented 6 years ago

Hi everyone, I'm facing difficulty in understanding how exactly key word parsing to map Natural language(NL) query words and database keywords is done.It would be greate if you can breifly explain me how exactly In2sql modue searches and maps words from NL query to database values like column names and cell values. Meanwhile I wish to know whether we can use a data structure like hash table for this problem as defined below

To create a map between columns and table Columns | Table_names Column1 | Table_name1 Column2 | Table_name2

So to check if any word from NLP querry is a column name just check whether word is a key of hash table defined above

And for column value or cell value create a hash table like Values | Column_names Value1 | Column1 Value2 | Column1 . . Valuen | Column_m where there will be m columns and n values in total in database. So to check whether a word from NLP query is a cell value, check if the key exists in above hash table. Furthermore, in case of cell value repeating in more than one columns then use chaining concept for hash table's key.

FerreroJeremy commented 6 years ago

If you have any questions about the project, please send me an email in private, with some more specific questions and I would be happy to answer.