Leveraging deep learning for Python version identification

Marcus Gerhold*, Lola Solovyeva, Vadim Zaytsev

*Corresponding author for this work

Research output: Contribution to journalConference articleAcademicpeer-review

1 Citation (Scopus)
40 Downloads (Pure)

Abstract

Python, recognized for its dynamic and adaptable nature, has found widespread application in a myriad of projects. As the language evolves, determining the Python version employed in a project becomes pivotal to ensure compatibility and facilitate maintenance. Deep learning (DL) has emerged as a promising tool to automate this process. In this research, we assess various DL techniques in determining the minimum Python version for a code snippet. We explore the complexities of handling Python data and the DL techniques to achieve high classification accuracy. Our experimental results show, that LSTM with CodeBERT embedding achives an accuracy of 92%. This success can be attributed to the LSTM's proficiency in capturing structural details of the hierarchical nature of a source code, complemented by CodeBERT's ability to discern contextual differences between keywords and variable names. This research provides insights into the challenges associated with utilizing programming languages for deep learning models and suggests potential solutions for addressing these issues. The envisioned applications extend to predicting the minimum required version for individual files or an entire code base.

Original languageEnglish
Pages (from-to)33-40
Number of pages8
JournalCEUR workshop proceedings
Volume3567
Publication statusPublished - 2023
Event22nd Belgium-Netherlands Software Evolution Workshop, BENEVOL 2023 - Nijmegen, Netherlands
Duration: 27 Nov 202328 Nov 2023
Conference number: 22

Keywords

  • CodeBERT
  • Deep Learning
  • Python
  • version identification

Fingerprint

Dive into the research topics of 'Leveraging deep learning for Python version identification'. Together they form a unique fingerprint.

Cite this