FurkanNar commited on
Commit
5555e9d
·
verified ·
1 Parent(s): 38de2c1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +126 -3
README.md CHANGED
@@ -1,3 +1,126 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - question-answering
5
+ language:
6
+ - en
7
+ tags:
8
+ - agent
9
+ ---
10
+ # Mathematics Stack Exchange Q&A Dataset
11
+
12
+ A curated dataset of question-and-answer pairs harvested from Mathematics Stack Exchange (math.stackexchange.com). Each entry contains the question, the top answer (if available), metadata (scores, tags, URL), and a combined Q/A text useful for training and evaluation of question-answering and tutoring models.
13
+
14
+ ## Dataset summary
15
+
16
+ - Source: Mathematics Stack Exchange (via the official Stack Exchange API)
17
+ - Content: High-quality Q&A pairs (question title + body, top answer body)
18
+ - Formats: CSV and JSON
19
+ - Typical fields:
20
+ - `question_id` (int)
21
+ - `question_title` (string)
22
+ - `question_body` (string, cleaned of HTML)
23
+ - `question_score` (int)
24
+ - `question_tags` (string, comma-separated)
25
+ - `question_url` (string)
26
+ - `answer_body` (string, cleaned of HTML; empty if no answer)
27
+ - `answer_score` (int)
28
+ - `answer_accepted` (bool)
29
+ - `combined_text` (string, "Q: <title>\n\n<body>\n\nA: <answer or placeholder>")
30
+ - `scraped_at` (ISO 8601 timestamp)
31
+
32
+ Example CSV header:
33
+ ```
34
+ question_id,question_title,question_body,question_score,question_tags,question_url,answer_body,answer_score,answer_accepted,combined_text,scraped_at
35
+ ```
36
+
37
+ ## License and attribution
38
+
39
+ Content in this dataset is user-contributed content from Stack Exchange and is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.
40
+
41
+ When using or redistributing the dataset, include attribution. A suggested attribution statement:
42
+
43
+ "Data from Mathematics Stack Exchange (math.stackexchange.com). Licensed under CC BY-SA 4.0."
44
+
45
+ Also include a link to the original question pages (the `question_url` field) when practical.
46
+
47
+
48
+ ## How the dataset was generated
49
+
50
+ The dataset was produced by a script that uses the official Stack Exchange API:
51
+
52
+ - Requests top-voted mathematics questions (configurable count)
53
+ - For each question, fetches the top answer (if any)
54
+ - Cleans HTML from bodies (HTML entities unescaped and tags removed), collapses whitespace
55
+ - Produces both CSV and JSON exports
56
+ - Respects rate limits and inserts polite delays
57
+
58
+ Notes:
59
+ - The generator script is not included in this repository. If you want to include it, add the script file (for example `scripts/generate_math_se_dataset.py`) and reference it here.
60
+ - For reproducibility, include the script, the exact arguments used, and the timestamp of generation.
61
+
62
+
63
+ ## Regenerating the dataset
64
+
65
+ Prerequisites:
66
+ - Python 3.8+ (or compatible)
67
+ - `requests` (for API calls)
68
+ - Optional: a Stack Exchange API key (recommended for higher rate limits)
69
+
70
+ Important considerations:
71
+ - Respect Stack Exchange API rate limits; use an API key if you will fetch many pages.
72
+ - The script should include backoff/retry and delays between requests; do not parallelize requests without careful rate-limit handling.
73
+ - If exporting large datasets, consider paging and storing intermediate results.
74
+
75
+
76
+ ## Data quality & known limitations
77
+
78
+ - Bodies are cleaned of HTML but some formatting (math markup, code blocks, LaTeX) may be simplified or lost; consider preserving LaTeX if you need formula fidelity.
79
+ - Only the top answer (by score) is captured — accepted vs. highest-scored may differ; both are recorded if available.
80
+ - Potential biases:
81
+ - Questions with higher votes and English-language questions are overrepresented if using a top-voted query.
82
+ - Highly specialized or duplicate content may appear.
83
+ - Empty `answer_body` means no answer was available at scraping time.
84
+ - Some fields may contain non-ASCII characters; files are exported with UTF-8 encoding.
85
+
86
+
87
+ ## Suggested preprocessing for ML
88
+
89
+ - Deduplicate entries by `question_id`.
90
+ - Normalize or preserve LaTeX as needed (consider using a LaTeX-aware tokenizer when training models that must understand formulas).
91
+ - Truncate or chunk very long texts (both question and answer) when fitting into model context windows.
92
+ - Optionally filter by tags for domain-specific datasets (e.g., `algebra`, `calculus`, `probability`).
93
+
94
+
95
+ ## Use cases
96
+
97
+ - Training and evaluating question-answering systems and math tutoring chatbots
98
+ - Fine-tuning language models on math Q&A patterns
99
+ - Research on problem-solving strategies and reasoning in mathematics
100
+ - Building retrieval-augmented systems with real Q&A examples
101
+
102
+
103
+ ## Privacy, ethics, and policy
104
+
105
+ - The dataset contains user-contributed content under CC BY-SA; comply with the license and provide attribution.
106
+ - Do not claim the content as your own; include proper attribution and linkbacks where practical.
107
+ - Avoid publishing personally identifiable information beyond what is already publicly available on Stack Exchange.
108
+
109
+
110
+ ## Citation
111
+
112
+ If you use this dataset in publications, we suggest citing it as:
113
+
114
+ Furkan Nar or https://github.com/TheOfficialFurkanNar/StackMathematics. (2026). Mathematics Stack Exchange Q&A Dataset. Retrieved from https://github.com/TheOfficialFurkanNar/StackMathematics (data originally from mathematics.stackexchange.com; licensed CC BY-SA 4.0)
115
+
116
+
117
+ ## Contact
118
+ Contact via:
119
+ furkannar168@hotmail.com
120
+ For questions about this dataset or generation script, open an issue in this repository or contact the maintainer.
121
+
122
+ ## Community & Support
123
+
124
+ Join the community to ask questions, discuss the dataset, and get help:
125
+
126
+ - Discord: https://discord.gg/dcjh8S5H