Log in

Semantic similarity-based program retrieval: a multi-relational graph perspective

  • Letter
  • Published:
Frontiers of Computer Science Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price includes VAT (Germany)

Instant access to the full article PDF.

References

  1. 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

  2. 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

    Article  Google Scholar 

  3. 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

  4. 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

  5. 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

  6. 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

  7. Gu X, Zhang H, Kim S. Deep code search. In: Proceedings of the 40th IEEE/ACM International Conference on Software Engineering. 2018, 933–944

  8. Shuai J, Xu L, Liu C, Yan M, **a X, Lei Y. Improving code search with co-attentive representation learning. In: Proceedings of the 28th International Conference on Program Comprehension. 2020, 196–207

  9. 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

Download references

Acknowledgements

This work was supported by the National Natural Science Foundation of China (Grant Nos. 62192733 and 62192730).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yunwei Dong.

Ethics declarations

Competing interests The authors declare that they have no competing interests or financial conflicts to disclose.

Electronic supplementary material

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11704-023-2678-8

Navigation