exa-ai/CodeDocsNER
收藏资源简介:
--- license: apache-2.0 task_categories: - text-generation language: - en tags: - code - ner pretty_name: CodeDocsNER size_categories: - 100K<n<1M --- # CodeDocsNER A large-scale NER dataset built from **206,382 markdown documentation files** across **4,835 permissively licensed GitHub repositories** (MIT and Apache-2.0), with **~17M named entities** across **25,547 entity types**. Repositories are identified via [GH Archive](https://www.gharchive.org/) star data on BigQuery, filtered to those with at least 5 stars in 2026. File contents are fetched directly from the GitHub API. Entities are annotated using a two-pass approach with DeepSeek v3.2 and spaCy. Built with [github-markdown-exporter](https://github.com/maxwbuckley/github-markdown-exporter). **Data freshness:** This snapshot was fetched on **2026-04-07** directly from GitHub. ## Dataset Structure ### annotations/ (train/test splits) JSONL files with annotated chunks, filtered and normalized. | Field | Type | Description | |-------|------|-------------| | `repo_name` | string | Source repository (owner/repo) | | `path` | string | File path within repo | | `chunk_index` | int | 0-based chunk position within file | | `chunk_text` | string | Stripped, chunked plain text | | `entities` | list | Named entities `[{"text": "...", "label": "..."}, ...]` | Train: 401,020 chunks. Test: 3,470 chunks. ### docs/ (raw markdown content) | Column | Type | Description | |--------|------|-------------| | `repo_name` | string | Repository in `owner/repo` format | | `path` | string | File path within the repo (e.g. `docs/guide.md`) | | `license` | string | `mit` or `apache-2.0` | | `size` | int64 | File size in bytes | | `content` | string | Full markdown text | ### attribution/ (licensing metadata) | Column | Type | Description | |--------|------|-------------| | `repo_name` | string | Repository in `owner/repo` format | | `license_type` | string | `MIT` or `Apache-2.0` | | `copyright_line` | string | Extracted copyright notice | | `has_notice_file` | bool | Whether the repo has a NOTICE file | | `license_text` | string | Full LICENSE file content | | `notice_text` | string | Full NOTICE file content (if any) | ## Filtering Source data: - **License**: Only MIT and Apache-2.0 licensed repositories - **Stars**: Minimum 5 stars received in 2026 (using GH Archive event data) - **File type**: Markdown files (`.md`) only - **Size**: Between 200 bytes and 500 KB (excludes empty templates and generated files) - **Excluded paths**: `vendor/`, `node_modules/`, `.github/`, symlinks Chunks: - **Max characters**: Chunks longer than 2,000 characters are discarded (pre-annotation) - **Max entities**: Chunks with more than 100 total entities are discarded (post-annotation) ## Statistics | Metric | Value | |--------|-------| | Repositories | 4,835 | | Documents | 206,382 | | Annotated chunks (train) | 401,020 | | Annotated chunks (test) | 3,470 | | Entity types (after normalization) | 25,547 | | Total entities (pre-filter) | ~17M | | Annotation cost | $590 (DeepSeek v3.2 via OpenRouter) | ## Attribution Each source document retains its original license. Per-repository license text, copyright notices, and NOTICE file contents are provided in the `attribution/` parquet files for 4,431 of the 4,835 repos (the subset with a discoverable LICENSE file). See the `NOTICES` file for the aggregated Apache 2.0 notices. ## License This dataset is released under the Apache-2.0 license. Source documents retain their original licenses (MIT or Apache-2.0) as specified in the per-document metadata.




