glopezas commited on
Commit
9fdc3ed
·
verified ·
1 Parent(s): 390c131

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +97 -31
README.md CHANGED
@@ -1,6 +1,4 @@
1
- ---
2
- license: cc-by-sa-4.0
3
- ---
4
  ---
5
  pretty_name: Math StackExchange Curated (Parquet, CC BY-SA 4.0)
6
  dataset_type: text
@@ -29,47 +27,115 @@ configs:
29
 
30
  # Math StackExchange Curated (Parquet, CC BY-SA 4.0)
31
 
32
- This dataset is a curated collection of Math StackExchange (MSE) Q&A pairs packaged in **Parquet** format for efficient loading and training.
33
- Each example contains a problem statement (`title`, `question_body`), a corresponding community answer (`answer_body`), a tag string (`tags`), and an indicator of whether the answer is the accepted solution (`accepted`).
34
 
35
- > **Source & License**
36
- > Content is derived from the **Stack Exchange Data Dump** for **Math StackExchange** (CC BY-SA 4.0, © Stack Exchange Inc.).
37
- > This derived dataset is released under **CC BY-SA 4.0** to comply with the share-alike terms.
38
- > Please attribute Math StackExchange and Stack Exchange Inc. when using this dataset.
39
 
40
  ---
41
 
42
- ## Splits & Files
43
 
44
- - `math_stackexchange_train.parquet`
45
- - `math_stackexchange_val.parquet`
46
- - `math_stackexchange_test.parquet`
47
-
48
- > All files are columnar **Parquet** for fast streaming and low storage overhead.
49
 
50
  ---
51
 
52
  ## Schema
53
 
54
- | field | dtype | description |
55
- |----------------|--------|-------------|
56
- | `title` | string | Thread title (short problem description). |
57
- | `question_body`| string | Full post body of the question (often includes LaTeX/MathJax). |
58
- | `answer_body` | string | Answer text (the primary answer included in this dataset). |
59
- | `tags` | string | Pipe-delimited MSE tags, e.g. `\|number-theory\|elementary-number-theory\|`. |
60
- | `accepted` | int64 | `1` if the included answer is the accepted solution, otherwise `0`. |
61
-
62
- > **Note on `tags`:** tags come as a single string with leading/trailing pipes. See the snippet below to normalize them into a Python list.
63
 
64
  ---
65
 
66
  ## Example
67
 
68
- ```json
 
69
  {
70
- "title": "Numbers are too large to show $65^{64}+64^{65}$ is not a prime",
71
- "question_body": "I tried to find cycles of powers, but they are too big. Also $65^{n} \\equiv 1(\\text{mod}64)$, so I dont know how to use that.",
72
- "answer_body": "Hint ... x^4 + 64 y^4 = (x^2+8y^2)^2 - (4xy)^2 = ... [factorizations and references] ...",
73
- "tags": "|elementary-number-theory|",
74
- "accepted": 0
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```
 
 
2
  ---
3
  pretty_name: Math StackExchange Curated (Parquet, CC BY-SA 4.0)
4
  dataset_type: text
 
27
 
28
  # Math StackExchange Curated (Parquet, CC BY-SA 4.0)
29
 
30
+ This dataset is a curated collection of Math StackExchange (MSE) Q&A pairs packaged in Parquet format.
31
+ Each sample contains a problem (`title`, `question_body`), its corresponding answer (`answer_body`), the original MSE tag string (`tags`), and a flag indicating whether the answer was accepted (`accepted`).
32
 
33
+ This dataset includes content derived from the Math StackExchange public data dump (CC BY-SA 4.0, © Stack Exchange Inc.).
34
+ This derived dataset is released under CC BY-SA 4.0 in accordance with the license terms.
 
 
35
 
36
  ---
37
 
38
+ ## Files
39
 
40
+ - math_stackexchange_train.parquet
41
+ - math_stackexchange_val.parquet
42
+ - math_stackexchange_test.parquet
 
 
43
 
44
  ---
45
 
46
  ## Schema
47
 
48
+ Field | Type | Description
49
+ ----- | ----- | -----------
50
+ title | string | The title of the original Math StackExchange thread.
51
+ question_body | string | Full body of the question, often including LaTeX/MathJax.
52
+ answer_body | string | The answer chosen for this dataset (may or may not be accepted).
53
+ tags | string | Pipe-delimited set of tags, e.g. `|number-theory|elementary-number-theory|`.
54
+ accepted | int64 | `1` if the included answer was the accepted solution, else `0`.
 
 
55
 
56
  ---
57
 
58
  ## Example
59
 
60
+ ```
61
+
62
  {
63
+ "title": "Numbers are too large to show $65^{64}+64^{65}$ is not a prime",
64
+ "question_body": "I tried to find cycles of powers ...",
65
+ "answer_body": "Hint x^4 + 64 y^4 = ...",
66
+ "tags": "|elementary-number-theory|",
67
+ "accepted": 0
68
+ }
69
+
70
+ ```
71
+ ```
72
+
73
+ {
74
+ "title": "Rank-one Matrix (first step in proving the SVD by induction on the rank of A)",
75
+ "question_body": "Suppose A has rank 1 ...",
76
+ "answer_body": "Since A has rank 1, any two columns are linearly dependent ...",
77
+ "tags": "|matrices|numerical-linear-algebra|",
78
+ "accepted": 0
79
+ }
80
+
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Loading
86
+
87
+ ### Using Hugging Face datasets
88
+
89
+ ```
90
+
91
+ from datasets import load_dataset
92
+ ds = load_dataset("<username>/<dataset_name>")
93
+ print(ds["train"][0])
94
+
95
+ ```
96
+
97
+ ### Loading Parquet directly
98
+
99
+ ```
100
+
101
+ from datasets import Dataset
102
+ train = Dataset.from_parquet("math_stackexchange_train.parquet")
103
+ val = Dataset.from_parquet("math_stackexchange_val.parquet")
104
+ test = Dataset.from_parquet("math_stackexchange_test.parquet")
105
+
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Tag normalization
111
+
112
+ ```
113
+
114
+ def split_tags(s):
115
+ if not s:
116
+ return []
117
+ return [t for t in s.strip("|").split("|") if t]
118
+
119
+ example = ds["train"][0]
120
+ tags = split_tags(example["tags"])
121
+ print(tags)
122
+
123
+ ```
124
+
125
+ ---
126
+
127
+ ## License & Attribution
128
+
129
+ License: CC BY-SA 4.0
130
+ Attribution is required:
131
+ "This dataset includes content derived from the Math StackExchange public data dump (CC BY-SA 4.0, © Stack Exchange Inc.)."
132
+ Share-alike applies: derivatives must also be released under CC BY-SA 4.0.
133
+
134
+ Full license: https://creativecommons.org/licenses/by-sa/4.0/
135
+
136
+ ---
137
+
138
+ ## Changelog
139
+
140
+ v1.0 — Initial release (train/val/test in Parquet).
141
+ ```