Industry Classification of GitHub Repositories Using the North American Industry Classification System (NAICS)
Summary
NAICS-GH is a newly released corpus of 6,588 GitHub repositories, each labeled with a 2-digit sector from the North American Industry Classification System (NAICS 2022). This dataset addresses the lack of standardized industry mapping for GitHub repositories, which hinders empirical research on innovation geography and open-source production. The corpus was generated using a retrieve-and-verify pipeline combining BAAI/bge-large-en embeddings, FAISS retrieval, and GPT-4.1 rubric scoring. This pipeline processed approximately 1.37 million source repositories, narrowing them to 31,178 candidate pairs and retaining 6,588 high-confidence labels with a score of at least 8. The pipeline's reproducibility is high, with candidate sets reproducing to within 0.03 percent. Human validation on a 2,421-repository random sample confirmed 96.98 percent precision, with a Wilson 95 percent confidence interval of [96.23, 97.59]. Benchmarking six pretrained encoders on NAICS-GH showed RoBERTa-large achieving 86.45 percent F1 and 86.35 percent accuracy on a held-out 20 percent test set. The dataset, code, and fine-tuned checkpoint are available under CC-BY-4.0 and MIT licenses.
Key takeaway
For data scientists and economists studying innovation or open-source trends, NAICS-GH offers a critical resource for industry-specific analysis. You can now directly map GitHub repositories to 2-digit NAICS sectors, enabling more precise empirical work on technology diffusion and industrial composition. Consider integrating this corpus into your research to gain granular insights into sector-specific open-source contributions and benchmark your own classification models against a high-precision, human-validated dataset.
Key insights
A new corpus, NAICS-GH, provides 6,588 GitHub repositories with 2-digit NAICS labels, enabling industry-specific open-source analysis.
Principles
- Hybrid AI pipelines enhance data labeling precision.
- High-confidence thresholds improve corpus reliability.
- Standardized industry classification aids economic research.
Method
A retrieve-and-verify pipeline uses BAAI/bge-large-en embeddings, FAISS retrieval, and GPT-4.1 rubric scoring to label GitHub repositories with NAICS 2022 sectors.
In practice
- Use NAICS-GH for innovation geography studies.
- Analyze open-source production by industry sector.
- Benchmark encoders on industry-specific codebases.
Topics
- GitHub Repository Classification
- NAICS Industry Codes
- Large Language Models
- Vector Embeddings
- Open-Source Data
- Empirical Economics
Best for: Research Scientist, AI Scientist, Machine Learning Engineer, Data Scientist
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Artificial Intelligence.