The dataset is currently empty. Upload or create new data files. Then, you will be able to explore them in the Dataset Viewer.

YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/datasets-cards)

Stack Overflow Dataset

Description

Dataset extrait de Stack Overflow contenant des questions et réponses techniques en programmation, collecté en décembre 2025.

Statistiques

  • Questions : 11,550,870
  • Réponses : 20,952,820
  • Total : 32,503,690 posts
  • Taille : 35.44 GB
  • Format : JSONL

Méthode de collecte

Les données ont été collectées via scraping du dump officiel Stack Exchange (archive.org), puis parsées et nettoyées pour extraire le contenu pertinent.

Pipeline de scraping

  1. Téléchargement du dump compressé (.7z) depuis archive.org
  2. Extraction du fichier XML (Posts.xml)
  3. Parsing multiprocessing avec filtrage par score
  4. Nettoyage HTML → texte/markdown
  5. Export en JSONL

Structure des données

Questions

{
  "id": "stackoverflow_q_12345",
  "type": "question",
  "title": "How to parse JSON in Python?",
  "body": "I have a JSON string and want to...",
  "tags": ["python", "json", "parsing"],
  "score": 42,
  "answer_count": 5,
  "view_count": 15000,
  "accepted_answer_id": "67890",
  "creation_date": "2023-05-15T10:30:00",
  "url": "https://stackoverflow.com/questions/12345",
  "source": "stackoverflow"
}

Réponses

{
  "id": "stackoverflow_a_67890",
  "type": "answer",
  "body": "You can use the json module:\n```python\nimport json\ndata = json.loads(string)\n```",
  "parent_id": "12345",
  "score": 128,
  "is_accepted": true,
  "creation_date": "2023-05-15T11:00:00",
  "source": "stackoverflow"
}

Langages de programmation couverts

  • Python
  • JavaScript / TypeScript
  • Java
  • C / C++
  • C#
  • PHP
  • Ruby
  • Go
  • Rust
  • Swift
  • Kotlin
  • SQL
  • Et bien d'autres...

Filtres appliqués

  • Score minimum : 1 (posts avec au moins 1 upvote)
  • Contenu minimum : 50 caractères après nettoyage
  • HTML converti en texte avec préservation des blocs de code

Utilisation

import json

with open('stackoverflow_posts.jsonl', 'r') as f:
    for line in f:
        post = json.loads(line)
        if post['type'] == 'question':
            print(f"Q: {post['title']}")
        else:
            print(f"A: {post['body'][:100]}...")

Licence

Les données Stack Overflow sont sous licence CC BY-SA 4.0. Attribution requise : Stack Overflow / Stack Exchange.

Date de scraping

Décembre 2025

Downloads last month
10