DOI: 10.3390/app16157777 ISSN: 2076-3417

A Software Repository Tag Method Based on Hybrid Search and Graph Enhancement

Min Wang, Shanshan Wu, Wanjia Lv, Yu Zhao

Software repositories play an essential role in modern software engineering by enabling code sharing, collaboration, and reuse. Repository tag recommendation is a key technique for improving the discoverability and organization of software repositories. However, existing methods still suffer from noisy annotations, incomplete tag coverage, long-tailed label distributions, and limited adaptability to emerging technical terms. To address these issues, this paper proposes ReG-TG, a retrieval-augmented framework for repository tag recommendation. ReG-TG integrates hybrid retrieval, a tag co-occurrence knowledge graph, and Chain-of-Thought (CoT) reasoning within a large language model (LLM)-based architecture. Specifically, the hybrid retrieval module combines dense semantic embeddings and sparse lexical matching to retrieve relevant reference repositories, followed by a reranking mechanism to refine candidate results. A tag co-occurrence graph is further constructed to model structural relationships among tags and provide graph-enhanced tag knowledge. The retrieved context and graph-enhanced information are then incorporated into structured prompts to guide LLM-based tag generation. Experimental results on multiple GitHub repository datasets show that ReG-TG consistently outperforms representative baselines, including TF-IDF+LR, ZestXML, and LEGION, in terms of Precision@5, Recall@5, and F1-score@5. Further ablation studies demonstrate that retrieval augmentation, hybrid retrieval, reranking, graph enhancement, and structured reasoning each contribute to performance improvement. In addition, long-tail analysis shows that ReG-TG maintains better robustness on low-frequency labels, indicating its effectiveness in alleviating the sparsity and long-tail challenges in repository tag recommendation.

More from our Archive