Diego Oliveira Lopes commited on
Commit
0f3fa98
·
1 Parent(s): 2c7ad6f

updating readme

Browse files
Files changed (1) hide show
  1. README.md +66 -1
README.md CHANGED
@@ -10,4 +10,69 @@ tags:
10
  pretty_name: AtlasSQL-BR
11
  size_categories:
12
  - 1K<n<10K
13
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  pretty_name: AtlasSQL-BR
11
  size_categories:
12
  - 1K<n<10K
13
+ ---
14
+
15
+ # AtlasSQL-BR
16
+
17
+ AtlasSQL-BR is a novel geospatial Text-to-SQL dataset in Brazilian Portuguese, built upon real-world open-government data. Integrating school census data, public facility registries, and Brazil's official geographic boundary hierarchies, this dataset provides a robust benchmark for evaluating and training models on spatial queries.
18
+
19
+ ## 📊 Dataset Architecture and Structure
20
+
21
+ The database schema underlying AtlasSQL-BR is organized around thematic public facility tables and their associated geographic boundary layers. This multi-level structure requires models to reason about spatial containment across different administrative granularities within a single SQL statement.
22
+
23
+ * **Thematic Tables (Point Geometries):** The core table is `microdados_ed_basica`, derived from the Brazilian School Census, containing hundreds of infrastructural and pedagogical attributes per school. The schema also includes georeferenced records for other public facilities: libraries, CRAS, CREAS, and Centros POP.
24
+ * **Boundary Tables (Polygon Geometries):** The dataset incorporates all seven official geographic boundary levels from IBGE: country, macro-region, state, municipality, district, neighborhood, and street.
25
+ * **Spatial Operators:** Spatial relationships between facility points and boundary polygons are resolved using PostGIS extensions. The dataset covers a vocabulary of 22 PostGIS spatial functions (e.g., `ST_Intersects`, `ST_Within`, `ST_Contains`, `ST_Distance`).
26
+
27
+ ### Data Fields
28
+ Based on the dataset structure, each record contains the following fields:
29
+ * `question`: The natural language query in Brazilian Portuguese.
30
+ * `sql_code`: The corresponding executable PostGIS/SQL query.
31
+ * `territorial_division`: The administrative boundary level relevant to the query.
32
+ * `level`: The structural complexity tier of the query.
33
+ * `geospatial_functions`: The primary PostGIS functions required to solve the query.
34
+ * `source`: Indicates the origin of the data. It can be `base_dataset` (the original 980 manually annotated questions) or partitions generated by data augmentation techniques (such as `delete`, `insert`, `swap`, `synonym`, `translate`).
35
+
36
+ ## 📈 Complexity Tiers
37
+
38
+ The dataset comprises manually annotated question-SQL pairs classified into four complexity tiers based on the structural properties of the SQL query (all criteria are AND-combined within each tier):
39
+
40
+ | Tier | Structural Criteria |
41
+ | :--- | :--- |
42
+ | **Easy** | <1 JOIN; no aggregations; no subqueries; direct spatial filter. |
43
+ | **Medium** | 2-3 JOINs; no aggregations; multiple spatial conditions. |
44
+ | **Hard** | 3-4 JOINs; >1 aggregation (COUNT, SUM, AVG); multiple spatial functions. |
45
+ | **Very Hard** | 4+ JOINs; multiple aggregations; subqueries and/or CTEs; window functions (ROW_NUMBER, RANK, DENSE_RANK); CASE WHEN; possible UNION. |
46
+
47
+ ## 📁 Files and Reproducibility
48
+
49
+ The dataset is divided into standard `train.parquet` and `validation.parquet` splits.
50
+
51
+ **⚠️ Important Note on Reproducibility:**
52
+ The baseline experiments documented in the original paper were conducted **exclusively** on the original 980 question-SQL pairs. The dataset files available here also include additional data generated through data augmentation techniques.
53
+
54
+ To exactly replicate the experiments and results from the original paper, you **must**:
55
+ 1. Use the dataset version associated with the **`paper-released`** tag.
56
+ 2. Filter the data to include **only** the records where the `source` column is exactly `base_dataset`. The other partitions (`delete`, `insert`, `swap`, `synonym`, `translate`) contain synthetic augmented data and should be excluded when reproducing the paper's base results.
57
+
58
+ ### How to load the dataset for reproducibility (Python)
59
+
60
+ You can easily download and filter the dataset using the Hugging Face `datasets` library to match the exact setup used in the paper:
61
+
62
+ ```python
63
+ from datasets import load_dataset
64
+
65
+ # 1. Load the dataset using the specific tag for the paper's release
66
+ dataset = load_dataset("datafromlopes/atlas-sql-br", revision="paper-released")
67
+
68
+ # 2. Filter both train and validation splits to include only the original 980 questions
69
+ base_train = dataset["train"].filter(lambda x: x["source"] == "base_dataset")
70
+ base_validation = dataset["validation"].filter(lambda x: x["source"] == "base_dataset")
71
+
72
+ print(f"Original Train size: {len(base_train)}")
73
+ print(f"Original Validation size: {len(base_validation)}")
74
+ ```
75
+
76
+ ## ✒️ Citation
77
+
78
+ If you find this dataset useful for your research, please cite the original paper: