Graph Embedding Code Prediction Model Integrating Semantic Features

Kang Yang1, Huiqun Yu1, 2, Guisheng Fan1, 3 and Xingguang Yang1

  1. Department of Computer Science and Engineering, ECUST
    Shanghai, China
  2. Shanghai Key Laboratory of Computer Software Evaluating and Testing, China
    Shanghai, China
    yhq@ecust.edu.cn, Corresponding author
  3. Shanghai Engineering Research Center of Smart Energy, Shanghai, China
    Shanghai, China
    gsfan@ecust.edu.cn, Corresponding author

Abstract

With the advent of Big Code, code prediction has received widespread attention. However, the state-of-the-art code prediction techniques are inadequate in terms of accuracy, interpretability and efficiency. Therefore, in this paper, we propose a graph embedding model that integrates code semantic features. The model extracts the structural paths between the nodes in source code file’s Abstract Syntax Tree(AST). Then, we convert paths into training graph and extracted interdependent semantic structural features from the context of AST. Semantic structure features can filter predicted candidate values and effectively solve the problem of Out-of-Word(OoV). The graph embedding model converts the structural features of nodes into vectors which facilitates quantitative calculations. Finally, the vector similarity of the nodes is used to complete the prediction tasks of TYPE and VALUE. Experimental results show that compared with the existing state-of-the-art method, our method has higher prediction accuracy and less time consumption.

Key words

Big Code, Graph Embedding, Code Prediction

Digital Object Identifier (DOI)

https://doi.org/10.2298/CSIS190908027Y

Publication information

Volume 17, Issue 3 (October 2020)
Year of Publication: 2020
ISSN: 1820-0214 (Print) 2406-1018 (Online)
Publisher: ComSIS Consortium

Full text

DownloadAvailable in PDF
Portable Document Format

How to cite

Yang, K., Yu, H., Fan, G., Yang, X.: Graph Embedding Code Prediction Model Integrating Semantic Features. Computer Science and Information Systems, Vol. 17, No. 3, 907–926. (2020), https://doi.org/10.2298/CSIS190908027Y