Software Technology Research
|
3082-3090

Source code migration model based on hierarchical attention mechanism

Li Zheng1
Xu Mingrui1
Wu Yonghao1
Liu Yong1
Chen Xiang2
Wu Shumei1
Liu Hengyuan1
1. College of Information Science & Technology, Beijing University of Chemical Technology, Beijing 100029, China
2. School of Information Science & Technology, Nantong University, Nantong Jiangsu 226019, China

Abstract

To address the semantic consistency problem of migrated code in the source code migration model, this paper introduced the statement-level attention mechanism based on the token-level attention mechanism, proposed a source code migration model HPGN based on the hierarchical attention mechanism, and designed state feeding mechanisms. During migration, the statement-level attention mechanism aligned the features of source code statements and migrated code statements, the tokenlevel attention mechanism extracted tokens from the aligned code statements, and the state feeding mechanism passed the feature of adjacent migrated code statement, thus improving the semantic consistency of migrated code. Experimenting on a real project dataset, the results show that HPGN improves the overall score by 3.4 over the best comparison model while having fewer model parameters. In addition, ablation experiments validate the effectiveness of the state feeding mechanisms and HPGN hierarchical architecture.

Foundation Support

国家自然科学基金资助项目(61872026,61902015)

Publish Information

DOI: 10.19734/j.issn.1001-3695.2023.03.0093
Publish at: Application Research of Computers Printed Article, Vol. 40, 2023 No. 10
Section: Software Technology Research
Pages: 3082-3090
Serial Number: 1001-3695(2023)10-031-3082-09

Publish History

[2023-05-23] Accepted Paper
[2023-10-05] Printed Article

Cite This Article

李征, 徐明瑞, 吴永豪, 等. 基于层次注意力机制的源代码迁移模型 [J]. 计算机应用研究, 2023, 40 (10): 3082-3090. (Li Zheng, Xu Mingrui, Wu Yonghao, et al. Source code migration model based on hierarchical attention mechanism [J]. Application Research of Computers, 2023, 40 (10): 3082-3090. )

About the Journal

  • Application Research of Computers Monthly Journal
  • Journal ID ISSN 1001-3695
    CN  51-1196/TP

Application Research of Computers, founded in 1984, is an academic journal of computing technology sponsored by Sichuan Institute of Computer Sciences under the Science and Technology Department of Sichuan Province.

Aiming at the urgently needed cutting-edge technology in this discipline, Application Research of Computers reflects the mainstream technology, hot technology and the latest development trend of computer application research at home and abroad in a timely manner. The main contents of the journal include high-level academic papers in this discipline, the latest scientific research results and major application results. The contents of the columns involve new theories of computer discipline, basic computer theory, algorithm theory research, algorithm design and analysis, blockchain technology, system software and software engineering technology, pattern recognition and artificial intelligence, architecture, advanced computing, parallel processing, database technology, computer network and communication technology, information security technology, computer image graphics and its latest hot application technology.

Application Research of Computers has many high-level readers and authors, and its readers are mainly senior and middle-level researchers and engineers engaged in the field of computer science, as well as teachers and students majoring in computer science and related majors in colleges and universities. Over the years, the total citation frequency and Web download rate of Application Research of Computers have been ranked among the top of similar academic journals in this discipline, and the academic papers published are highly popular among the readers for their novelty, academics, foresight, orientation and practicality.


Indexed & Evaluation

  • The Second National Periodical Award 100 Key Journals
  • Double Effect Journal of China Journal Formation
  • the Core Journal of China (Peking University 2023 Edition)
  • the Core Journal for Science
  • Chinese Science Citation Database (CSCD) Source Journals
  • RCCSE Chinese Core Academic Journals
  • Journal of China Computer Federation
  • 2020-2022 The World Journal Clout Index (WJCI) Report of Scientific and Technological Periodicals
  • Full-text Source Journal of China Science and Technology Periodicals Database
  • Source Journal of China Academic Journals Comprehensive Evaluation Database
  • Source Journals of China Academic Journals (CD-ROM Version), China Journal Network
  • 2017-2019 China Outstanding Academic Journals with International Influence (Natural Science and Engineering Technology)
  • Source Journal of Top Academic Papers (F5000) Program of China's Excellent Science and Technology Journals
  • Source Journal of China Engineering Technology Electronic Information Network and Electronic Technology Literature Database
  • Source Journal of British Science Digest (INSPEC)
  • Japan Science and Technology Agency (JST) Source Journal
  • Russian Journal of Abstracts (AJ, VINITI) Source Journals
  • Full-text Journal of EBSCO, USA
  • Cambridge Scientific Abstracts (Natural Sciences) (CSA(NS)) core journals
  • Poland Copernicus Index (IC)
  • Ulrichsweb (USA)