← Latest papers
🤖 AI

Industry Classification of GitHub Repositories Using the North American Industry Classification System (NAICS)

This paper introduces NAICS-GH, a high-precision, publicly released corpus of 6,588 GitHub repositories labeled with NAICS 2022 industry sectors using a retrieve-and-verify pipeline combining BAAI/bge-large-en embeddings and GPT-4.1, which achieves 96.98% human-validated precision and serves as a benchmark for industry classification in open-source innovation research.

Original authors: Kevin Xu, Alexander Quispe

Published 2026-07-08
📖 4 min read☕ Coffee break read

Original authors: Kevin Xu, Alexander Quispe

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine GitHub as a massive, chaotic library containing hundreds of millions of books (code repositories). The problem is that while the library knows the title of every book, it has no "Dewey Decimal System" to tell you what kind of business or industry that book is actually for. Is this code for a bank? A farm? A video game studio? Without this label, it's hard for economists, policymakers, or companies to understand how different industries are using open-source software.

This paper introduces NAICS-GH, a new system that acts like a super-smart librarian to organize these books into the North American Industry Classification System (NAICS)—the standard filing system used by governments in the US, Canada, and Mexico.

Here is how they built it, explained simply:

1. The "Fishing Net" (Retrieval)

First, the team couldn't read every single book in the library (there are over 1.3 million candidates). So, they used a digital fishing net called BGE embeddings and FAISS.

  • The Metaphor: Imagine you have a list of 1,000 specific keywords (like "crop yield," "banking security," or "hospital scheduling"). You throw these keywords into the library, and the net instantly grabs the top 20 books that sound most similar to each keyword.
  • The Result: This net caught about 31,000 potential matches. It cast a wide net to make sure they didn't miss anything, but it also grabbed some "near-misses" (books that sounded similar but weren't quite right).

2. The "Expert Judge" (Verification)

The net was too loose, so they needed a strict judge to verify the catches. They hired GPT-4.1 (a very advanced AI) to act as a domain expert.

  • The Metaphor: Think of GPT-4.1 as a seasoned inspector. For every book the net caught, the inspector reads the cover, the summary, and the first few pages (the repository's description and README).
  • The Rubric: The inspector doesn't just guess; they use a strict checklist (a "rubric"). They ask: "Does this code actually solve a problem for this specific industry?"
    • If the answer is a clear "Yes," the inspector gives it a score of 9 or 10.
    • If it's a "Maybe," the score is lower.
    • If it's a generic tool used by everyone (like a basic calculator), it gets a low score.
  • The Cut-off: They only kept the books that got a score of 8 or higher. This ensured they only kept high-confidence matches.

3. The Final Collection (The Dataset)

After the AI judge filtered out the weak matches, they were left with 6,588 high-quality repositories.

  • These are spread across 19 different industries (like Agriculture, Manufacturing, Healthcare, and Finance).
  • They intentionally left out one category ("Management of Companies") because there weren't enough clear examples to make a reliable group.
  • Crucially: They removed the names of the owners to protect privacy, keeping only the code content and the industry label.

4. Did it Work? (Validation)

To make sure the AI judge wasn't hallucinating, the team hired human research assistants to randomly check 2,421 of these labeled books.

  • The Result: The human judges agreed with the AI 96.98% of the time.
  • The Nuance: The AI was almost perfect for clear-cut industries like "Public Administration" or "Arts & Entertainment." However, it struggled a bit more with "Manufacturing" and "Wholesale Trade," where software can sometimes look generic. The paper notes that if you raise the score requirement to 9 or 10, the accuracy in those tricky industries goes up even higher.

5. The "Teaching Tool" (Benchmark)

Finally, the team used this new, labeled library to teach six different AI models how to classify code on their own.

  • They tested models like RoBERTa, ModernBERT, and DeBERTa.
  • The Winner: A model called RoBERTa-large learned the best, achieving 86.45% accuracy on a test set it had never seen before.
  • The Takeaway: This proves that once you have a good "labeled library," you can train smaller, faster AI models to do the classification work automatically in the future.

Summary

The paper presents a publicly available dataset that maps GitHub code to real-world industries. It was built by:

  1. Casting a wide net to find potential matches.
  2. Using a strict AI judge to verify them against a detailed checklist.
  3. Having humans double-check the work to ensure 97% accuracy.
  4. Releasing the data and the code so anyone can study how different industries use open-source software.

The authors explicitly state this is a North American classification system applied globally, and they warn that while the labels are highly accurate, they are not perfect for every single industry (specifically manufacturing and wholesale). They also note that the system currently works best with English-language code descriptions.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →