Repo2Vec:一种综合嵌入的知识库相似性判定方法
Repo2Vec: A Comprehensive Embedding Approach for Determining Repository Similarity
摘要:
我们如何在大型在线存档(如GitHub)中识别类似的存储库和集群?确定内容相似性是研究此类软件生态系统动态和演变的重要组成部分。关键的挑战是确定不同的存储库功能的正确表示方式:(a)它捕获了可用信息的所有方面,(b)它易于被ML算法使用。我们提出了Repo2Vec,一个全面的嵌入方法来表示一个存储库作为一个分布式向量相结合的功能,从三种类型的信息源。作为我们的主要新颖性,我们考虑三种类型的信息:(a)元数据,(b)存储库的结构,以及(c)源代码。我们还介绍了一系列的嵌入方法来表示和组合这些信息类型到一个单一的嵌入。我们使用来自GitHub的两个真实数据集对我们的方法进行了评估,合并了1013个存储库。首先,我们证明了我们的方法在精确度方面优于以前的方法(93%vs 78%),强相似存储库的数量几乎是以前的两倍,假阳性减少了30%。其次,我们展示了Repo2Vec如何为以下方面提供坚实的基础:(a)区分恶意软件和良性存储库,以及(b)识别有意义的分层聚类。例如,我们在区分恶意软件和良性存储库方面实现了98%的准确率和96%的召回率。总的来说,我们的工作是一个基本的构建块,使许多存储库分析功能,如存储库分类的目标平台或意图,检测代码重用和克隆,并确定血统和演变。
英文摘要:
How can we identify similar repositories and clusters among a large online archive, such as GitHub? Determiningrepository similarity is an essential building block in studying the dynamics and the evolution of such software ecosystems. The key challenge is to determine the right representation for the diverse repository features in a way that: (a) it captures all aspects of the available information, and (b) it is readily usable by MLalgorithms. We propose Repo2Vec, a comprehensive embedding approach to represent a repository as a distributed vector by combining features from three types of information sources. As our key novelty, we consider three types of information: (a)metadata, (b) the structure of the repository, and (c) the source code. We also introduce a series of embedding approaches to represent and combine these information types into a single embedding. We evaluate our method with two real datasets from GitHub for a combined 1013 repositories. First, we show that our method outperforms previous methods in terms of precision (93%vs 78%), with nearly twice as many Strongly Similar repositories and 30% fewer False Positives. Second, we show how Repo2Vecprovides a solid basis for: (a) distinguishing between malware and benign repositories, and (b) identifying a meaningful hierarchical clustering. For example, we achieve 98% precision and 96%recall in distinguishing malware and benign repositories. Overall, our work is a fundamental building block for enabling many repository analysis functions such as repository categorization by target platform or intention, detecting code-reuse and clones, and identifying lineage and evolution.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。