Open-source development has revolutionized the software industry by promoting collaboration, transparency, and community-driven innovation. Today, a vast amount of various kinds of open-source software, which form networks of repositories, is often hosted on GitHub - a popular software development platform. To enhance the discoverability of the repository networks, i.e., groups of similar repositories, GitHub introduced repository topics in 2017 that enable users to more easily explore relevant projects by type, technology, and more. It is thus crucial to accurately assign topics for each GitHub repository. Current methods for automatic topic recommendation rely heavily on TF-IDF for encoding textual data, presenting challenges in understanding semantic nuances. This paper addresses the limitations of existing techniques by proposing Legion, a novel approach that leverages Pre-trained Language Models (PTMs) for recommending topics for GitHub repositories. The key novelty of Legion is three-fold. First, Legion leverages the extensive capabilities of PTMs in language understanding to capture contextual information and semantic meaning in GitHub repositories. Second, Legion overcomes the challenge of long-tailed distribution, which results in a bias toward popular topics in PTMs, by proposing a Distribution-Balanced Loss (DB Loss) to better train the PTMs. Third, Legion employs a filter to eliminate vague recommendations, thereby improving the precision of PTMs. Our empirical evaluation on a benchmark dataset of real-world GitHub repositories shows that Legion can improve vanilla PTMs by up to 26% on recommending GitHubs topics. Legion also can suggest GitHub topics more precisely and effectively than the state-of-the-art baseline with an average improvement of 20% and 5% in terms of Precision and F1-score, respectively.
翻译:开源开发通过促进协作、透明度和社区驱动的创新,彻底改变了软件行业。如今,大量不同类型的开源软件(形成仓库网络)通常托管在GitHub这一流行的软件开发平台上。为增强仓库网络(即相似仓库组)的可发现性,GitHub于2017年引入仓库主题功能,使用户能够更轻松地按类型、技术等维度探索相关项目。因此,准确为每个GitHub仓库分配主题至关重要。现有的自动主题推荐方法主要依赖TF-IDF对文本数据进行编码,在理解语义细微差异方面存在挑战。本文提出Legion方法,利用预训练语言模型为GitHub仓库推荐主题,以解决现有技术的局限性。Legion的创新性体现在三个方面:首先,Legion利用PTMs在语言理解方面的强大能力,捕捉GitHub仓库中的上下文信息和语义含义。其次,Legion通过提出分布平衡损失函数来更好地训练PTMs,克服了长尾分布导致PTMs偏向流行主题的问题。第三,Legion采用过滤器消除模糊推荐,从而提高PTMs的精确度。我们在真实GitHub仓库基准数据集上的实证评估表明,Legion在推荐GitHub主题方面相较于原始PTMs性能提升高达26%。与最先进的基线方法相比,Legion能更精准有效地推荐GitHub主题,精确率和F1分数平均分别提升20%和5%。