ShayanTalaei / CHESS

Contextual Harnessing for Efficient SQL Synthesis
Apache License 2.0
103 stars 25 forks source link

How did you guys use the results from entity retrieval and context retrieval #8

Closed 652994331 closed 7 hours ago

652994331 commented 1 month ago

HI, how did you guys use results from entity retrieval and context retrieval . I saw this diagram

截屏2024-09-26 17 45 45

to my understanding , you used result from entity retrieval and context retrieval in the column filtering step, but when I looked at the prompt of column filtering part, it's looks like it's a iterative process and you used this prompt "column by column" to check the relevance of columns and question, and I did not see entity and context part In this prompt.

截屏2024-09-26 17 46 50
ShayanTalaei commented 7 hours ago

Hi, thanks for your questions, and sorry for the delayed reply!

For prompts with the database schema, we pass the retrieved entities and context as comments in the database schema for their corresponding column. For instance:

CREATE TABLE from
(
...
`County Name` TEXT null, -- Example Values: `Los Angeles`, 
`Free Meal Count (K-12)` REAL null, -- Column Description: Free Meal Count (K-12) | Value Description: eligible free rate = Free Meal Count / Enrollment,
...
) 

For the column filtering prompt specifically, we pass it in the COLUMN_PROFILE, which contains the table name, column name, the retrieved relevant values, and the context of that column.