Fusion of Contrastive Learning and Heterogeneous Graph for Code Summarization

Aiming at the shortcomings of existing code summary generation methods in dealing with the semantic complexity, structural diversity of code and the fusion of search summary and generation summary, a code summary generation method combining contrast learning and heterogeneous graph is proposed. Firstly, a dense vector retrieval framework based on double encoders is adopted to enhance the retrieval accuracy and semantic diversity of large-scale code data. Secondly, the abstract syntax tree is reconstructed into a heterogeneous graph. By introducing various node and edge types, the model's ability to capture complex semantic relationships between different node and edge types is deepened. Finally, the copy gate mechanism is introduced to realize the dynamic fusion of retrieval abstracts and generated model output in semantic level, which guarantees the semantic accuracy and relevance of generated abstracts. Experimental results confirm the effectiveness of this approach in improving the precision and relevance of generated code summaries.

Authors

Institutions

Publication Details

Published
2024-09-20
DOI
https://doi.org/10.1109/eit63098.2024.10762491
Primary Topic
Web Data Mining and Analysis
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Fusion of Contrastive Learning and Heterogeneous Graph for Code Summarization

Wei Le, Cencen Zhong
Web Data Mining and Analysis
article

Fusion of Contrastive Learning and Heterogeneous Graph for Code Summarization

Wei Le, Cencen Zhong
article en

Abstract

Aiming at the shortcomings of existing code summary generation methods in dealing with the semantic complexity, structural diversity of code and the fusion of search summary and generation summary, a code summary generation method combining contrast learning and heterogeneous graph is proposed. Firstly, a dense vector retrieval framework based on double encoders is adopted to enhance the retrieval accuracy and semantic diversity of large-scale code data. Secondly, the abstract syntax tree is reconstructed into a heterogeneous graph. By introducing various node and edge types, the model's ability to capture complex semantic relationships between different node and edge types is deepened. Finally, the copy gate mechanism is introduced to realize the dynamic fusion of retrieval abstracts and generated model output in semantic level, which guarantees the semantic accuracy and relevance of generated abstracts. Experimental results confirm the effectiveness of this approach in improving the precision and relevance of generated code summaries.

Chengdu University of Information Technology (CN)
Research and Development
Openalex Percentile: Top 60%
Web Data Mining and Analysis
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.