错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Node Embedding of the Abstract Syntax Tree for Source Code Representation

  • Chang-Feng Chen,
  • Azlan Mohd Zain,
  • Kai-Qing Zhou

摘要

Source code representation has garnered significant attention owing to its critical role in solving software engineering problems. There are various methodologies for representing code, and the abstract syntax tree (AST) is one of the most widely used techniques. However, current AST-based approaches need to pay more attention to the impact of AST generation, resulting in high duplication of the tree structure. Additionally, most AST-based methods struggle to balance homophily and structural equivalence in sequence sampling while failing to express semantic information in node feature learning. These limitations lead to poor source code representation and reduced performance in solving software engineering problems. To address these challenges, we propose a novel model that combines a deduplication algorithm, a hybrid sampling strategy, and an optimized skip-gram feature learning approach to represent source code. To evaluate the efficacy of our proposed model, we conduct experiments on OJ datasets for program classification. Our results demonstrate that the proposed model reduces the duplication of the tree structure and improves the representation performance of source code compared with other methods.