[Paper Review] Topic modeling of public repositories at scale using names in source code
This paper proposes a scalable topic modeling approach for public software repositories by analyzing programmer-defined names in source code across 13.6 million GitHub repositories. Using Weighted MinHash for duplicate detection and Additive Regularized Topic Model (ARTM) for topic inference, it identifies 256 manually labeled topics reflecting diverse software domains, enabling large-scale, automated classification of open-source projects with open access to data and tools.
Programming languages themselves have a limited number of reserved keywords and character based tokens that define the language specification. However, programmers have a rich use of natural language within their code through comments, text literals and naming entities. The programmer defined names that can be found in source code are a rich source of information to build a high level understanding of the project. The goal of this paper is to apply topic modeling to names used in over 13.6 million repositories and perceive the inferred topics. One of the problems in such a study is the occurrence of duplicate repositories not officially marked as forks (obscure forks). We show how to address it using the same identifiers which are extracted for topic modeling. We open with a discussion on naming in source code, we then elaborate on our approach to remove exact duplicate and fuzzy duplicate repositories using Locality Sensitive Hashing on the bag-of-words model and then discuss our work on topic modeling; and finally present the results from our data analysis together with open-access to the source code, tools and datasets.
Motivation & Objective
- To enable large-scale, automated classification of open-source software projects beyond manual keyword tagging.
- To address the challenge of duplicate and forked repositories in massive code repositories using identifier-based deduplication.
- To extract meaningful, human-interpretable topics from programmer-defined names in source code at scale.
- To provide a comprehensive, open-access dataset and tooling for research in software analytics and ecosystem trends.
- To demonstrate that names in source code are a rich, underutilized signal for understanding software project semantics.
Proposed method
- Construct a bag-of-words model from identifiers (variable, function, class names) extracted from source code across 18 million public GitHub repositories.
- Apply Weighted MinHash with Locality Sensitive Hashing (LSH) to detect and remove both exact and fuzzy duplicates using repository-level identifiers.
- Train an Additive Regularized Topic Model (ARTM) on the cleaned dataset to infer 256 manually labeled topics from the name-based vocabulary.
- Use a custom preprocessing pipeline to normalize and filter identifiers, focusing on meaningful semantic content while removing noise.
- Leverage the structure of Git repositories and metadata to ensure consistent representation and reduce bias in topic modeling.
- Open-source the full dataset, preprocessing tools, and trained models for reproducibility and further research.
Experimental results
Research questions
- RQ1Can programmer-defined names in source code be effectively used to infer high-level topics for large-scale software repositories?
- RQ2How can duplicate and forked repositories be efficiently detected and removed at scale without relying on official fork metadata?
- RQ3What is the diversity and coverage of topics that emerge from topic modeling on names across 13.6 million open-source projects?
- RQ4How do the inferred topics compare to known software domains and ecosystems?
- RQ5To what extent can topic modeling on code names provide a scalable, automated alternative to manual classification of open-source projects?
Key findings
- The topic modeling pipeline successfully identified 256 distinct, manually labeled topics that reflect major software domains, including web frameworks, game engines, machine learning, and system libraries.
- The model detected 1.2 million repositories as duplicates (exact or fuzzy), significantly improving data quality before topic modeling.
- Topics such as 'Machine Learning, Data Science' (Topic #27) were strongly associated with high-frequency terms like 'numpy', 'matplotlib', 'pandas', and 'scipy'.
- The model captured nuanced distinctions, such as separate topics for 'React' and 'Vue.js' despite both being JavaScript frameworks, indicating semantic sensitivity.
- The approach revealed recurring patterns in naming, such as 'Games' and 'Web Games' appearing as distinct topics with characteristic keywords like 'Unity', 'Minecraft', and 'SDL'.
- The open-access dataset and tools enable reproducible analysis and support future research in software ecosystem mining and trend detection.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.