rafaelcabral96 commited on
Commit
56f3fff
·
verified ·
1 Parent(s): 213567b

Add README.md

Browse files
Files changed (1) hide show
  1. README.md +122 -0
README.md CHANGED
@@ -1,3 +1,125 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ language:
4
+ - en
5
+ - zh
6
+ task_categories:
7
+ - text-generation
8
+ tags:
9
+ - geometry
10
+ - geometric-constraint-solving
11
+ - reasoning
12
+ - synthetic-data
13
+ - math
14
+ pretty_name: PyGeoX
15
+ size_categories:
16
+ - 10K<n<100K
17
+ configs:
18
+ - config_name: gcs-sft
19
+ data_files: data/PyGeoX-GCS-SFT.jsonl
20
+ - config_name: codegen-sft
21
+ data_files: data/PyGeoX-CodeGen-SFT.jsonl
22
+ - config_name: gcs-rl
23
+ data_files: data/PyGeoX-GCS-RL.jsonl
24
+ - config_name: bench
25
+ data_files: data/PyGeoX-Bench.jsonl
26
+ - config_name: wild
27
+ data_files: data/PyGeoX-Wild.jsonl
28
  ---
29
+
30
+ # PyGeoX
31
+
32
+ Datasets for training and evaluating language models on **geometric constraint solving** —
33
+ reading a natural-language description of a diagram and producing the point coordinates /
34
+ circle radii that satisfy the stated constraints — plus a supervised set for generating
35
+ PyGeoX scene code.
36
+
37
+ ## Subsets
38
+
39
+ | Config | Rows | Task |
40
+ |--------|------|------|
41
+ | `gcs-sft` | 15,738 | SFT — solve geometry (NL → coordinates), merged master with per-variant reward labels |
42
+ | `codegen-sft` | 46,977 | SFT — NL diagram description → PyGeoX code |
43
+ | `gcs-rl` | 46,977 | RL — prompts for geometry constraint solving |
44
+ | `bench` | 300 | Evaluation benchmark (self-contained) |
45
+ | `wild` | 200 | Evaluation — real-world school-geometry questions |
46
+
47
+ ```python
48
+ from datasets import load_dataset
49
+ ds = load_dataset("rafaelcabral96/PyGeoX", "gcs-rl")
50
+ ```
51
+
52
+ > **How this data is meant to be used.** Several subsets contain free-form nested objects
53
+ > (e.g. `Objs`, `possible_solution`) whose keys vary per example. The reward / evaluation
54
+ > harness **downloads the raw `.jsonl` files and parses them line-by-line with `json`** —
55
+ > that always works. The Hugging Face viewer may not fully render the nested fields.
56
+
57
+ ## Reward ground truth (`PyGeoX-GCS-RL-Code.zip`)
58
+
59
+ The problem definitions used to score RL and benchmark outputs are shipped as
60
+ `data/PyGeoX-GCS-RL-Code.zip`. The `source_file` field of each `gcs-rl` row points into
61
+ this folder. After downloading the repo, extract it **inside `data/`** so the relative
62
+ paths resolve:
63
+
64
+ ```bash
65
+ cd data && unzip PyGeoX-GCS-RL-Code.zip # -> data/PyGeoX-GCS-RL-Code/<id>.json
66
+ ```
67
+
68
+ All `source_file` paths are written relative to the repo root
69
+ (`data/PyGeoX-GCS-RL-Code/<name>.json`), so they are invariant to where the repo lives.
70
+
71
+ ## Subset details
72
+
73
+ ### `gcs-sft` — geometry-solving SFT (merged master)
74
+ One deduplicated file keyed by (problem, completion). Each row's `splits` map records, per
75
+ training variant (`sar`, `sar_sd`, `mse`, `mse_sd`, `sparse`, plus the `full` base),
76
+ whether that variant includes it and with what reward/weight. Reconstruct any variant:
77
+
78
+ ```python
79
+ rows = [r for r in ds if r["splits"]["mse_sd"]["in"]]
80
+ weights = [r["splits"]["mse_sd"].get("weight", 1.0) for r in rows]
81
+ ```
82
+
83
+ ### `codegen-sft` — NL → PyGeoX code
84
+ `messages` = (user: diagram description + "Please generate PyGeoX code…", assistant:
85
+ ```python … ``` block), plus `problem_id`, `source_file`, `difficulty`.
86
+
87
+ ### `gcs-rl` — RL prompts
88
+ `messages` (system + user), `source_file` (→ reward ground truth), `difficulty`
89
+ (`easy`/`medium`/`hard` for 1/2/3 primary objects).
90
+
91
+ ### `bench` — evaluation benchmark (self-contained)
92
+ Each record carries everything needed to score a model inline:
93
+ `unique_id, nl_description, pygeox_code, Objs, Rels, Points, extra_rel, possible_solution`.
94
+ Rebuild the scene directly from a record (no file needed) and score predicted coordinates:
95
+
96
+ ```python
97
+ from pygeox.synthetic.llm_client import create_scene_from_json
98
+ scene = create_scene_from_json(domain=10, json_data=record, generate_objective_function=True)
99
+ reward, details = scene.reward.reward_function(pred_points, pred_circles)
100
+ ```
101
+
102
+ ### `wild` — real-world school geometry
103
+ 200 questions from MathVerse, ZhongKaoGeo, and MathVista (`id, question, source,
104
+ source_id`). Ground truth is executable PyGeoX `full_code`, shipped in
105
+ `data/PyGeoX-Wild-Code.zip` (one `problem_<id>.json` per question, keyed 1:1 by `id`,
106
+ each with `full_code` + `possible_solution`). Extract inside `data/`:
107
+
108
+ ```bash
109
+ cd data && unzip PyGeoX-Wild-Code.zip # -> data/PyGeoX-Wild-Code/problem_<id>.json
110
+ ```
111
+
112
+ ## Citation
113
+
114
+ ```bibtex
115
+ @software{pygeox_datasets,
116
+ title = {PyGeoX: Datasets for Geometric Constraint Solving},
117
+ author = {Rafael Cabral},
118
+ year = {2026},
119
+ url = {https://huggingface.co/datasets/rafaelcabral96/PyGeoX}
120
+ }
121
+ ```
122
+
123
+ ## License
124
+
125
+ MIT