StackMathematics-XL / README.md
FurkanNar's picture
Update README.md
d9dc045 verified
|
Raw History Blame Contribute Delete
2.65 kB
metadata
license: mit
task_categories:
  - question-answering
language:
  - en
tags:
  - agent

Mathematics Stack Exchange Q&A Dataset

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.

Dataset summary

  • Source: Mathematics Stack Exchange (via the official Stack Exchange API)
  • Content: High-quality Q&A pairs (question title + body, top answer body)
  • Formats: CSV and JSON
  • Typical fields:
    • question_id (int)
    • question_title (string)
    • question_body (string, cleaned of HTML)
    • question_score (int)
    • question_tags (string, comma-separated)
    • question_url (string)
    • answer_body (string, cleaned of HTML; empty if no answer)
    • answer_score (int)
    • answer_accepted (bool)
    • combined_text (string, "Q: \n\n<body>\n\nA: <answer or placeholder>")</li> <li><code>scraped_at</code> (ISO 8601 timestamp)</li> </ul> </li> </ul> <p>Example CSV header:</p> <pre><code>question_id,question_title,question_body,question_score,question_tags,question_url,answer_body,answer_score,answer_accepted,combined_text,scraped_at </code></pre> <h2 class="relative group flex items-baseline"> <a id="how-the-dataset-was-generated" class="block pr-1.5 text-lg md:absolute md:p-1.5 md:opacity-0 md:group-hover:opacity-100 md:right-full" href="#how-the-dataset-was-generated" > <span class="header-link"><!--[--><svg class="text-gray-500 hover:text-black dark:hover:text-gray-200 w-4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!--]--></span> </a> <span> How the dataset was generated </span> </h2> <p>The dataset was produced by a script that uses the official Stack Exchange API:</p> <ul> <li>Requests top-voted mathematics questions (configurable count)</li> <li>For each question, fetches the top answer (if any)</li> <li>Cleans HTML from bodies (HTML entities unescaped and tags removed), collapses whitespace</li> <li>Produces both CSV and JSON exports</li> <li>Respects rate limits and inserts polite delays</li> </ul> <p>Notes:</p> <ul> <li>The generator script is not included in this repository. If you want to include it, add the script file (for example <code>scripts/generate_math_se_dataset.py</code>) and reference it here.</li> <li>For reproducibility, include the script, the exact arguments used, and the timestamp of generation.</li> </ul> <h2 class="relative group flex items-baseline"> <a id="data-quality--known-limitations" class="block pr-1.5 text-lg md:absolute md:p-1.5 md:opacity-0 md:group-hover:opacity-100 md:right-full" href="#data-quality--known-limitations" > <span class="header-link"><!--[--><svg class="text-gray-500 hover:text-black dark:hover:text-gray-200 w-4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!--]--></span> </a> <span> Data quality & known limitations </span> </h2> <ul> <li>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.</li> <li>Only the top answer (by score) is captured — accepted vs. highest-scored may differ; both are recorded if available.</li> <li>Potential biases:<ul> <li>Questions with higher votes and English-language questions are overrepresented if using a top-voted query.</li> <li>Highly specialized or duplicate content may appear.</li> </ul> </li> <li>Empty <code>answer_body</code> means no answer was available at scraping time.</li> <li>Some fields may contain non-ASCII characters; files are exported with UTF-8 encoding.</li> </ul>