Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by bm-rf on Monday February 05, 2024 @01:55PM
(#39265295)
Usually you include the database schema in the context, usually by showing the CREATE statement for the tables you want to query. I've also found that including comments in the CREATE sql can guide the model somewhat. The best approach is probably to finetune one of these models using curated questions for your database.
example: give me the revenue for all logistics firms
but in the database these might not be called "logistics" and may be called "transport" (or anything)
maybe there are some counters to this like finding unique values per column or even better use a grammar based approach, wich will select only valid entries.
but the simple text to SQL is at this point not the "hard thing to solve"