chrisellisNMTAFE's picture
Update README.md
e8a6a94 verified
|
Raw History Blame Contribute Delete
29.3 kB
metadata
pretty_name: GitHub Issues with Comments (huggingface/datasets)
license: other
license_name: upstream-apache-2.0-with-third-party-contributions
license_link: https://github.com/huggingface/datasets/blob/main/LICENSE
language:
  - en
multilinguality:
  - monolingual
size_categories:
  - 1K<n<10K
source_datasets:
  - original
annotations_creators:
  - no-annotation
language_creators:
  - found
task_categories:
  - text-classification
  - feature-extraction
  - sentence-similarity
task_ids:
  - sentiment-classification
  - topic-classification
tags:
  - github
  - issues
  - pull-requests
  - comments
  - software-engineering
  - semantic-search
  - sentiment-analysis
  - education
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*

GitHub Issues with Comments (huggingface/datasets)

A small, structured snapshot of issues and pull requests from the public huggingface/datasets repository, augmented with every comment thread and a set of derived fields, collected through the GitHub REST API. It is used for two downstream demonstrations: sentiment analysis with a Transformers pipeline (Task 2) and semantic search with FAISS (Task 3).

Status: educational dataset. It is a snapshot, not a maintained mirror of the repository. Do not use it to profile or evaluate individual people.

Table of contents

  1. Dataset summary
  2. Motivation and dataset selection
  3. Dataset structure
  4. Data collection process
  5. Augmentation, cleaning and minimisation
  6. Reliability and quality evaluation
  7. Licensing, attribution and permitted use
  8. Compliance with legislation and codes
  9. Risk register and corrective actions
  10. Storage, locations and versioning
  11. Using the dataset
  12. Limitations and bias
  13. Maintenance, takedown and contact
  14. References and citation

1. Dataset summary

Item Value
Source GitHub REST API, GET /repos/huggingface/datasets/issues and /issues/{number}/comments
Content Issues and pull requests (the issues endpoint returns both), state=all
Sampling The most recent N items by creation date (not a random sample)
Records 5,000 (2,862 pull requests and 2,138 issues; 3,641 closed and 1,359 open); 38 columns (28 from the API plus 10 added); about 24.6 MB as Parquet
Comments 13,297 comment texts across 4,084 items that have comments (the API's own counts sum to 13,302; see section 6)
Date range 2022-02-16T15:20:57Z to 2026-10-29T22:11:42Z (created_at)
Collected 2026-10-30T06:37:26 UTC (also stored per row in collected_at)
Language English
Split train only
Format Parquet (Hub default), loadable with datasets

Exact counts are generated automatically by the collection notebook and published in dataset_stats.json; the table above was filled in from the executed run of that notebook.

2. Motivation and dataset selection

Why was it created? To give a realistic, openly accessible text corpus for practising the full data workflow used in AI projects: sourcing through an API, augmentation, publication, sentiment analysis and semantic retrieval.

Why this source?

Criterion Justification
Relevance Issue trackers are a standard source for NLP tasks such as triage, duplicate detection, tone analysis and search.
Accessibility Public repository, documented and versioned REST API; no HTML scraping needed.
Richness Free text (title, body, comments) plus structured fields (state, labels, dates, author association).
Reliability Retrieved from the platform of record, not a third-party copy; each row links back to its source URL.
Low ethical risk Public, open-source project; profile objects are removed and contact details redacted (section 5).
Fit for tasks Mixed lengths and content types (bug reports, feature requests, documentation, release PRs) make retrieval and sentiment evaluation meaningful.

3. Dataset structure

3.1 Added (augmented) fields

Field Type Description
comments list[string] Text of every comment on the item (e-mails/secrets redacted). Replaces the API's integer field of the same name.
comments_count int The API's original comment count (used to validate completeness).
is_pull_request bool True when the item has a pull_request object.
label_names list[string] Flattened label names.
days_to_close float or null Days between created_at and closed_at; null while open.
created_year int Year opened.
title_word_count, body_word_count int Simple length features.
has_body bool Whether a non-empty body exists.
source_repo string Always huggingface/datasets; supports attribution.
collected_at string (ISO 8601, UTC) Collection timestamp for provenance.

3.2 Retained GitHub API fields (main ones)

id, node_id, number, title, body, state, state_reason, locked, labels, created_at, updated_at, closed_at, author_association, draft, html_url, url, repository_url, labels_url, comments_url, events_url, timeline_url, pull_request (links and merged_at only), reactions (counts), closed_by, and the API fields type, active_lock_reason and issue_field_values, which were empty in this snapshot (type and active_lock_reason are 100% null).

Known issue: closed_by. This field is the GitHub user object of whoever closed the item (profile and avatar URLs, from which the account handle can be read). It is populated for the 3,641 closed items (72.8%), with 473 distinct values. It was not removed in v1.0.0 even though the other user objects were (see 3.3 and risk R1). Do not use it to profile contributors. Planned fix: drop it in a patch release (v1.0.1).

3.3 Fields deliberately removed

user, assignee, assignees (names, profile links, avatars), performed_via_github_app, milestone. (closed_by was not removed; see the known issue in 3.2.)

3.4 Example record (abridged)

{
  "number": 1234,
  "title": "Loading a large dataset is very slow",
  "state": "closed",
  "author_association": "NONE",
  "is_pull_request": false,
  "label_names": ["bug"],
  "comments_count": 2,
  "comments": ["Thanks for reporting, can you share your version?", "Fixed in the latest release."],
  "days_to_close": 3.5,
  "html_url": "https://github.com/huggingface/datasets/issues/1234",
  "source_repo": "huggingface/datasets"
}

4. Data collection process

  1. Authentication. A GitHub personal access token with read-only access to public data was stored in Kaggle Secrets and sent as a Bearer header. The token is never written to code, logs, or the dataset.
  2. Issue download. requests paged through /repos/huggingface/datasets/issues?state=all&per_page=100&sort=created&direction=desc, following the Link: rel="next" header until the target number of items was reached.
  3. Resilience. Each response status is checked; HTTP 403/429 responses trigger a wait until X-RateLimit-Reset/Retry-After; 5xx responses use exponential back-off; progress is cached so a failure does not require a full re-download. The collection stays inside GitHub's authenticated limit (5,000 requests/hour).
  4. Comment download. For every item with comments > 0, /issues/{number}/comments was fetched with pagination (the original tutorial only reads the first page). Only the comment text is retained; commenter profile data is discarded.
  5. Validation. Duplicate ids, date range, PR/issue split, empty bodies and comment counts were checked and saved to dataset_stats.json.
  6. Publication. The table was built with Dataset.from_list, pushed to the Hub with a write-scoped Hugging Face token, round-trip verified (5,000 rows and 38 columns after reload) and tagged (v1.0.0).

Notebook: task-1-creating-a-dataset.ipynb (location in section 10). Parameters (OWNER, REPO, NUM_ISSUES = 5000) are defined in its first code cell so the process can be repeated. Executed run: 5,000 issues and PRs downloaded, 0 duplicate ids, and 4,084 comment threads fetched (every item with comments > 0).

5. Augmentation, cleaning and minimisation

Stage What was done Why
Augmentation Added comments, comments_count, is_pull_request, label_names, days_to_close, created_year, length features, provenance fields Enables conversation-level analysis and filtering; supports reproducibility
De-duplication Removed repeated records by GitHub id (0 duplicates found in this run; 5,000 in, 5,000 out) Pagination on an active repository can repeat items
Data minimisation Dropped user, assignee, assignees, performed_via_github_app, milestone. Gap found after the run: closed_by was retained (section 3.2) Removes names, profile URLs and avatars that analysis does not need; the closed_by omission is a documented residual risk (R1)
Redaction Regex replacement of e-mail addresses ([EMAIL]) and credential-like strings for GitHub, Hugging Face and AWS keys ([REDACTED_SECRET]); counts recorded in dataset_stats.json (this run: 45 e-mail replacements and 22 secret-like matches, not manually reviewed, so some may be false positives) Prevents republishing contact details or leaked secrets
Left as is @mentions in free text, original text of titles/bodies/comments, code blocks Mentions are public handles and cannot be separated from code decorators (e.g. @property); raw text is preserved so users can choose their own cleaning

Further, task-specific cleaning (removing HTML comments and template text, shortening code blocks, dropping empty or duplicate texts) is performed inside the Task 2 and Task 3 notebooks and does not modify the published data.

6. Reliability and quality evaluation

Dimension Evaluation Evidence
Source authority High: official API, items link back to GitHub html_url, source_repo
Completeness Medium-high: 13,297 comment texts were collected against 13,302 reported by the API (99.96%, net 5 fewer). The automated per-item check (comment_lists_match_counts) came back false, so at least one item has more fetched comments than its original count (most likely comments posted between the issue download and the comment download); the net shortfall suggests other items have fewer (for example deleted comments). Per-item reconciliation has not yet been done (risk R9) comments_count vs len(comments), dataset_stats.json
Accuracy High for metadata (machine-generated by GitHub); text is as written by authors, including typos and non-English fragments n/a
Currency A snapshot: state, labels and comments change after collected_at collected_at
Consistency Mixed record types (issues and PRs) are flagged by is_pull_request; some PRs have templated or empty bodies has_body, is_pull_request
Representativeness Low-medium: one project, newest N items, English, technical audience section 12
Documentation Full: this card, dataset_stats.json, notebooks, pinned release tag section 10

Missing-value profile (from the Task 1 and Task 2 notebooks): body is empty for 388 items (7.8%); closed_at, closed_by and days_to_close are null for the 1,359 open items (27.2%) by design; state_reason is null for 72.4%; pull_request and draft are null for the 2,138 issues (42.8%); type and active_lock_reason are 100% null.

7. Licensing, attribution and permitted use

  • Upstream project: huggingface/datasets is released under Apache-2.0.
  • Third-party content: issue and comment text is authored by many individuals who retain rights in their contributions. Apache-2.0 on the code repository does not by itself relicense every comment, so this card uses license: other instead of claiming a blanket open licence.
  • Attribution: each row carries html_url and source_repo. Credit the GitHub authors and the huggingface/datasets project when reusing text.
  • Permitted use: education, teaching, and non-commercial research and prototyping, subject to the GitHub Terms of Service and Acceptable Use Policies (including the prohibition on using API-collected personal information for spam or sale) and the Hugging Face Terms and Content Policy.
  • Not permitted / out of scope: profiling, ranking or targeting individual contributors; re-identification; unsolicited contact; use as sole evidence for decisions about people; training systems intended to impersonate contributors.
  • Commercial use: not assessed. Obtain separate legal advice first.

This card documents the author's good-faith interpretation and is not legal advice.

8. Compliance with legislation and codes

8.1 Legislation and external codes

Instrument Relevance to this dataset How it is addressed Status
Privacy Act 1988 (Cth) and Australian Privacy Principles (APP 1 open management, APP 3 collection, APP 6 use/disclosure, APP 11 security) Applies directly to many APP entities; used here as the benchmark for good practice. Collection limited to public data needed for the purpose; most profile objects dropped (the closed_by object remains until v1.0.1, see R1); e-mails redacted; security of tokens and storage described; takedown route provided Aligned (best practice)
Copyright Act 1968 (Cth) Issue/comment text is copyright of its authors; Australian fair-dealing exceptions (research or study) are narrower than US fair use and there is no general text-and-data-mining exception Educational, non-commercial purpose; attribution via html_url; license: other with explicit explanation; takedown process; no claim of ownership Residual risk: see R2
GDPR (EU) 2016/679 Some contributors may be in the EU; extraterritorial reach is arguable Applied as a precaution: data minimisation, purpose limitation, storage limitation and an erasure/objection route Precautionary
GitHub Terms of Service, Acceptable Use Policies and API terms Governs how data may be collected and reused Official API only; authenticated; rate limits respected; no scraping of HTML; no use for spam or sale of personal information Aligned
Hugging Face Terms of Service and Content Policy Governs hosting the dataset publicly Public repository, accurate card, no illegal or sensitive personal content intended; takedown route Aligned
Australia's AI Ethics Principles (2019, voluntary) Guidance for AI projects See 8.2 Aligned
Datasheets for Datasets (Gebru et al.) Widely used documentation standard for datasets Sections 2 to 13 follow its Motivation, Composition, Collection, Preprocessing, Uses, Distribution and Maintenance structure Aligned

8.2 Alignment with Australia's AI Ethics Principles

Principle How it is reflected
Privacy protection and security Minimisation, redaction, scoped tokens, secret management
Fairness Bias and representativeness limits documented (section 12); no attribute inference
Transparency and explainability Full collection and processing documentation; "behind the pipeline" demonstration in Task 2
Reliability and safety Validation checks, round-trip verification, known limitations of the sentiment model
Contestability Takedown/correction route (section 13)
Accountability Named maintainer, versioning, changelog
Human-centred values and wellbeing Intended-use limits prohibit profiling or targeting of individuals
Human, social and environmental wellbeing Small CPU-friendly corpus and model choices keep compute use low

9. Risk register and corrective actions

Likelihood (L) and Impact (I): Low / Medium / High, assessed after current controls.

# Risk L I Controls in place Corrective action / future mitigation
R1 Personal information in free text (names, handles, contact details) and in the retained closed_by object M M Most profile objects dropped; e-mails and secret-like strings redacted (45 and 22 replacements); closed_by not yet removed Drop closed_by (profile and avatar URLs retained in v1.0.0, see 3.2) in v1.0.1; add NER-based detection (e.g. Presidio) for names and phone numbers; evaluate pseudonymising @mentions; remove affected rows on request
R2 Copyright / licence ambiguity of third-party text M M license: other with explanation; attribution URLs; educational scope; takedown process Seek legal or IP guidance; consider publishing only IDs plus a re-download script if advised
R3 Credential leakage (GitHub/HF tokens in code, logs or data) L H Kaggle Secrets; read-only GitHub token; secret-pattern redaction in text; tokens never printed Rotate tokens once the dataset is finalised; add pre-push secret scanning (e.g. detect-secrets); revoke immediately if exposure is suspected and follow standard incident-response steps
R4 Harmful or toxic language in issues or comments L M Public, moderated project; intended use is analysis not generation Add toxicity screening and a content warning if the dataset is reused for model training
R5 Sampling and representation bias (single repo, newest N, English, developer audience) H M Documented limitations; analysis restricted to comparisons within the data Collect from several repositories; use stratified sampling over time and issue type
R6 Staleness / irreproducibility (items change after collection) H L collected_at per row; commit SHA and release tag; cached raw download Scheduled re-collection with new semantic version and changelog
R7 Misuse for profiling individuals L H Author fields removed; prohibited uses stated Monitor Community tab; restrict or remove the dataset if misuse is reported
R8 Breach of API terms or rate limits L M Official API only; authenticated; wait-and-retry; no HTML scraping Review GitHub terms before any scale-up
R9 Incomplete or inconsistent data (truncated comment lists, comments added or deleted during collection) H (observed) L Status-code checks, retries, validation of comment counts; the check flagged a mismatch in this run (13,297 collected vs 13,302 expected) Identify the affected items, re-fetch them, and make the validation fail loudly rather than only recording false in dataset_stats.json
R10 Prompt injection (issue text containing instructions aimed at LLM tools) when the data is used with LLMs L M Notebooks use classification and embeddings only, not instruction-following Treat text as untrusted input; sandbox and filter before use in LLM agents
R11 Misinterpretation of sentiment results (movie-review model on technical text) H M Limitations quantified in Task 2: 96.2% of items labelled NEGATIVE; all 6 neutral technical probe sentences labelled NEGATIVE (confidence 0.994 to 0.999); 7.6% of items truncated; small human audit Fine-tune or evaluate a software-engineering sentiment model with human labels

10. Storage, locations and versioning

Artefact Location Access / protection Version identifier
Published dataset and this card Hugging Face Hub: https://huggingface.co/datasets/chrisellisNMTAFE/github-raw-with-comments-v2 Public read; write requires the owner's authenticated account token over HTTPS Git tag v1.0.0 points to commit 497d364f2bf849a720ddd478c3eb3c2d78c500a2 (data and statistics, created 2026-10-30 07:02 UTC). Tasks 2 and 3 are pinned to commit f9553a35bc834bb84191c85a874b96599e7cc293 (2026-10-30 07:05 UTC), the first commit that carries this full card
Collection statistics dataset_stats.json in the same repository Public Same commit
Task 1 notebook (collection and publication) Kaggle notebook task-1-creating-a-dataset (https://www.kaggle.com/code/chrisellis20167561/task-1-creating-a-dataset); exported copy task-1-creating-a-dataset.ipynb Owner account; access control per platform Executed 2026-10-30
Task 2 notebook and outputs (outputs_task2/: figures and sentiment_results.csv) Kaggle notebook task-2-sentiment-analysis (https://www.kaggle.com/code/chrisellis20167561/task-2-sentiment-analysis); outputs in /kaggle/working/outputs_task2 Owner account Ran against dataset commit f9553a35bc834bb84191c85a874b96599e7cc293
Task 3 notebook and outputs (outputs_task3/: embeddings, FAISS index, run record) Kaggle notebook task-3-semantic-search-with-faiss (https://www.kaggle.com/code/chrisellis20167561/task-3-semantic-search-with-faiss); outputs in outputs_task3/ Owner account Dataset commit f9553a35bc834bb84191c85a874b96599e7cc293; datasets 4.8.5, sentence-transformers 5.7.0, faiss-cpu 1.15.1, scikit-learn 1.6.1, pandas 2.3.3, numpy 2.1.3, seed 42
Raw API dump and comment cache (outputs/*.jsonl, *-cache.json) Private notebook working directory only; never uploaded Private; deleted once the dataset is finalised n/a
Secrets (GitHub token, Hugging Face token) Kaggle Secrets (or environment variables when run locally) Never stored in notebooks, outputs or the dataset; revocable in provider settings Rotated once the dataset is finalised

Versioning scheme. Semantic versions are applied as Hub tags. A patch (v1.0.1) fixes errors without schema change; a minor version (v1.1.0) adds rows or fields compatibly; a major version (v2.0.0) changes the schema or sampling. Downstream notebooks pin revision=<commit SHA> for exact reproducibility (Tasks 2 and 3 pin f9553a35bc834bb84191c85a874b96599e7cc293). The data file is the same in both commits (5,000 rows, 38 columns, about 24.6 MB Parquet); later commits that only edit this card do not change the data.

Changelog

Version Date Change
v1.0.0 2026-10-30 First release of this repository: 5,000 issues and PRs with comments, derived fields, minimisation and redaction. The tag sits on the data commit 497d364f; the full card was added in the next commit f9553a35
v1.0.1 (planned) Not yet scheduled Drop closed_by; reconcile comment counts (see R1 and R9)

11. Using the dataset

from datasets import load_dataset

ds = load_dataset("chrisellisNMTAFE/github-raw-with-comments-v2", split="train")
# Reproducible: pin the exact commit
# ds = load_dataset("chrisellisNMTAFE/github-raw-with-comments-v2", split="train", revision="f9553a35bc834bb84191c85a874b96599e7cc293")

df = ds.to_pandas()
issues_only = df[~df["is_pull_request"]]

Companion notebooks: Task 2 (sentiment analysis with distilbert-base-uncased-finetuned-sst-2-english, including a manual tokenization, model and post-processing walkthrough) and Task 3 (embeddings with all-MiniLM-L6-v2, FAISS cosine index, retrieval evaluation, bias and coverage-gap analysis).

Measured outcomes of the companion notebooks (executed 2026-10-30)

Task Result
Task 2: coverage 4,896 of 5,000 items classified (104 dropped for fewer than 3 words after cleaning); 2,000 sampled comments classified separately
Task 2: distribution 96.2% NEGATIVE, 3.8% POSITIVE; median confidence 0.999; 3.6% of predictions below 0.9 confidence
Task 2: groups NEGATIVE share: issues 97.8% vs pull requests 94.9%; open 97.1% vs closed 95.8%; by year 94.8% to 97.6%; comments 85.0%
Task 2: limits tested 6 of 6 neutral technical probe sentences labelled NEGATIVE (0.994 to 0.999); 7.6% of items exceed 512 tokens; a 20-item audit judged 16 neutral, with 3 of 4 non-neutral items agreeing with the model (too small for firm conclusions)
Task 3: indexing 4,835 records embedded after cleaning (103 under 3 words, 62 exact duplicates removed); 384 dimensions; exact cosine index (IndexFlatIP); self-retrieval 100%; saved and reloaded index identical
Task 3: retrieval quality precision@5 on four queries: documentation 1.0, feature request 0.8, performance 0.8, crash 0.2 (provisional judgements from titles and snippets); semantic and keyword top-5 overlapped by 0 to 1 items
Task 3: bias and coverage retrieved items had a median of 31 words against 79 in the corpus; 44.6% of records never retrieved in 500 probe searches (Gini 0.62); 37.2% of records exceed the 256-token window; 0.8% have a near-duplicate; out-of-domain query top-1 cosine 0.339 against 0.418 to 0.685 in-domain

Intended uses: teaching data collection and AI workflows; prototyping text classification, clustering and semantic search on software-engineering text.

Out-of-scope uses: see section 7.

12. Limitations and bias

  • Single-source, English, technical text. Findings do not generalise to other projects or non-developer language.
  • Newest-N sampling. The corpus over-represents recent releases and workflows. It is not a random sample of the project's history.
  • Mixed record types. Pull requests often contain templated or terse bodies that differ from issue text.
  • Snapshot. States, labels and comments change after collection. Comment totals differ slightly from the API's counts (13,297 vs 13,302).
  • Retained closed_by object. Profile and avatar URLs of the user who closed an item remain in this version (section 3.2).
  • No human annotation. The dataset contains no sentiment or topic labels; any labels produced by the companion notebooks are model predictions.
  • Sentiment-model mismatch. The SST-2 model was trained on movie reviews and has no neutral class. Technical words such as "error" or "fail" can push predictions towards NEGATIVE, and in this snapshot 96.2% of items were labelled NEGATIVE, including neutral sentences such as "Fix typo in the README." Compare groups rather than reading absolute percentages.
  • Search bias and coverage gaps. Embedding search favours well-represented topics, can return near-duplicates and truncates text beyond 256 tokens (37.2% of cleaned records); in the Task 3 run, retrieved items were much shorter than the corpus (median 31 vs 79 words) and 44.6% of records were never retrieved in 500 probe searches.

13. Maintenance, takedown and contact

  • Maintainer: chrisellisNMTAFE on Hugging Face.
  • Corrections, removal and objection requests: open a thread in this repository's Community tab or contact the maintainer. Requests from individuals to remove their content will be actioned by deleting the affected rows and publishing a new version.
  • Security issues (for example an exposed credential): report privately to the maintainer; the credential will be revoked and rotated and the data corrected.
  • Update plan: no scheduled updates; new versions only for fixes or on request (see section 10).

14. References and citation

Suggested citation

@misc{github_issues_with_comments_2026,
  title        = {GitHub Issues with Comments (huggingface/datasets)},
  author       = {chrisellisNMTAFE},
  year         = {2026},
  howpublished = {Hugging Face Datasets},
  url          = {https://huggingface.co/datasets/chrisellisNMTAFE/github-raw-with-comments-v2},
  note         = {Educational snapshot of issues and pull requests from github.com/huggingface/datasets}
}

Card last updated: 2026-10-30.