arrow
Return

KG4Py: A toolkit for generating Python knowledge graph and code semantic search

delete2022-05-11
delete5
delete
OA
AI
L
Lu Liang
李勇 (Yong Li) *
文明 (Ming Wen)
Y
Ying Liu
DOI:10.1080/09540091.2022.2072471delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
In the era of big data, there are numerous duplicate code snippets on the Internet, it is especially necessary to make use of them to build new software projects. In this paper, we present a toolkit (KG4Py) for generating a knowledge graph of Python files in GitHub repositories and conducting semantic search with the knowledge graph. In KG4Py, we remove all duplicate files in 317 K Python files and perform static code analyses of these files by using a concrete syntax tree (CST) to build a code knowledge graph of Python functions. We integrate a pre-trained model with an unsupervised model to generate a new model, and combine this new model with a code knowledge graph for the purpose of searching code snippets with natural language descriptions. The experimental results show that KG4Py achieves good performance in both the construction of the code knowledge graph and the semantic search of code snippets.
Keywords:
Knowledge graph
static code analysis
information extraction
deep learning
code semantic search

Journal

Connection Science cover
Connection Science
IF:
3.4
Papers:
843
Citations:
1.5K

Organization

X
Xinjiang Normal University
Scholars:
2.2K
Papers: 1.1K
Citations: 822