CoolFace
Datasetpublic

Omarrran/stackpulse_qa_output

🧩 StackPulse-QA: Instruction-Tuning Q&A Pairs from Stack Overflow Dataset Summary Instruction-tuning Q&A dataset built from Omarrran/StackPulse_778K_QnA_Code_dataset by joining question IDs with BigQuery bigquery-public-data.stackoverflow.posts_answers on accepted_answer_id. Each sample consists of: input_text_instruct β€” A question (title + body) prefixed with an instruction output_text β€” The accepted answer from Stack Overflow Format mirrors the… See the full description on the dataset page: https://huggingface.co/datasets/Omarrran/stackpulse_qa_output.

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes60downloads
Dataset Card

🧩 StackPulse-QA: Instruction-Tuning Q&A Pairs from Stack Overflow

Dataset Summary

Instruction-tuning Q&A dataset built from Omarrran/StackPulse_778K_QnA_Code_dataset by joining question IDs with BigQuery `bigquery-public-data.stackoverflow.posts_answers` on accepted_answer_id.

Each sample consists of:

  • β€”input_text_instruct β€” A question (title + body) prefixed with an instruction
  • β€”output_text β€” The accepted answer from Stack Overflow

Format mirrors the instruction-tuning dataset from DeepLearning.AI's Finetuning Large Language Models course, ready for fine-tuning PaLM, LLaMA, Mistral, Gemma, Phi, and similar models.


πŸ“Š Processing Progress

  • β€”Runs completed : 4 / 6
  • β€”Questions processed : 400,000 / 554,196
  • β€”Remaining : 154,196

πŸ“ Files in This Dataset

πŸ‹οΈ Training Files (80% split)

FileFormatDescription
data/tunedatastackoverflowpythonqarun1-07:19:04:2026.jsonlJSONLTraining split from 1
data/tunedatastackoverflowpythonqarun2-07:19:04:2026.jsonlJSONLTraining split from 2
data/tunedatastackoverflowpythonqarun3-07:19:04:2026.jsonlJSONLTraining split from 3
data/tunedatastackoverflowpythonqarun4-07:19:04:2026.jsonlJSONLTraining split from 4
data/tunedatastackoverflowpythonqarun5-07:19:04:2026.jsonlJSONLTraining split from 5

πŸ§ͺ Evaluation Files (20% split)

FileFormatDescription
data/tuneevaldatastackoverflowpythonqa_run1-07:19:04:2026.jsonlJSONLEval split from run 1
data/tuneevaldatastackoverflowpythonqa_run2-07:19:04:2026.jsonlJSONLEval split from run 2
data/tuneevaldatastackoverflowpythonqa_run3-07:19:04:2026.jsonlJSONLEval split from run 3
data/tuneevaldatastackoverflowpythonqa_run4-07:19:04:2026.jsonlJSONLEval split from run 4

πŸ“„ Full Metadata CSVs

FileFormatDescription
data/stackpulseqafull_run1-07:19:04:2026.csvCSVFull metadata for run 1
data/stackpulseqafull_run2-07:19:04:2026.csvCSVFull metadata for run 2
data/stackpulseqafull_run3-07:19:04:2026.csvCSVFull metadata for run 3
data/stackpulseqafull_run4-07:19:04:2026.csvCSVFull metadata for run 4

πŸ—οΈ Schema

JSONL Files (training / eval)

Exactly 2 fields per row β€” ready for instruction fine-tuning:

FieldTypeDescription
input_text_instructstringInstruction prefix + question title + question body
output_textstringAccepted answer body (HTML format)

CSV Files (full metadata)

ColumnDescription
question_idStack Overflow question ID
input_texttitle + body (no instruction prefix)
output_textaccepted answer body
inputtextinstructinstruction-prefixed input (same as JSONL)
titlequestion title only
tagspipe-separated tags
q_scorequestion upvote score
view_counttotal views
answer_countnumber of answers
acceptedansweridID of the accepted answer
answer_idID of this answer (= acceptedanswerid)
a_scoreanswer upvote score
is_acceptedalways True (we only keep accepted answers)
creation_datequestion creation timestamp

πŸš€ Quick Start

Load with pandas

python
import pandas as pd

# Training data
train = pd.read_json("data/tune_data_stack_overflow_python_qa_run1-*.jsonl", lines=True)

# Eval data
eval_  = pd.read_json("data/tune_eval_data_stack_overflow_python_qa_run1-*.jsonl", lines=True)

print(train.iloc[0]["input_text_instruct"][:300])
print(train.iloc[0]["output_text"][:300])

Load with HuggingFace datasets

python
from datasets import load_dataset

# Load all training shards
ds = load_dataset(
    "json",
    data_files={
        "train": "data/tune_data_stack_overflow_python_qa_run*.jsonl",
        "eval"  : "data/tune_eval_data_stack_overflow_python_qa_run*.jsonl",
    }
)
print(ds)

Use for fine-tuning (Alpaca-style)

python
def format_prompt(ex):
    return {
        "text": f"{ex['input_text_instruct']}\n\n### Response:\n{ex['output_text']}"
    }

train_formatted = ds["train"].map(format_prompt)

πŸ“‹ Instruction Template Used

Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: {title}{body}


⚠️ Caveats

  1. 1.HTML in answers: output_text contains raw HTML tags (<p>, <pre>, <code>). Strip or preserve depending on your use case.
  2. 2.Accepted answers only: We filter q.accepted_answer_id = a.id β€” other community answers are skipped.
  3. 3.~60% match rate: Of each 100K question IDs queried, ~60K have accepted answers in BigQuery. The rest are self-answered, deleted, or lack acceptance.
  4. 4.80/20 split: Each run uses random_state=42 for reproducible train/eval splits.
  5. 5.Mirrors L2_data.ipynb: Format exactly matches DeepLearning.AI's Finetuning Large Language Models course notebook structure.

πŸ” Source Dataset

Question IDs and metadata sourced from:

Answers joined from:

  • β€”bigquery-public-data.stackoverflow.posts_answers (Google BigQuery Public Dataset)

πŸ“‹ Citation

bibtex
@dataset{malik2026stackpulseqa,
  author    = {Malik, Omar Haq Nawaz},
  title     = {StackPulse-QA: Instruction-Tuning Q&A Pairs from Stack Overflow},
  year      = {2026},
  publisher = {HuggingFace},
  url       = {https://huggingface.co/datasets/Omarrran/stackpulse_qa_output},
  license   = {Apache-2.0}
}

πŸ‘€ Author

Omar Haq Nawaz Malik (HuggingFace: Omarrran) AI Engineer & NLP Researcher | BITS Pilani | Srinagar, Kashmir