samrat-kar commited on
Commit
41507ce
·
verified ·
1 Parent(s): f0a12cf

Add dataset card

Browse files
Files changed (1) hide show
  1. README.md +72 -0
README.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language: [en]
4
+ task_categories: [text-generation]
5
+ tags: [text-to-sql, oracle, accounts-payable, sql, chat]
6
+ pretty_name: AP Text-to-SQL (Oracle) PEFT dataset
7
+ size_categories: [1K<n<10K]
8
+ configs:
9
+ - config_name: default
10
+ data_files:
11
+ - split: train
12
+ path: train.jsonl
13
+ - split: validation
14
+ path: val.jsonl
15
+ - split: test
16
+ path: test.jsonl
17
+ ---
18
+
19
+ # ap-sql-peft
20
+
21
+ A chat-format text-to-SQL dataset for Accounts Payable analytics on Oracle. The schema is modelled on Oracle Fusion
22
+ AP, Payments and Supplier tables, and the data behind it is synthetic. The dataset was used to train the LoRA adapter
23
+ [`samrat-kar/ap-sql-v1`](https://huggingface.co/samrat-kar/ap-sql-v1).
24
+
25
+ Every gold SQL query was run against the demo database when the dataset was built; `meta.result_rows` records how many rows it returned.
26
+
27
+ ## Format
28
+
29
+ One JSON object per line:
30
+
31
+ ```json
32
+ {"messages": [{"role": "system", "content": "...rules + CREATE TABLE DDL + glossary..."},
33
+ {"role": "user", "content": "question (or follow-up / repair request)"},
34
+ {"role": "assistant", "content": "```sql\nSELECT ...\n```"}],
35
+ "meta": {"id": "...", "tier": "T1-T5", "family": "...", "kind": "ask|followup|repair-exec|repair-parse",
36
+ "source": "...", "group": "...", "tables": ["..."], "result_rows": 3, "approx_prompt_tokens": 3089, "split": "..."}}
37
+ ```
38
+
39
+ The system prompt is the one the assistant builds at runtime: the rules, then the DDL of the retrieved tables
40
+ (wide tables pruned to join keys plus the relevant columns), then the glossary entries. It is capped at about
41
+ 3,584 tokens so the whole prompt fits a 4,096-token window.
42
+
43
+ ## Splits
44
+
45
+ | tier | train | validation | test |
46
+ |---|---|---|---|
47
+ | T1 (single table, simple) | 284 | 17 | 37 |
48
+ | T2 | 463 | 28 | 56 |
49
+ | T3 | 471 | 34 | 58 |
50
+ | T4 | 143 | 10 | 19 |
51
+ | T5 (hardest) | 80 | 6 | 9 |
52
+ | **total** | **1,441** | **95** | **179** |
53
+
54
+ - **Split by `meta.group`.** Paraphrases and variants of one question always land in the same split, so no test group
55
+ appears in train.
56
+ - **Kinds.** `ask` is a plain question. `followup` carries conversation history. `repair-exec` and `repair-parse`
57
+ give the model a failed query and its Oracle or parse error, and the target is the corrected query.
58
+ - **Sources.** `S2-templated` rows are generated from templates, `S6-repair` rows are repair cases, and
59
+ `S1-golden` rows are hand-written (test split only).
60
+
61
+ ## Usage
62
+
63
+ ```python
64
+ from datasets import load_dataset
65
+ ds = load_dataset("samrat-kar/ap-sql-peft")
66
+ ```
67
+
68
+ ## Limitations
69
+
70
+ - Covers one synthetic schema.
71
+ - Most rows are templated, so question phrasing is less varied than real user traffic.
72
+ - Oracle SQL dialect only.