Conclusion
In this paper, we formulate the program retrieval problem as a graph similarity problem. This is achieved by first explicitly representing queries and program snippets as AMR and CPG, respectively. Then, through intra-level and inter-level attention mechanisms to infer fine-grained correspondence by propagating node correspondence along the graph edge. Moreover, such a design can learn correspondence of nodes at different levels, which were mostly ignored by previous works. Experiments have demonstrated the superiority of USRAE.
References
Sadowski C, Stolee K T, Elbaum S. How developers search for code: a case study. In: Proceedings of the 10th Joint Meeting on Foundations of Software Engineering. 2015, 191–201
Ling X, Wu L, Wang S, Pan G, Ma T, Xu F, Liu A X, Wu C, Ji S. Deep graph matching and searching for semantic code retrieval. ACM Transactions on Knowledge Discovery from Data, 2021, 15(5): 88
Yamaguchi F, Golde N, Arp D, Rieck K. Modeling and discovering vulnerabilities with code property graphs. In: Proceedings of 2014 IEEE Symposium on Security and Privacy. 2014, 590–604
Banarescu L, Bonial C, Cai S, Georgescu M, Griffitt K, Hermjakob U, Knight K, Koehn P, Palmer M, Schneider N. Abstract meaning representation for sembanking. In: Proceedings of the 7th Linguistic Annotation Workshop and Interoperability with Discourse. 2013, 178–186
Feng Z, Guo D, Tang D, Duan N, Feng X, Gong M, Shou L, Qin B, Liu T, Jiang D, Zhou M. CodeBERT: a pre-trained model for programming and natural languages. In: Proceedings of Findings of the Association for Computational Linguistics: EMNLP 2020. 2020, 1536–1547
Cambronero J, Li H, Kim S, Sen K, Chandra S. When deep learning met code search. In: Proceedings of the 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 2019, 964–974
Gu X, Zhang H, Kim S. Deep code search. In: Proceedings of the 40th IEEE/ACM International Conference on Software Engineering. 2018, 933–944
Shuai J, Xu L, Liu C, Yan M, Xia X, Lei Y. Improving code search with co-attentive representation learning. In: Proceedings of the 28th International Conference on Program Comprehension. 2020, 196–207
Xu L, Yang H, Liu C, Shuai J, Yan M, Lei Y, Xu Z. Two-stage attention-based model for code search with textual and structural features. In: Proceedings of 2021 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER). 2021, 342–353
Acknowledgements
This work was supported by the National Natural Science Foundation of China (Grant Nos. 62192733 and 62192730).
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Competing interests The authors declare that they have no competing interests or financial conflicts to disclose.
Electronic supplementary material
Rights and permissions
About this article
Cite this article
Gou, Q., Dong, Y., Wu, Y. et al. Semantic similarity-based program retrieval: a multi-relational graph perspective. Front. Comput. Sci. 18, 183209 (2024). https://doi.org/10.1007/s11704-023-2678-8
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11704-023-2678-8